summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-16 08:41:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-17 11:20:19 +0200
commit1aff15fa737f88129b1854d09c01a600d92c8ce0 (patch)
tree1b6b177124eb813f138ecca6000b1c9ef2fcdf40 /xmloff
parentd683ec33d478606fa8afc2d44d8f1282562e8dfa (diff)
loplugin:useuniqueptr in SvXMLExportPropertyMapper::Impl
Change-Id: I10729d720338ad3fc0d9507491b6255dd53a3173 Reviewed-on: https://gerrit.libreoffice.org/57512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlexppr.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index bfa368bc4e72..dc6f9171a137 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -487,19 +487,13 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
struct SvXMLExportPropertyMapper::Impl
{
- typedef std::map<css::uno::Reference<css::beans::XPropertySetInfo>, FilterPropertiesInfo_Impl*> CacheType;
+ typedef std::map<css::uno::Reference<css::beans::XPropertySetInfo>, std::unique_ptr<FilterPropertiesInfo_Impl>> CacheType;
CacheType maCache;
rtl::Reference<SvXMLExportPropertyMapper> mxNextMapper;
rtl::Reference<XMLPropertySetMapper> mxPropMapper;
OUString maStyleName;
-
- ~Impl()
- {
- for (auto const& itemCache : maCache)
- delete itemCache.second;
- }
};
// ctor/dtor , class SvXMLExportPropertyMapper
@@ -573,7 +567,7 @@ vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter_(
Impl::CacheType::iterator aIter = mpImpl->maCache.find(xInfo);
if (aIter != mpImpl->maCache.end())
- pFilterInfo = (*aIter).second;
+ pFilterInfo = (*aIter).second.get();
bool bDelInfo = false;
if( !pFilterInfo )
@@ -608,7 +602,7 @@ vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter_(
xInfo = xWeakInfo;
if( xInfo.is() )
{
- mpImpl->maCache.emplace(xInfo, pFilterInfo);
+ mpImpl->maCache.emplace(xInfo, std::unique_ptr<FilterPropertiesInfo_Impl>(pFilterInfo));
}
else
bDelInfo = true;