1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <rtl/ustrbuf.hxx>
24 #include <sal/log.hxx>
25 #include <tools/solar.h>
26 #include <PageMasterStyleMap.hxx>
28 #include <xmloff/families.hxx>
29 #include <xmloff/xmlaustp.hxx>
30 #include <xmloff/xmlexp.hxx>
31 #include <xmloff/xmlexppr.hxx>
32 #include <xmloff/xmlnamespace.hxx>
33 #include <xmloff/xmlprmap.hxx>
34 #include <xmloff/xmltoken.hxx>
36 #include "impastpl.hxx"
38 using namespace ::com::sun::star
;
39 using namespace ::xmloff::token
;
41 // Class XMLAutoStyleFamily
42 // ctor/dtor class XMLAutoStyleFamily
44 XMLAutoStyleFamily::XMLAutoStyleFamily(
45 XmlStyleFamily nFamily
,
47 rtl::Reference
< SvXMLExportPropertyMapper
> xMapper
,
50 mnFamily( nFamily
), maStrFamilyName(std::move( aStrName
)), mxMapper(std::move( xMapper
)),
51 mnCount( 0 ), mnName( 0 ), maStrPrefix(std::move( aStrPrefix
)), mbAsFamily( bAsFamily
)
54 XMLAutoStyleFamily::XMLAutoStyleFamily( XmlStyleFamily nFamily
) :
55 mnFamily(nFamily
), mnCount(0), mnName(0), mbAsFamily(false) {}
57 void XMLAutoStyleFamily::ClearEntries()
63 data2string(void *data
,
64 const typelib_TypeDescriptionReference
*type
);
67 struct2string(void *data
,
68 const typelib_TypeDescription
*type
)
70 assert(type
->eTypeClass
== typelib_TypeClass_STRUCT
);
72 OUStringBuffer
result("{");
74 const typelib_CompoundTypeDescription
*compoundType
=
75 &reinterpret_cast<const typelib_StructTypeDescription
*>(type
)->aBase
;
77 for (int i
= 0; i
< compoundType
->nMembers
; i
++)
82 OUString::unacquired(&compoundType
->ppMemberNames
[i
])
84 + data2string(static_cast<char *>(data
)+compoundType
->pMemberOffsets
[i
],
85 compoundType
->ppTypeRefs
[i
]));
90 return result
.makeStringAndClear();
94 data2string(void *data
,
95 const typelib_TypeDescriptionReference
*type
)
97 switch (type
->eTypeClass
)
99 case typelib_TypeClass_VOID
:
101 case typelib_TypeClass_BOOLEAN
:
102 return *static_cast<const sal_Bool
*>(data
) ? OUString("true") : OUString("false");
103 case typelib_TypeClass_BYTE
:
104 return OUString::number(*static_cast<const sal_Int8
*>(data
));
105 case typelib_TypeClass_SHORT
:
106 return OUString::number(*static_cast<const sal_Int16
*>(data
));
107 case typelib_TypeClass_LONG
:
108 return OUString::number(*static_cast<const sal_Int32
*>(data
));
109 case typelib_TypeClass_HYPER
:
110 return OUString::number(*static_cast<const sal_Int64
*>(data
));
111 case typelib_TypeClass_UNSIGNED_SHORT
:
112 return OUString::number(*static_cast<const sal_uInt16
*>(data
));
113 case typelib_TypeClass_UNSIGNED_LONG
:
114 return OUString::number((*static_cast<const sal_uInt32
*>(data
)), 16);
115 case typelib_TypeClass_UNSIGNED_HYPER
:
116 return OUString::number((*static_cast<const sal_uInt64
*>(data
)), 16);
117 case typelib_TypeClass_FLOAT
:
118 return OUString::number(*static_cast<const float*>(data
));
119 case typelib_TypeClass_DOUBLE
:
120 return OUString::number(*static_cast<const double*>(data
));
121 case typelib_TypeClass_CHAR
:
122 return ("U+" + OUString::number(*static_cast<const sal_uInt16
*>(data
)));
123 case typelib_TypeClass_STRING
:
124 return *static_cast<OUString
*>(data
);
125 case typelib_TypeClass_TYPE
:
126 case typelib_TypeClass_SEQUENCE
:
127 case typelib_TypeClass_EXCEPTION
:
128 case typelib_TypeClass_INTERFACE
:
130 case typelib_TypeClass_STRUCT
:
131 return struct2string(data
, type
->pType
);
132 case typelib_TypeClass_ENUM
:
133 return OUString::number(*static_cast<const sal_Int32
*>(data
));
135 assert(false); // this cannot happen I hope
141 static OUString
any2string(const uno::Any
& any
)
143 return data2string(const_cast<void*>(any
.getValue()), any
.pType
);
146 // Class SvXMLAutoStylePoolProperties_Impl
147 // ctor class SvXMLAutoStylePoolProperties_Impl
149 XMLAutoStylePoolProperties::XMLAutoStylePoolProperties( XMLAutoStyleFamily
& rFamilyData
, std::vector
< XMLPropertyState
>&& rProperties
, OUString
const & rParentName
)
150 : maProperties( std::move(rProperties
) ),
151 mnPos ( rFamilyData
.mnCount
)
153 static bool bHack
= (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
157 OUStringBuffer
aStemBuffer(32);
158 aStemBuffer
.append( rFamilyData
.maStrPrefix
);
160 if (!rParentName
.isEmpty())
162 aStemBuffer
.append("-" + rParentName
);
165 // Create a name based on the properties used
166 for(XMLPropertyState
const & rState
: maProperties
)
168 if (rState
.mnIndex
== -1)
170 OUString
sXMLName(rFamilyData
.mxMapper
->getPropertySetMapper()->GetEntryXMLName(rState
.mnIndex
));
171 if (sXMLName
.isEmpty())
175 + OUString::number(static_cast<sal_Int32
>(rFamilyData
.mxMapper
->getPropertySetMapper()->GetEntryNameSpace(rState
.mnIndex
)))
179 + any2string(rState
.maValue
));
183 // Finally append an incremental counter in an attempt to make identical
184 // styles always come out in the same order. Will see if this works.
185 aStemBuffer
.append("-z");
186 static sal_Int32 nCounter
= 0;
187 aStemBuffer
.append(nCounter
++));
190 // create a name that hasn't been used before. The created name has not
191 // to be added to the array, because it will never tried again
193 msName
= aStemBuffer
;
194 bool bWarned
= false;
195 while (rFamilyData
.maNameSet
.find(msName
) !=
196 rFamilyData
.maNameSet
.end())
199 SAL_WARN("xmloff", "Overlapping style name for " << msName
);
201 rFamilyData
.mnName
++;
202 msName
= aStemBuffer
+ "-" + OUString::number( static_cast<sal_Int64
>(rFamilyData
.mnName
) );
204 rFamilyData
.maNameSet
.insert(msName
);
208 // create a name that hasn't been used before. The created name has not
209 // to be added to the array, because it will never tried again
212 rFamilyData
.mnName
++;
213 msName
= rFamilyData
.maStrPrefix
+ OUString::number( static_cast<sal_Int64
>(rFamilyData
.mnName
) );
215 while (rFamilyData
.maNameSet
.find(msName
) != rFamilyData
.maNameSet
.end() || rFamilyData
.maReservedNameSet
.find(msName
) != rFamilyData
.maReservedNameSet
.end());
218 #if OSL_DEBUG_LEVEL > 0
219 std::set
<sal_Int32
> DebugProperties
;
220 for (XMLPropertyState
const & rPropState
: maProperties
)
222 sal_Int32
const property(rPropState
.mnIndex
);
223 // serious bug: will cause duplicate attributes to be exported
224 assert(DebugProperties
.find(property
) == DebugProperties
.end());
227 DebugProperties
.insert(property
);
233 bool operator<( const XMLAutoStyleFamily
& r1
, const XMLAutoStyleFamily
& r2
)
235 return r1
.mnFamily
< r2
.mnFamily
;
239 XMLAutoStylePoolParent::~XMLAutoStylePoolParent()
245 struct ComparePartial
247 const XMLAutoStyleFamily
& rFamilyData
;
249 bool operator()(const std::vector
< XMLPropertyState
>& lhs
,
250 const XMLAutoStylePoolProperties
& rhs
) const
252 return rFamilyData
.mxMapper
->LessPartial(lhs
, rhs
.GetProperties());
254 bool operator()(const XMLAutoStylePoolProperties
& lhs
,
255 const std::vector
< XMLPropertyState
>& rhs
) const
257 return rFamilyData
.mxMapper
->LessPartial(lhs
.GetProperties(), rhs
);
263 // Adds an array of XMLPropertyState ( std::vector< XMLPropertyState > ) to list
264 // if not added, yet.
266 bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily
& rFamilyData
, std::vector
< XMLPropertyState
>&& rProperties
, OUString
& rName
, bool bDontSeek
)
268 PropertiesListType::iterator pProperties
= m_PropertiesList
.end();;
269 auto [itBegin
, itEnd
] = std::equal_range(m_PropertiesList
.begin(), m_PropertiesList
.end(), rProperties
, ComparePartial
{rFamilyData
});
271 for (auto it
= itBegin
; it
!= itEnd
; ++it
)
272 if (rFamilyData
.mxMapper
->Equals(it
->GetProperties(), rProperties
))
276 if( bDontSeek
|| pProperties
== m_PropertiesList
.end() )
278 pProperties
= m_PropertiesList
.emplace(itBegin
, rFamilyData
, std::move(rProperties
), msParent
);
282 rName
= pProperties
->GetName();
288 // Adds an array of XMLPropertyState ( std::vector< XMLPropertyState > ) with a given name.
289 // If the name exists already, nothing is done. If a style with a different name and
290 // the same properties exists, a new one is added (like with bDontSeek).
293 bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily
& rFamilyData
, std::vector
< XMLPropertyState
>&& rProperties
, const OUString
& rName
)
295 if (rFamilyData
.maNameSet
.find(rName
) != rFamilyData
.maNameSet
.end())
298 auto it
= std::lower_bound(m_PropertiesList
.begin(), m_PropertiesList
.end(), rProperties
, ComparePartial
{rFamilyData
});
300 it
= m_PropertiesList
.emplace(it
, rFamilyData
, std::move(rProperties
), msParent
);
301 // ignore the generated name
302 it
->SetName( rName
);
307 // Search for an array of XMLPropertyState ( std::vector< XMLPropertyState > ) in list
310 OUString
XMLAutoStylePoolParent::Find( const XMLAutoStyleFamily
& rFamilyData
, const std::vector
< XMLPropertyState
>& rProperties
) const
313 auto [itBegin
,itEnd
] = std::equal_range(m_PropertiesList
.begin(), m_PropertiesList
.end(), rProperties
, ComparePartial
{rFamilyData
});
314 for (auto it
= itBegin
; it
!= itEnd
; ++it
)
315 if (rFamilyData
.mxMapper
->Equals(it
->GetProperties(), rProperties
))
316 sName
= it
->GetName();
321 bool XMLAutoStylePoolParent::operator< (const XMLAutoStylePoolParent
& rOther
) const
323 return msParent
< rOther
.msParent
;
326 // Class SvXMLAutoStylePool_Impl
327 // ctor/dtor class SvXMLAutoStylePool_Impl
329 SvXMLAutoStylePoolP_Impl::SvXMLAutoStylePoolP_Impl( SvXMLExport
& rExp
)
334 SvXMLAutoStylePoolP_Impl::~SvXMLAutoStylePoolP_Impl()
338 // Adds stylefamily-information to sorted list
340 void SvXMLAutoStylePoolP_Impl::AddFamily(
341 XmlStyleFamily nFamily
,
342 const OUString
& rStrName
,
343 const rtl::Reference
< SvXMLExportPropertyMapper
> & rMapper
,
344 const OUString
& rStrPrefix
,
347 // store family in a list if not already stored
348 SvXMLExportFlags nExportFlags
= GetExport().getExportFlags();
349 bool bStylesOnly
= (nExportFlags
& SvXMLExportFlags::STYLES
) && !(nExportFlags
& SvXMLExportFlags::CONTENT
);
351 OUString
aPrefix( rStrPrefix
);
354 aPrefix
= "M" + rStrPrefix
;
357 #if OSL_DEBUG_LEVEL > 0
358 XMLAutoStyleFamily
aTemp(nFamily
);
359 auto const iter
= m_FamilySet
.find(aTemp
);
360 if (iter
!= m_FamilySet
.end())
362 // FIXME: do we really intend to replace the previous nFamily
363 // entry in this case ?
364 SAL_WARN_IF( iter
->mxMapper
!= rMapper
, "xmloff",
365 "Adding duplicate family " << rStrName
<<
366 " with mismatching mapper ! " <<
367 typeid(iter
->mxMapper
.get()).name() << " " <<
368 typeid(*rMapper
).name() );
372 m_FamilySet
.emplace(nFamily
, rStrName
, rMapper
, aPrefix
, bAsFamily
);
375 void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper(
376 XmlStyleFamily nFamily
,
377 const rtl::Reference
< SvXMLExportPropertyMapper
> & rMapper
)
379 XMLAutoStyleFamily
aTemp(nFamily
);
380 auto const iter
= m_FamilySet
.find(aTemp
);
381 if (iter
!= m_FamilySet
.end())
382 const_cast<XMLAutoStyleFamily
&>(*iter
).mxMapper
= rMapper
;
385 // Adds a name to list
386 void SvXMLAutoStylePoolP_Impl::RegisterName( XmlStyleFamily nFamily
, const OUString
& rName
)
388 XMLAutoStyleFamily
aTemp(nFamily
);
389 auto const iter
= m_FamilySet
.find(aTemp
);
390 assert(iter
!= m_FamilySet
.end()); // family must be known
391 const_cast<XMLAutoStyleFamily
&>(*iter
).maNameSet
.insert(rName
);
394 // Adds a name to list
395 void SvXMLAutoStylePoolP_Impl::RegisterDefinedName( XmlStyleFamily nFamily
, const OUString
& rName
)
397 XMLAutoStyleFamily
aTemp(nFamily
);
398 auto const iter
= m_FamilySet
.find(aTemp
);
399 assert(iter
!= m_FamilySet
.end()); // family must be known
400 const_cast<XMLAutoStyleFamily
&>(*iter
).maReservedNameSet
.insert(rName
);
404 // Retrieve the list of registered names
407 void SvXMLAutoStylePoolP_Impl::GetRegisteredNames(
408 uno::Sequence
<sal_Int32
>& rFamilies
,
409 uno::Sequence
<OUString
>& rNames
)
411 // collect registered names + families
412 std::vector
<sal_Int32
> aFamilies
;
413 std::vector
<OUString
> aNames
;
415 // iterate over families
416 for (XMLAutoStyleFamily
const & rFamily
: m_FamilySet
)
418 // iterate over names
419 for (const auto& rName
: rFamily
.maNameSet
)
421 aFamilies
.push_back( static_cast<sal_Int32
>(rFamily
.mnFamily
) );
422 aNames
.push_back( rName
);
426 // copy the families + names into the sequence types
427 assert(aFamilies
.size() == aNames
.size());
429 rFamilies
.realloc( aFamilies
.size() );
430 std::copy( aFamilies
.begin(), aFamilies
.end(), rFamilies
.getArray() );
432 rNames
.realloc( aNames
.size() );
433 std::copy( aNames
.begin(), aNames
.end(), rNames
.getArray() );
436 // Adds an array of XMLPropertyState ( vector< XMLPropertyState > ) to list
437 // if not added, yet.
439 bool SvXMLAutoStylePoolP_Impl::Add(
440 OUString
& rName
, XmlStyleFamily nFamily
, const OUString
& rParentName
,
441 ::std::vector
< XMLPropertyState
>&& rProperties
, bool bDontSeek
)
443 XMLAutoStyleFamily
aTemp(nFamily
);
444 auto const iter
= m_FamilySet
.find(aTemp
);
445 assert(iter
!= m_FamilySet
.end()); // family must be known
447 XMLAutoStyleFamily
&rFamily
= const_cast<XMLAutoStyleFamily
&>(*iter
);
449 auto itPair
= rFamily
.m_ParentSet
.emplace(rParentName
);
450 XMLAutoStylePoolParent
& rParent
= const_cast<XMLAutoStylePoolParent
&>(*itPair
.first
);
453 if (rParent
.Add(rFamily
, std::move(rProperties
), rName
, bDontSeek
))
462 bool SvXMLAutoStylePoolP_Impl::AddNamed(
463 const OUString
& rName
, XmlStyleFamily nFamily
, const OUString
& rParentName
,
464 std::vector
< XMLPropertyState
>&& rProperties
)
466 // get family and parent the same way as in Add()
468 XMLAutoStyleFamily
aTemp(nFamily
);
469 auto const iter
= m_FamilySet
.find(aTemp
);
470 assert(iter
!= m_FamilySet
.end()); // family must be known
472 XMLAutoStyleFamily
&rFamily
= const_cast<XMLAutoStyleFamily
&>(*iter
);
474 auto itPair
= rFamily
.m_ParentSet
.emplace(rParentName
);
475 XMLAutoStylePoolParent
& rParent
= const_cast<XMLAutoStylePoolParent
&>(*itPair
.first
);
478 if (rParent
.AddNamed(rFamily
, std::move(rProperties
), rName
))
488 // Search for an array of XMLPropertyState ( std::vector< XMLPropertyState > ) in list
491 OUString
SvXMLAutoStylePoolP_Impl::Find( XmlStyleFamily nFamily
,
492 const OUString
& rParent
,
493 const std::vector
< XMLPropertyState
>& rProperties
) const
497 XMLAutoStyleFamily
aTemp(nFamily
);
498 auto const iter
= m_FamilySet
.find(aTemp
);
499 assert(iter
!= m_FamilySet
.end()); // family must be known
501 XMLAutoStyleFamily
const& rFamily
= *iter
;
502 XMLAutoStylePoolParent
aTmp(rParent
);
503 auto const it2
= rFamily
.m_ParentSet
.find(aTmp
);
504 if (it2
!= rFamily
.m_ParentSet
.end())
506 sName
= it2
->Find(rFamily
, rProperties
);
512 std::vector
<xmloff::AutoStyleEntry
> SvXMLAutoStylePoolP_Impl::GetAutoStyleEntries() const
514 std::vector
<xmloff::AutoStyleEntry
> rReturnVector
;
516 for (XMLAutoStyleFamily
const & rFamily
: m_FamilySet
)
518 rtl::Reference
<XMLPropertySetMapper
> aPropertyMapper
= rFamily
.mxMapper
->getPropertySetMapper();
519 for (XMLAutoStylePoolParent
const & rParent
: rFamily
.m_ParentSet
)
521 for (XMLAutoStylePoolProperties
const & rProperty
: rParent
.GetPropertiesList())
523 rReturnVector
.emplace_back();
524 xmloff::AutoStyleEntry
& rEntry
= rReturnVector
.back();
525 for (XMLPropertyState
const & rPropertyState
: rProperty
.GetProperties())
527 if (rPropertyState
.mnIndex
>= 0)
529 OUString sXmlName
= aPropertyMapper
->GetEntryXMLName(rPropertyState
.mnIndex
);
530 rEntry
.m_aXmlProperties
.emplace_back(sXmlName
, rPropertyState
.maValue
);
536 return rReturnVector
;
541 struct AutoStylePoolExport
543 const OUString
* mpParent
;
544 XMLAutoStylePoolProperties
* mpProperties
;
546 AutoStylePoolExport() : mpParent(nullptr), mpProperties(nullptr) {}
549 struct StyleComparator
551 bool operator() (const AutoStylePoolExport
& a
, const AutoStylePoolExport
& b
)
553 return (a
.mpProperties
->GetName() < b
.mpProperties
->GetName() ||
554 (a
.mpProperties
->GetName() == b
.mpProperties
->GetName() && *a
.mpParent
< *b
.mpParent
));
560 void SvXMLAutoStylePoolP_Impl::exportXML(
561 XmlStyleFamily nFamily
,
562 const SvXMLAutoStylePoolP
*pAntiImpl
) const
564 // Get list of parents for current family (nFamily)
565 XMLAutoStyleFamily
aTemp(nFamily
);
566 auto const iter
= m_FamilySet
.find(aTemp
);
567 assert(iter
!= m_FamilySet
.end()); // family must be known
569 const XMLAutoStyleFamily
&rFamily
= *iter
;
570 sal_uInt32 nCount
= rFamily
.mnCount
;
575 // create, initialize and fill helper-structure (SvXMLAutoStylePoolProperties_Impl)
576 // which contains a parent-name and a SvXMLAutoStylePoolProperties_Impl
577 std::vector
<AutoStylePoolExport
> aExpStyles(nCount
);
579 for (XMLAutoStylePoolParent
const& rParent
: rFamily
.m_ParentSet
)
581 size_t nProperties
= rParent
.GetPropertiesList().size();
582 for( size_t j
= 0; j
< nProperties
; j
++ )
584 const XMLAutoStylePoolProperties
& rProperties
=
585 rParent
.GetPropertiesList()[j
];
586 sal_uInt32 nPos
= rProperties
.GetPos();
587 assert(nPos
< nCount
);
588 assert(!aExpStyles
[nPos
].mpProperties
);
589 aExpStyles
[nPos
].mpProperties
= &const_cast<XMLAutoStylePoolProperties
&>(rProperties
);
590 aExpStyles
[nPos
].mpParent
= &rParent
.GetParent();
594 static bool bHack
= (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
599 std::sort(aExpStyles
.begin(), aExpStyles
.end(), StyleComparator());
601 for (size_t i
= 0; i
< nCount
; i
++)
603 OUString oldName
= aExpStyles
[i
].mpProperties
->GetName();
604 sal_Int32 dashIx
= oldName
.indexOf('-');
605 OUString newName
= (dashIx
> 0 ? oldName
.copy(0, dashIx
) : oldName
) + OUString::number(i
);
606 aExpStyles
[i
].mpProperties
->SetName(newName
);
611 // create string to export for each XML-style. That means for each property-list
613 OUString aStrFamilyName
= rFamily
.maStrFamilyName
;
615 for( size_t i
= 0; i
< nCount
; i
++ )
617 assert(aExpStyles
[i
].mpProperties
);
619 if( aExpStyles
[i
].mpProperties
)
621 GetExport().AddAttribute(
622 XML_NAMESPACE_STYLE
, XML_NAME
,
623 aExpStyles
[i
].mpProperties
->GetName() );
625 bool bExtensionNamespace
= false;
626 if( rFamily
.mbAsFamily
)
628 GetExport().AddAttribute(
629 XML_NAMESPACE_STYLE
, XML_FAMILY
, aStrFamilyName
);
630 if(aStrFamilyName
!= "graphic" &&
631 aStrFamilyName
!= "drawing-page" &&
632 aStrFamilyName
!= "presentation" &&
633 aStrFamilyName
!= "chart" )
634 bExtensionNamespace
= true;
637 if( !aExpStyles
[i
].mpParent
->isEmpty() )
639 GetExport().AddAttribute(
640 XML_NAMESPACE_STYLE
, XML_PARENT_STYLE_NAME
,
641 GetExport().EncodeStyleName(
642 *aExpStyles
[i
].mpParent
) );
646 if( rFamily
.mbAsFamily
)
647 sName
= GetXMLToken(XML_STYLE
);
649 sName
= rFamily
.maStrFamilyName
;
651 pAntiImpl
->exportStyleAttributes(GetExport().GetAttrList(), nFamily
,
652 aExpStyles
[i
].mpProperties
->GetProperties(),
653 *rFamily
.mxMapper
, GetExport().GetMM100UnitConverter(),
654 GetExport().GetNamespaceMap());
656 SvXMLElementExport
aElem( GetExport(),
657 XML_NAMESPACE_STYLE
, sName
,
660 sal_Int32
nStart(-1);
662 if (nFamily
== XmlStyleFamily::PAGE_MASTER
)
665 sal_Int32 nIndex
= 0;
666 rtl::Reference
< XMLPropertySetMapper
> aPropMapper
=
667 rFamily
.mxMapper
->getPropertySetMapper();
668 sal_Int16 nContextID
;
669 while(nIndex
< aPropMapper
->GetEntryCount() && nEnd
== -1)
671 nContextID
= aPropMapper
->GetEntryContextId( nIndex
);
672 if (nContextID
&& ((nContextID
& CTF_PM_FLAGMASK
) != XML_PM_CTF_START
))
680 rFamily
.mxMapper
->exportXML(
682 aExpStyles
[i
].mpProperties
->GetProperties(),
683 nStart
, nEnd
, SvXmlExportFlags::IGN_WS
, bExtensionNamespace
);
685 pAntiImpl
->exportStyleContent(GetExport().GetDocHandler(), nFamily
,
686 aExpStyles
[i
].mpProperties
->GetProperties(),
687 *rFamily
.mxMapper
, GetExport().GetMM100UnitConverter(),
688 GetExport().GetNamespaceMap());
693 void SvXMLAutoStylePoolP_Impl::ClearEntries()
695 for (auto & aI
: m_FamilySet
)
696 const_cast<XMLAutoStyleFamily
&>(aI
).ClearEntries();
699 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */