24 #include <com/sun/star/frame/XModel.hpp>
25 #include <com/sun/star/ucb/XAnyCompareFactory.hpp>
26 #include <com/sun/star/container/XNamed.hpp>
27 #include <com/sun/star/container/XIndexReplace.hpp>
28 #include <rtl/ustrbuf.hxx>
55 const Reference < XIndexReplace > & rNumRules,
57 const OUString& rPrefix,
61 const Reference < XIndexReplace > & rNumRules ) :
62 xNumRules( rNumRules ),
66 Reference < XNamed > xNamed( xNumRules, UNO_QUERY );
69 sInternalName = xNamed->getName();
75 const OUString& rInternalName ) :
76 sInternalName( rInternalName ),
91 const Reference < XIndexReplace > & rNumRules,
93 const OUString& rPrefix,
95 xNumRules( rNumRules ),
99 Reference < XNamed > xNamed(
xNumRules, UNO_QUERY );
108 OUStringBuffer sBuffer( 7 );
112 sBuffer.append( rPrefix );
113 sBuffer.append( static_cast<sal_Int32>(rName) );
114 sName = sBuffer.makeStringAndClear();
116 while (rNames.find(
sName) != rNames.end());
121 struct 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() )
184 aAny2 <<= (*pPool)[
nPos]->GetNumRules();
193 if( it !=
pPool->end() )
194 return it -
pPool->begin();
197 return sal_uInt32(-1);
201 const Reference < XIndexReplace > & rNumRules )
207 if( nPos != sal_uInt32(-1) )
209 sName = (*pPool)[ nPos ]->GetName();
213 std::unique_ptr<XMLTextListAutoStylePoolEntry_Impl> pEntry(
217 sName = pEntry->GetName();
218 pPool->insert( std::move(pEntry) );
225 const Reference < XIndexReplace > & rNumRules )
const
231 if( nPos != sal_uInt32(-1) )
232 sName = (*pPool)[ nPos ]->GetName();
238 const OUString& rInternalName )
const
242 sal_uInt32 nPos =
Find( &aTmp );
243 if( nPos != sal_uInt32(-1) )
244 sName = (*pPool)[ nPos ]->GetName();
255 std::vector<XMLTextListAutoStylePoolEntry_Impl*> aExpEntries(nCount);
258 for( i=0; i < nCount; i++ )
262 aExpEntries[pEntry->
GetPos()] = pEntry;
267 for( i=0; i < nCount; i++ )
const OUString & GetInternalName() const
~XMLTextListAutoStylePool()
css::uno::Reference< css::ucb::XAnyCompare > mxNumRuleCompare
this is an optional NumRule compare component for applications where the NumRules don't have names ...
XMLTextListAutoStylePool(SvXMLExport &rExport)
const css::uno::Reference< css::frame::XModel > & GetModel() const
std::set< OUString > XMLTextListAutoStylePoolNames_Impl
XMLTextListAutoStylePoolNames_Impl m_aNames
void RegisterName(const OUString &rName)
OUString Add(const css::uno::Reference< css::container::XIndexReplace > &rNumRules)
std::unique_ptr< XMLTextListAutoStylePool_Impl > pPool
#define SAL_WARN_IF(condition, area, stream)
XMLTextListAutoStylePoolEntry_Impl(sal_uInt32 nPos, const Reference< XIndexReplace > &rNumRules, XMLTextListAutoStylePoolNames_Impl &rNames, const OUString &rPrefix, sal_uInt32 &rName)
Reference< XIndexReplace > xNumRules
void exportNumberingRule(const OUString &rName, bool bIsHidden, const css::uno::Reference< css::container::XIndexReplace > &xNumRule)
const OUString & GetName() const
XMLTextListAutoStylePoolEntry_Impl(const OUString &rInternalName)
XMLTextListAutoStylePoolEntry_Impl(const Reference< XIndexReplace > &rNumRules)
const Reference< XIndexReplace > & GetNumRules() const
css::uno::Any const SvXMLExport & rExport
SvXMLExportFlags getExportFlags() const
SAL_DLLPRIVATE sal_uInt32 Find(const XMLTextListAutoStylePoolEntry_Impl *pEntry) const
std::vector< std::unique_ptr< XMLTextListAutoStylePoolEntry_Impl > >::const_iterator const_iterator
sal_uInt32 GetPos() const