24#include <boost/multi_index_container.hpp>
25#include <boost/multi_index/composite_key.hpp>
26#include <boost/multi_index/identity.hpp>
27#include <boost/multi_index/mem_fun.hpp>
28#include <boost/multi_index/ordered_index.hpp>
29#include <boost/multi_index/random_access_index.hpp>
30#include <boost/multi_index/tag.hpp>
31#include <libxml/xmlstring.h>
32#include <libxml/xmlwriter.h>
50 : boost::multi_index::composite_key<
52 boost::multi_index::const_mem_fun<SwFormat, const OUString&, &SwFormat::GetName>,
53 boost::multi_index::const_mem_fun<SwFormat, sal_uInt16, &SwFormat::Which>,
54 boost::multi_index::identity<value_type>
58 typedef boost::multi_index_container<
59 value_type, boost::multi_index::indexed_by<
60 boost::multi_index::random_access<boost::multi_index::tag<ByPos>>,
61 boost::multi_index::ordered_unique<boost::multi_index::tag<ByTypeAndName>,
65 friend class ::SwFrameFormat;
69 typedef typename std::add_pointer<
70 typename std::add_const<typename std::remove_pointer<value_type>::type>::type>::type
72 typedef typename FrameFormatsContainer::size_type
size_type;
73 typedef typename FrameFormatsContainer::template index<ByPos>::type
index_type;
74 typedef typename index_type::iterator
iterator;
76 typedef typename FrameFormatsContainer::template index<ByTypeAndName>::type
name_index_type;
79 typedef typename std::pair<const_name_iterator, const_name_iterator>
range_type;
100 std::pair<const_iterator, bool>
push_back(
const value_type& x)
102 SAL_WARN_IF(
x->m_ffList !=
nullptr,
"sw.core",
"Inserting already assigned item");
103 assert(
x->m_ffList ==
nullptr);
105 return GetByPos().push_back(
const_cast<value_type
>(
x));
112 SAL_WARN_IF(
x->m_ffList !=
this,
"sw.core",
"Removing invalid / unassigned item");
116 x->m_ffList =
nullptr;
125 (*position)->m_ffList =
nullptr;
146 auto it =
idx.lower_bound(std::make_tuple(rName, sal_uInt16(0)));
148 return { it, itEnd };
161 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
pName));
162 for (
const auto pFormat :
GetByPos())
163 pFormat->dumpAsXml(pWriter);
164 (void)xmlTextWriterEndElement(pWriter);
174 assert(
dynamic_cast<value_type
>(
const_cast<SwFrameFormat*
>(&rFormat)));
177 const auto sOldName = rFormat.
GetName();
179 = [sNewName](
SwFormat* pFormat) { pFormat->SwFormat::SetFormatName(sNewName,
false); };
181 = [sOldName](
SwFormat* pFormat) { pFormat->SwFormat::SetFormatName(sOldName,
false); };
182 bool const renamed =
GetByPos().modify(it, fRenamer, fRenamerUndo);
189 bool ContainsFormat(
const value_type& rpFormat)
const {
return rpFormat->m_ffList ==
this; };
195 =
const_cast<typename std::remove_const<sw::FrameFormats<value_type>
>::type*>(
this);
196 return pThisNonConst->find(
const_cast<value_type
>(pFrameFormat)) != pThisNonConst->end();
203 const int offset = keepDefault ? 1 : 0;
214 std::pair<iterator, bool> res =
GetByPos().push_front(
const_cast<value_type&
>(
x));
230 auto it =
idx.lower_bound(std::make_tuple(rName, sal_uInt16(0)));
231 if (it !=
idx.end() && (*it)->GetName() == rName)
struct _xmlTextWriter * xmlTextWriterPtr
#define SAL_WARN_IF(condition, area, stream)
Dialog to specify the properties of date form field.
FrameFormats< sw::SpzFrameFormat * > SpzFrameFormats
FrameFormats<::SwTableFormat * > TableFrameFormats