[Libreoffice-commits] core.git: xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 17 09:20:42 UTC 2018


 xmloff/source/style/xmlexppr.cxx |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 1aff15fa737f88129b1854d09c01a600d92c8ce0
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 16 08:41:41 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 17 11:20:19 2018 +0200

    loplugin:useuniqueptr in SvXMLExportPropertyMapper::Impl
    
    Change-Id: I10729d720338ad3fc0d9507491b6255dd53a3173
    Reviewed-on: https://gerrit.libreoffice.org/57512
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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;


More information about the Libreoffice-commits mailing list