summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-19 09:13:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-19 12:56:29 +0200
commite4920a076f100489b229b8926064bb26a03dc55b (patch)
tree9d3a46aa8604273c6c437bf44434f4d8958f93e4 /xmloff
parentd48eb7255dad05c3baff5194dc3151683893d56c (diff)
convert XMLFontAutoStylePool_Impl to sorted_vector<unique_ptr<>>
Change-Id: Ic9fcefd3a2d64aa01349ae6eec81d3ae49c5e069 Reviewed-on: https://gerrit.libreoffice.org/60741 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx19
1 files changed, 7 insertions, 12 deletions
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index 95f0394e16f7..9a8454897e66 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -112,8 +112,8 @@ inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl(
struct XMLFontAutoStylePoolEntryCmp_Impl {
bool operator()(
- XMLFontAutoStylePoolEntry_Impl* const& r1,
- XMLFontAutoStylePoolEntry_Impl* const& r2 ) const
+ std::unique_ptr<XMLFontAutoStylePoolEntry_Impl> const& r1,
+ std::unique_ptr<XMLFontAutoStylePoolEntry_Impl> const& r2 ) const
{
bool bEnc1(r1->GetEncoding() != RTL_TEXTENCODING_SYMBOL);
bool bEnc2(r2->GetEncoding() != RTL_TEXTENCODING_SYMBOL);
@@ -134,13 +134,8 @@ struct XMLFontAutoStylePoolEntryCmp_Impl {
}
};
-class XMLFontAutoStylePool_Impl : public o3tl::sorted_vector<XMLFontAutoStylePoolEntry_Impl*, XMLFontAutoStylePoolEntryCmp_Impl>
+class XMLFontAutoStylePool_Impl : public o3tl::sorted_vector<std::unique_ptr<XMLFontAutoStylePoolEntry_Impl>, XMLFontAutoStylePoolEntryCmp_Impl>
{
-public:
- ~XMLFontAutoStylePool_Impl()
- {
- DeleteAndDestroyAll();
- }
};
XMLFontAutoStylePool::XMLFontAutoStylePool(SvXMLExport& rExp, bool bTryToEmbedFonts) :
@@ -201,10 +196,10 @@ OUString XMLFontAutoStylePool::Add(
}
}
- XMLFontAutoStylePoolEntry_Impl *pEntry =
+ std::unique_ptr<XMLFontAutoStylePoolEntry_Impl> pEntry(
new XMLFontAutoStylePoolEntry_Impl( sName, rFamilyName, rStyleName,
- nFamily, nPitch, eEnc );
- m_pFontAutoStylePool->insert( pEntry );
+ nFamily, nPitch, eEnc ));
+ m_pFontAutoStylePool->insert( std::move(pEntry) );
m_aNames.insert(sName);
}
@@ -403,7 +398,7 @@ void XMLFontAutoStylePool::exportXML()
for (sal_uInt32 i = 0; i < nCount; i++)
{
- const XMLFontAutoStylePoolEntry_Impl* pEntry = (*m_pFontAutoStylePool)[i];
+ const XMLFontAutoStylePoolEntry_Impl* pEntry = (*m_pFontAutoStylePool)[i].get();
GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, pEntry->GetName());