25#include <com/sun/star/frame/XModel.hpp>
26#include <com/sun/star/style/XStyle.hpp>
27#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
28#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
29#include <com/sun/star/container/XNamed.hpp>
30#include <com/sun/star/container/XIndexReplace.hpp>
31#include <rtl/ustrbuf.hxx>
58 const Reference < XIndexReplace > & rNumRules,
60 std::u16string_view rPrefix,
64 const Reference < XIndexReplace > & rNumRules ) :
69 Reference < XNamed > xNamed(
xNumRules, UNO_QUERY );
78 OUString aInternalName ) :
94 const Reference < XIndexReplace > & rNumRules,
96 std::u16string_view rPrefix,
98 xNumRules( rNumRules ),
102 Reference < XNamed > xNamed(
xNumRules, UNO_QUERY );
114 sName = rPrefix + OUString::number(
static_cast<sal_Int32
>(rName) );
116 while (rNames.find(
sName) != rNames.end());
121struct XMLTextListAutoStylePoolEntryCmp_Impl
124 std::unique_ptr<XMLTextListAutoStylePoolEntry_Impl>
const& r1,
125 std::unique_ptr<XMLTextListAutoStylePoolEntry_Impl>
const& r2 )
const
130 return r1->GetInternalName().compareTo( r2->GetInternalName() ) < 0;
139 return r1->GetNumRules().get() < r2->GetNumRules().get();
154 Reference<ucb::XAnyCompareFactory> xCompareFac( rExp.
GetModel(), uno::UNO_QUERY );
155 if( xCompareFac.is() )
162 Reference<XStyleFamiliesSupplier> xFamiliesSupp(
m_rExport.
GetModel(), UNO_QUERY);
163 SAL_WARN_IF(!xFamiliesSupp.is(),
"xmloff",
"getStyleFamilies() from XModel failed for export!");
164 Reference< XNameAccess > xFamilies;
165 if (xFamiliesSupp.is())
166 xFamilies = xFamiliesSupp->getStyleFamilies();
168 Reference<XIndexAccess> xStyles;
169 static constexpr OUStringLiteral aNumberStyleName(
u"NumberingStyles");
170 if (xFamilies.is() && xFamilies->hasByName(aNumberStyleName))
171 xFamilies->getByName(aNumberStyleName) >>= xStyles;
173 const sal_Int32 nStyles = xStyles.is() ? xStyles->getCount() : 0;
174 for (sal_Int32
i = 0;
i < nStyles;
i++)
176 Reference<XStyle> xStyle;
177 xStyles->getByIndex(
i) >>= xStyle;
202 aAny2 <<= (*m_pPool)[
nPos]->GetNumRules();
215 return sal_uInt32(-1);
219 const Reference < XIndexReplace > & rNumRules )
225 if(
nPos != sal_uInt32(-1) )
231 std::unique_ptr<XMLTextListAutoStylePoolEntry_Impl> pEntry(
235 sName = pEntry->GetName();
236 m_pPool->insert( std::move(pEntry) );
243 const Reference < XIndexReplace > & rNumRules )
const
249 if( nPos != sal_uInt32(-1) )
256 const OUString& rInternalName )
const
261 if(
nPos != sal_uInt32(-1) )
273 std::vector<XMLTextListAutoStylePoolEntry_Impl*> aExpEntries(
nCount);
280 aExpEntries[pEntry->
GetPos()] = pEntry;
std::set< OUString > XMLTextListAutoStylePoolNames_Impl
SvXMLExportFlags getExportFlags() const
const css::uno::Reference< css::frame::XModel > & GetModel() const
void exportNumberingRule(const OUString &rName, bool bIsHidden, const css::uno::Reference< css::container::XIndexReplace > &xNumRule)
XMLTextListAutoStylePoolEntry_Impl(const Reference< XIndexReplace > &rNumRules)
const Reference< XIndexReplace > & GetNumRules() const
sal_uInt32 GetPos() const
Reference< XIndexReplace > xNumRules
XMLTextListAutoStylePoolEntry_Impl(sal_uInt32 nPos, const Reference< XIndexReplace > &rNumRules, XMLTextListAutoStylePoolNames_Impl &rNames, std::u16string_view rPrefix, sal_uInt32 &rName)
const OUString & GetInternalName() const
const OUString & GetName() const
XMLTextListAutoStylePoolEntry_Impl(OUString aInternalName)
XMLTextListAutoStylePoolNames_Impl m_aNames
std::unique_ptr< XMLTextListAutoStylePool_Impl > m_pPool
SAL_DLLPRIVATE sal_uInt32 Find(const XMLTextListAutoStylePoolEntry_Impl *pEntry) const
void RegisterName(const OUString &rName)
css::uno::Reference< css::ucb::XAnyCompare > mxNumRuleCompare
this is an optional NumRule compare component for applications where the NumRules don't have names
~XMLTextListAutoStylePool()
XMLTextListAutoStylePool(SvXMLExport &rExport)
OUString Add(const css::uno::Reference< css::container::XIndexReplace > &rNumRules)
std::vector< Value >::const_iterator const_iterator
#define SAL_WARN_IF(condition, area, stream)