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 .
22 #include <rtl/ustrbuf.hxx>
23 #include <sal/log.hxx>
24 #include <PageMasterStyleMap.hxx>
26 #include <xmloff/families.hxx>
27 #include <xmloff/xmlaustp.hxx>
28 #include <xmloff/xmlexp.hxx>
29 #include <xmloff/xmlexppr.hxx>
30 #include <xmloff/xmlnamespace.hxx>
31 #include <xmloff/xmlprmap.hxx>
32 #include <xmloff/xmltoken.hxx>
34 #include "impastpl.hxx"
36 using namespace ::com::sun::star
;
37 using namespace ::xmloff::token
;
39 // Class XMLAutoStyleFamily
40 // ctor/dtor class XMLAutoStyleFamily
42 XMLAutoStyleFamily::XMLAutoStyleFamily(
43 XmlStyleFamily nFamily
,
45 rtl::Reference
< SvXMLExportPropertyMapper
> xMapper
,
48 mnFamily( nFamily
), maStrFamilyName(std::move( aStrName
)), mxMapper(std::move( xMapper
)),
49 mnCount( 0 ), mnName( 0 ), maStrPrefix(std::move( aStrPrefix
)), mbAsFamily( bAsFamily
)
52 XMLAutoStyleFamily::XMLAutoStyleFamily( XmlStyleFamily nFamily
) :
53 mnFamily(nFamily
), mnCount(0), mnName(0), mbAsFamily(false) {}
55 void XMLAutoStyleFamily::ClearEntries()
61 data2string(void *data
,
62 const typelib_TypeDescriptionReference
*type
);
65 struct2string(void *data
,
66 const typelib_TypeDescription
*type
)
68 assert(type
->eTypeClass
== typelib_TypeClass_STRUCT
);
70 OUStringBuffer
result("{");
72 const typelib_CompoundTypeDescription
*compoundType
=
73 &reinterpret_cast<const typelib_StructTypeDescription
*>(type
)->aBase
;
75 for (int i
= 0; i
< compoundType
->nMembers
; i
++)
80 OUString::unacquired(&compoundType
->ppMemberNames
[i
])
82 + data2string(static_cast<char *>(data
)+compoundType
->pMemberOffsets
[i
],
83 compoundType
->ppTypeRefs
[i
]));
88 return result
.makeStringAndClear();
92 data2string(void *data
,
93 const typelib_TypeDescriptionReference
*type
)
95 switch (type
->eTypeClass
)
97 case typelib_TypeClass_VOID
:
99 case typelib_TypeClass_BOOLEAN
:
100 return *static_cast<const sal_Bool
*>(data
) ? u
"true"_ustr
: u
"false"_ustr
;
101 case typelib_TypeClass_BYTE
:
102 return OUString::number(*static_cast<const sal_Int8
*>(data
));
103 case typelib_TypeClass_SHORT
:
104 return OUString::number(*static_cast<const sal_Int16
*>(data
));
105 case typelib_TypeClass_LONG
:
106 return OUString::number(*static_cast<const sal_Int32
*>(data
));
107 case typelib_TypeClass_HYPER
:
108 return OUString::number(*static_cast<const sal_Int64
*>(data
));
109 case typelib_TypeClass_UNSIGNED_SHORT
:
110 return OUString::number(*static_cast<const sal_uInt16
*>(data
));
111 case typelib_TypeClass_UNSIGNED_LONG
:
112 return OUString::number((*static_cast<const sal_uInt32
*>(data
)), 16);
113 case typelib_TypeClass_UNSIGNED_HYPER
:
114 return OUString::number((*static_cast<const sal_uInt64
*>(data
)), 16);
115 case typelib_TypeClass_FLOAT
:
116 return OUString::number(*static_cast<const float*>(data
));
117 case typelib_TypeClass_DOUBLE
:
118 return OUString::number(*static_cast<const double*>(data
));
119 case typelib_TypeClass_CHAR
:
120 return ("U+" + OUString::number(*static_cast<const sal_uInt16
*>(data
)));
121 case typelib_TypeClass_STRING
:
122 return *static_cast<OUString
*>(data
);
123 case typelib_TypeClass_TYPE
:
124 case typelib_TypeClass_SEQUENCE
:
125 case typelib_TypeClass_EXCEPTION
:
126 case typelib_TypeClass_INTERFACE
:
128 case typelib_TypeClass_STRUCT
:
129 return struct2string(data
, type
->pType
);
130 case typelib_TypeClass_ENUM
:
131 return OUString::number(*static_cast<const sal_Int32
*>(data
));
133 assert(false); // this cannot happen I hope
139 static OUString
any2string(const uno::Any
& any
)
141 return data2string(const_cast<void*>(any
.getValue()), any
.pType
);
144 // Class SvXMLAutoStylePoolProperties_Impl
145 // ctor class SvXMLAutoStylePoolProperties_Impl
147 XMLAutoStylePoolProperties::XMLAutoStylePoolProperties( XMLAutoStyleFamily
& rFamilyData
, std::vector
< XMLPropertyState
>&& rProperties
, OUString
const & rParentName
)
148 : maProperties( std::move(rProperties
) ),
149 mnPos ( rFamilyData
.mnCount
)
151 static bool bHack
= (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
155 OUStringBuffer
aStemBuffer(32);
156 aStemBuffer
.append( rFamilyData
.maStrPrefix
);
158 if (!rParentName
.isEmpty())
160 aStemBuffer
.append("-" + rParentName
);
163 // Create a name based on the properties used
164 for(XMLPropertyState
const & rState
: maProperties
)
166 if (rState
.mnIndex
== -1)
168 OUString
sXMLName(rFamilyData
.mxMapper
->getPropertySetMapper()->GetEntryXMLName(rState
.mnIndex
));
169 if (sXMLName
.isEmpty())
173 + OUString::number(static_cast<sal_Int32
>(rFamilyData
.mxMapper
->getPropertySetMapper()->GetEntryNameSpace(rState
.mnIndex
)))
177 + any2string(rState
.maValue
));
181 // Finally append an incremental counter in an attempt to make identical
182 // styles always come out in the same order. Will see if this works.
183 aStemBuffer
.append("-z");
184 static sal_Int32 nCounter
= 0;
185 aStemBuffer
.append(nCounter
++));
188 // create a name that hasn't been used before. The created name has not
189 // to be added to the array, because it will never tried again
191 msName
= aStemBuffer
;
192 bool bWarned
= false;
193 while (rFamilyData
.maNameSet
.find(msName
) !=
194 rFamilyData
.maNameSet
.end())
197 SAL_WARN("xmloff", "Overlapping style name for " << msName
);
199 rFamilyData
.mnName
++;
200 msName
= aStemBuffer
+ "-" + OUString::number( static_cast<sal_Int64
>(rFamilyData
.mnName
) );
202 rFamilyData
.maNameSet
.insert(msName
);
206 // create a name that hasn't been used before. The created name has not
207 // to be added to the array, because it will never tried again
210 rFamilyData
.mnName
++;
211 msName
= rFamilyData
.maStrPrefix
+ OUString::number( static_cast<sal_Int64
>(rFamilyData
.mnName
) );
213 while (rFamilyData
.maNameSet
.find(msName
) != rFamilyData
.maNameSet
.end() || rFamilyData
.maReservedNameSet
.find(msName
) != rFamilyData
.maReservedNameSet
.end());
216 #if OSL_DEBUG_LEVEL > 0
217 std::set
<sal_Int32
> DebugProperties
;
218 for (XMLPropertyState
const & rPropState
: maProperties
)
220 sal_Int32
const property(rPropState
.mnIndex
);
221 // serious bug: will cause duplicate attributes to be exported
222 assert(DebugProperties
.find(property
) == DebugProperties
.end());
225 DebugProperties
.insert(property
);
231 bool operator<( const XMLAutoStyleFamily
& r1
, const XMLAutoStyleFamily
& r2
)
233 return r1
.mnFamily
< r2
.mnFamily
;
237 XMLAutoStylePoolParent::~XMLAutoStylePoolParent()
243 struct ComparePartial
245 const XMLAutoStyleFamily
& rFamilyData
;
247 bool operator()(const std::vector
< XMLPropertyState
>& lhs
,
248 const XMLAutoStylePoolProperties
& rhs
) const
250 return rFamilyData
.mxMapper
->LessPartial(lhs
, rhs
.GetProperties());
252 bool operator()(const XMLAutoStylePoolProperties
& lhs
,
253 const std::vector
< XMLPropertyState
>& rhs
) const
255 return rFamilyData
.mxMapper
->LessPartial(lhs
.GetProperties(), rhs
);
261 // Adds an array of XMLPropertyState ( std::vector< XMLPropertyState > ) to list
262 // if not added, yet.
264 bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily
& rFamilyData
, std::vector
< XMLPropertyState
>&& rProperties
, OUString
& rName
, bool bDontSeek
)
266 PropertiesListType::iterator pProperties
= m_PropertiesList
.end();;
267 auto [itBegin
, itEnd
] = std::equal_range(m_PropertiesList
.begin(), m_PropertiesList
.end(), rProperties
, ComparePartial
{rFamilyData
});
269 for (auto it
= itBegin
; it
!= itEnd
; ++it
)
270 if (rFamilyData
.mxMapper
->Equals(it
->GetProperties(), rProperties
))
274 if( bDontSeek
|| pProperties
== m_PropertiesList
.end() )
276 pProperties
= m_PropertiesList
.emplace(itBegin
, rFamilyData
, std::move(rProperties
), msParent
);
280 rName
= pProperties
->GetName();
286 // Adds an array of XMLPropertyState ( std::vector< XMLPropertyState > ) with a given name.
287 // If the name exists already, nothing is done. If a style with a different name and
288 // the same properties exists, a new one is added (like with bDontSeek).
291 bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily
& rFamilyData
, std::vector
< XMLPropertyState
>&& rProperties
, const OUString
& rName
)
293 if (rFamilyData
.maNameSet
.find(rName
) != rFamilyData
.maNameSet
.end())
296 auto it
= std::lower_bound(m_PropertiesList
.begin(), m_PropertiesList
.end(), rProperties
, ComparePartial
{rFamilyData
});
298 it
= m_PropertiesList
.emplace(it
, rFamilyData
, std::move(rProperties
), msParent
);
299 // ignore the generated name
300 it
->SetName( rName
);
305 // Search for an array of XMLPropertyState ( std::vector< XMLPropertyState > ) in list
308 OUString
XMLAutoStylePoolParent::Find( const XMLAutoStyleFamily
& rFamilyData
, const std::vector
< XMLPropertyState
>& rProperties
) const
311 auto [itBegin
,itEnd
] = std::equal_range(m_PropertiesList
.begin(), m_PropertiesList
.end(), rProperties
, ComparePartial
{rFamilyData
});
312 for (auto it
= itBegin
; it
!= itEnd
; ++it
)
313 if (rFamilyData
.mxMapper
->Equals(it
->GetProperties(), rProperties
))
314 sName
= it
->GetName();
319 bool XMLAutoStylePoolParent::operator< (const XMLAutoStylePoolParent
& rOther
) const
321 return msParent
< rOther
.msParent
;
324 // Class SvXMLAutoStylePool_Impl
325 // ctor/dtor class SvXMLAutoStylePool_Impl
327 SvXMLAutoStylePoolP_Impl::SvXMLAutoStylePoolP_Impl( SvXMLExport
& rExp
)
332 SvXMLAutoStylePoolP_Impl::~SvXMLAutoStylePoolP_Impl()
336 // Adds stylefamily-information to sorted list
338 void SvXMLAutoStylePoolP_Impl::AddFamily(
339 XmlStyleFamily nFamily
,
340 const OUString
& rStrName
,
341 const rtl::Reference
< SvXMLExportPropertyMapper
> & rMapper
,
342 const OUString
& rStrPrefix
,
345 // store family in a list if not already stored
346 SvXMLExportFlags nExportFlags
= GetExport().getExportFlags();
347 bool bStylesOnly
= (nExportFlags
& SvXMLExportFlags::STYLES
) && !(nExportFlags
& SvXMLExportFlags::CONTENT
);
349 OUString
aPrefix( rStrPrefix
);
352 aPrefix
= "M" + rStrPrefix
;
355 #if OSL_DEBUG_LEVEL > 0
356 XMLAutoStyleFamily
aTemp(nFamily
);
357 auto const iter
= m_FamilySet
.find(aTemp
);
358 if (iter
!= m_FamilySet
.end())
360 // FIXME: do we really intend to replace the previous nFamily
361 // entry in this case ?
362 SAL_WARN_IF( iter
->mxMapper
!= rMapper
, "xmloff",
363 "Adding duplicate family " << rStrName
<<
364 " with mismatching mapper ! " <<
365 typeid(iter
->mxMapper
.get()).name() << " " <<
366 typeid(*rMapper
).name() );
370 m_FamilySet
.emplace(nFamily
, rStrName
, rMapper
, aPrefix
, bAsFamily
);
373 void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper(
374 XmlStyleFamily nFamily
,
375 const rtl::Reference
< SvXMLExportPropertyMapper
> & rMapper
)
377 XMLAutoStyleFamily
aTemp(nFamily
);
378 auto const iter
= m_FamilySet
.find(aTemp
);
379 if (iter
!= m_FamilySet
.end())
380 const_cast<XMLAutoStyleFamily
&>(*iter
).mxMapper
= rMapper
;
383 // Adds a name to list
384 void SvXMLAutoStylePoolP_Impl::RegisterName( XmlStyleFamily nFamily
, const OUString
& rName
)
386 XMLAutoStyleFamily
aTemp(nFamily
);
387 auto const iter
= m_FamilySet
.find(aTemp
);
388 assert(iter
!= m_FamilySet
.end()); // family must be known
389 const_cast<XMLAutoStyleFamily
&>(*iter
).maNameSet
.insert(rName
);
392 // Adds a name to list
393 void SvXMLAutoStylePoolP_Impl::RegisterDefinedName( XmlStyleFamily nFamily
, const OUString
& rName
)
395 XMLAutoStyleFamily
aTemp(nFamily
);
396 auto const iter
= m_FamilySet
.find(aTemp
);
397 assert(iter
!= m_FamilySet
.end()); // family must be known
398 const_cast<XMLAutoStyleFamily
&>(*iter
).maReservedNameSet
.insert(rName
);
402 // Retrieve the list of registered names
405 void SvXMLAutoStylePoolP_Impl::GetRegisteredNames(
406 uno::Sequence
<sal_Int32
>& rFamilies
,
407 uno::Sequence
<OUString
>& rNames
)
409 // collect registered names + families
410 std::vector
<sal_Int32
> aFamilies
;
411 std::vector
<OUString
> aNames
;
413 // iterate over families
414 for (XMLAutoStyleFamily
const & rFamily
: m_FamilySet
)
416 // iterate over names
417 for (const auto& rName
: rFamily
.maNameSet
)
419 aFamilies
.push_back( static_cast<sal_Int32
>(rFamily
.mnFamily
) );
420 aNames
.push_back( rName
);
424 // copy the families + names into the sequence types
425 assert(aFamilies
.size() == aNames
.size());
427 rFamilies
.realloc( aFamilies
.size() );
428 std::copy( aFamilies
.begin(), aFamilies
.end(), rFamilies
.getArray() );
430 rNames
.realloc( aNames
.size() );
431 std::copy( aNames
.begin(), aNames
.end(), rNames
.getArray() );
434 // Adds an array of XMLPropertyState ( vector< XMLPropertyState > ) to list
435 // if not added, yet.
437 bool SvXMLAutoStylePoolP_Impl::Add(
438 OUString
& rName
, XmlStyleFamily nFamily
, const OUString
& rParentName
,
439 ::std::vector
< XMLPropertyState
>&& rProperties
, bool bDontSeek
)
441 XMLAutoStyleFamily
aTemp(nFamily
);
442 auto const iter
= m_FamilySet
.find(aTemp
);
443 assert(iter
!= m_FamilySet
.end()); // family must be known
445 XMLAutoStyleFamily
&rFamily
= const_cast<XMLAutoStyleFamily
&>(*iter
);
447 auto itPair
= rFamily
.m_ParentSet
.emplace(rParentName
);
448 XMLAutoStylePoolParent
& rParent
= const_cast<XMLAutoStylePoolParent
&>(*itPair
.first
);
451 if (rParent
.Add(rFamily
, std::move(rProperties
), rName
, bDontSeek
))
460 bool SvXMLAutoStylePoolP_Impl::AddNamed(
461 const OUString
& rName
, XmlStyleFamily nFamily
, const OUString
& rParentName
,
462 std::vector
< XMLPropertyState
>&& rProperties
)
464 // get family and parent the same way as in Add()
466 XMLAutoStyleFamily
aTemp(nFamily
);
467 auto const iter
= m_FamilySet
.find(aTemp
);
468 assert(iter
!= m_FamilySet
.end()); // family must be known
470 XMLAutoStyleFamily
&rFamily
= const_cast<XMLAutoStyleFamily
&>(*iter
);
472 auto itPair
= rFamily
.m_ParentSet
.emplace(rParentName
);
473 XMLAutoStylePoolParent
& rParent
= const_cast<XMLAutoStylePoolParent
&>(*itPair
.first
);
476 if (rParent
.AddNamed(rFamily
, std::move(rProperties
), rName
))
486 // Search for an array of XMLPropertyState ( std::vector< XMLPropertyState > ) in list
489 OUString
SvXMLAutoStylePoolP_Impl::Find( XmlStyleFamily nFamily
,
490 const OUString
& rParent
,
491 const std::vector
< XMLPropertyState
>& rProperties
) const
495 XMLAutoStyleFamily
aTemp(nFamily
);
496 auto const iter
= m_FamilySet
.find(aTemp
);
497 assert(iter
!= m_FamilySet
.end()); // family must be known
499 XMLAutoStyleFamily
const& rFamily
= *iter
;
500 XMLAutoStylePoolParent
aTmp(rParent
);
501 auto const it2
= rFamily
.m_ParentSet
.find(aTmp
);
502 if (it2
!= rFamily
.m_ParentSet
.end())
504 sName
= it2
->Find(rFamily
, rProperties
);
510 std::vector
<xmloff::AutoStyleEntry
> SvXMLAutoStylePoolP_Impl::GetAutoStyleEntries() const
512 std::vector
<xmloff::AutoStyleEntry
> rReturnVector
;
514 for (XMLAutoStyleFamily
const & rFamily
: m_FamilySet
)
516 rtl::Reference
<XMLPropertySetMapper
> aPropertyMapper
= rFamily
.mxMapper
->getPropertySetMapper();
517 for (XMLAutoStylePoolParent
const & rParent
: rFamily
.m_ParentSet
)
519 for (XMLAutoStylePoolProperties
const & rProperty
: rParent
.GetPropertiesList())
521 rReturnVector
.emplace_back();
522 xmloff::AutoStyleEntry
& rEntry
= rReturnVector
.back();
523 for (XMLPropertyState
const & rPropertyState
: rProperty
.GetProperties())
525 if (rPropertyState
.mnIndex
>= 0)
527 OUString sXmlName
= aPropertyMapper
->GetEntryXMLName(rPropertyState
.mnIndex
);
528 rEntry
.m_aXmlProperties
.emplace_back(sXmlName
, rPropertyState
.maValue
);
534 return rReturnVector
;
539 struct AutoStylePoolExport
541 const OUString
* mpParent
;
542 XMLAutoStylePoolProperties
* mpProperties
;
544 AutoStylePoolExport() : mpParent(nullptr), mpProperties(nullptr) {}
547 struct StyleComparator
549 bool operator() (const AutoStylePoolExport
& a
, const AutoStylePoolExport
& b
)
551 return (a
.mpProperties
->GetName() < b
.mpProperties
->GetName() ||
552 (a
.mpProperties
->GetName() == b
.mpProperties
->GetName() && *a
.mpParent
< *b
.mpParent
));
558 void SvXMLAutoStylePoolP_Impl::exportXML(
559 XmlStyleFamily nFamily
,
560 const SvXMLAutoStylePoolP
*pAntiImpl
) const
562 // Get list of parents for current family (nFamily)
563 XMLAutoStyleFamily
aTemp(nFamily
);
564 auto const iter
= m_FamilySet
.find(aTemp
);
565 assert(iter
!= m_FamilySet
.end()); // family must be known
567 const XMLAutoStyleFamily
&rFamily
= *iter
;
568 sal_uInt32 nCount
= rFamily
.mnCount
;
573 // create, initialize and fill helper-structure (SvXMLAutoStylePoolProperties_Impl)
574 // which contains a parent-name and a SvXMLAutoStylePoolProperties_Impl
575 std::vector
<AutoStylePoolExport
> aExpStyles(nCount
);
577 for (XMLAutoStylePoolParent
const& rParent
: rFamily
.m_ParentSet
)
579 size_t nProperties
= rParent
.GetPropertiesList().size();
580 for( size_t j
= 0; j
< nProperties
; j
++ )
582 const XMLAutoStylePoolProperties
& rProperties
=
583 rParent
.GetPropertiesList()[j
];
584 sal_uInt32 nPos
= rProperties
.GetPos();
585 assert(nPos
< nCount
);
586 assert(!aExpStyles
[nPos
].mpProperties
);
587 aExpStyles
[nPos
].mpProperties
= &const_cast<XMLAutoStylePoolProperties
&>(rProperties
);
588 aExpStyles
[nPos
].mpParent
= &rParent
.GetParent();
592 static bool bHack
= (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
597 std::sort(aExpStyles
.begin(), aExpStyles
.end(), StyleComparator());
599 for (size_t i
= 0; i
< nCount
; i
++)
601 OUString oldName
= aExpStyles
[i
].mpProperties
->GetName();
602 sal_Int32 dashIx
= oldName
.indexOf('-');
603 OUString newName
= (dashIx
> 0 ? oldName
.copy(0, dashIx
) : oldName
) + OUString::number(i
);
604 aExpStyles
[i
].mpProperties
->SetName(newName
);
609 // create string to export for each XML-style. That means for each property-list
611 OUString aStrFamilyName
= rFamily
.maStrFamilyName
;
613 for( size_t i
= 0; i
< nCount
; i
++ )
615 assert(aExpStyles
[i
].mpProperties
);
617 if( aExpStyles
[i
].mpProperties
)
619 GetExport().AddAttribute(
620 XML_NAMESPACE_STYLE
, XML_NAME
,
621 aExpStyles
[i
].mpProperties
->GetName() );
623 bool bExtensionNamespace
= false;
624 if( rFamily
.mbAsFamily
)
626 GetExport().AddAttribute(
627 XML_NAMESPACE_STYLE
, XML_FAMILY
, aStrFamilyName
);
628 if(aStrFamilyName
!= "graphic" &&
629 aStrFamilyName
!= "drawing-page" &&
630 aStrFamilyName
!= "presentation" &&
631 aStrFamilyName
!= "chart" )
632 bExtensionNamespace
= true;
635 if( !aExpStyles
[i
].mpParent
->isEmpty() )
637 GetExport().AddAttribute(
638 XML_NAMESPACE_STYLE
, XML_PARENT_STYLE_NAME
,
639 GetExport().EncodeStyleName(
640 *aExpStyles
[i
].mpParent
) );
644 if( rFamily
.mbAsFamily
)
645 sName
= GetXMLToken(XML_STYLE
);
647 sName
= rFamily
.maStrFamilyName
;
649 pAntiImpl
->exportStyleAttributes(GetExport().GetAttrList(), nFamily
,
650 aExpStyles
[i
].mpProperties
->GetProperties(),
651 *rFamily
.mxMapper
, GetExport().GetMM100UnitConverter(),
652 GetExport().GetNamespaceMap());
654 SvXMLElementExport
aElem( GetExport(),
655 XML_NAMESPACE_STYLE
, sName
,
658 sal_Int32
nStart(-1);
660 if (nFamily
== XmlStyleFamily::PAGE_MASTER
)
663 sal_Int32 nIndex
= 0;
664 rtl::Reference
< XMLPropertySetMapper
> aPropMapper
=
665 rFamily
.mxMapper
->getPropertySetMapper();
666 sal_Int16 nContextID
;
667 while(nIndex
< aPropMapper
->GetEntryCount() && nEnd
== -1)
669 nContextID
= aPropMapper
->GetEntryContextId( nIndex
);
670 if (nContextID
&& ((nContextID
& CTF_PM_FLAGMASK
) != XML_PM_CTF_START
))
678 rFamily
.mxMapper
->exportXML(
680 aExpStyles
[i
].mpProperties
->GetProperties(),
681 nStart
, nEnd
, SvXmlExportFlags::IGN_WS
, bExtensionNamespace
);
683 pAntiImpl
->exportStyleContent(GetExport().GetDocHandler(), nFamily
,
684 aExpStyles
[i
].mpProperties
->GetProperties(),
685 *rFamily
.mxMapper
, GetExport().GetMM100UnitConverter(),
686 GetExport().GetNamespaceMap());
691 void SvXMLAutoStylePoolP_Impl::ClearEntries()
693 for (auto & aI
: m_FamilySet
)
694 const_cast<XMLAutoStyleFamily
&>(aI
).ClearEntries();
697 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */