// Get the iterator of the exact object (includes pointer!), // e.g for position with std::distance. // There is also ContainsFormat, if you don't need the position.
const_iterator find(const value_type& x) const
{ auto it = GetByTypeAndName().find(std::make_tuple(x->GetName(), x->Which(), x)); return m_vContainer.template project<ByPos>(it);
};
const_name_iterator findByTypeAndName(sal_uInt16 type, const UIName& name) const
{ return GetByTypeAndName().find(std::make_tuple(name, type));
}; // search for formats by name
range_type findRangeByName(const UIName& rName) const
{ auto& idx = GetByTypeAndName(); auto it = idx.lower_bound(std::make_tuple(rName, sal_uInt16(0))); auto itEnd = idx.upper_bound(std::make_tuple(rName, SAL_MAX_UINT16)); return { it, itEnd };
}; // So we can actually check for end()
const_name_iterator typeAndNameEnd() const { return GetByTypeAndName().end(); }
/// fast check if given format is contained here /// @precond pFormat must not have been deleted bool ContainsFormat(const value_type& rpFormat) const { return rpFormat->m_ffList == this; };
/// not so fast check that given format is still alive (i.e. contained here) bool IsAlive(const_value_type pFrameFormat) const
{ auto pThisNonConst
= const_cast<typename std::remove_const<sw::FrameFormats<value_type>>::type*>(this); return pThisNonConst->find(const_cast<value_type>(pFrameFormat)) != pThisNonConst->end();
};
void DeleteAndDestroyAll(bool keepDefault = false)
{ if (empty()) return; constint offset = keepDefault ? 1 : 0; for (const_iterator it = begin() + offset; it != end(); ++it) delete *it; if (offset)
GetByPos().erase(begin() + offset, end()); else
m_vContainer.clear();
};
bool newDefault(const value_type& x)
{
std::pair<iterator, bool> res = GetByPos().push_front(const_cast<value_type&>(x)); if (!res.second)
newDefault(res.first); return res.second;
}; void newDefault(const_iterator const& position)
{ if (position == begin()) return;
GetByPos().relocate(begin(), position);
};
// Override return type to reduce casting
value_type FindFrameFormatByName(const UIName& rName) const
{ auto& idx = GetByTypeAndName(); auto it = idx.lower_bound(std::make_tuple(rName, sal_uInt16(0))); if (it != idx.end() && (*it)->GetName() == rName) return *it; return nullptr;
};
}; typedef FrameFormats<::SwTableFormat*> TableFrameFormats; typedef FrameFormats<sw::SpzFrameFormat*> SpzFrameFormats;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.