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

Noel Grandin noel.grandin at collabora.co.uk
Thu Jul 12 06:30:06 UTC 2018


 sc/source/filter/inc/extlstcontext.hxx |    2 +-
 sc/source/filter/oox/extlstcontext.cxx |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 816bfa206b0347ad375a804a2ffe8481f6a573d6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jul 11 12:35:43 2018 +0200

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

diff --git a/sc/source/filter/inc/extlstcontext.hxx b/sc/source/filter/inc/extlstcontext.hxx
index fc2e6af035a0..f30fad890199 100644
--- a/sc/source/filter/inc/extlstcontext.hxx
+++ b/sc/source/filter/inc/extlstcontext.hxx
@@ -52,7 +52,7 @@ public:
 private:
     OUString aChars;
     std::vector<std::unique_ptr<ScFormatEntry> > maEntries;
-    IconSetRule* mpCurrentRule;
+    std::unique_ptr<IconSetRule> mpCurrentRule;
 };
 
 /**
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx
index 52fc82a73650..05a036d6faaf 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -91,8 +91,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
         SCTAB nTab = getSheetIndex();
         ScAddress aPos(0, 0, nTab);
         mpCurrentRule->SetData(&rIconSet, pDoc, aPos);
-        delete mpCurrentRule;
-        mpCurrentRule = nullptr;
+        mpCurrentRule.reset();
     }
     if (nElement == XLS14_TOKEN(cfRule))
     {
@@ -115,9 +114,9 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
         else if (aType == "iconSet")
         {
             ScDocument* pDoc = &getScDocument();
-            mpCurrentRule = new IconSetRule(*this);
+            mpCurrentRule.reset(new IconSetRule(*this));
             maEntries.push_back(o3tl::make_unique<ScIconSetFormat>(pDoc));
-            return new IconSetContext(*this, mpCurrentRule);
+            return new IconSetContext(*this, mpCurrentRule.get());
         }
         else
         {


More information about the Libreoffice-commits mailing list