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

Noel Grandin noel.grandin at collabora.co.uk
Wed Jul 4 06:36:48 UTC 2018


 sc/source/ui/inc/output.hxx  |    6 +++---
 sc/source/ui/view/output.cxx |    9 +++------
 2 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 13eb18a3874fe2bfdba4b93e8035494fd83563bf
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jul 3 10:38:46 2018 +0200

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

diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index dfe973897760..162e1918f759 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -184,9 +184,9 @@ private:
     bool mbForceAutoColor;
 
     bool mbSyntaxMode;          // Syntax highlighting
-    Color* pValueColor;
-    Color* pTextColor;
-    Color* pFormulaColor;
+    std::unique_ptr<Color> pValueColor;
+    std::unique_ptr<Color> pTextColor;
+    std::unique_ptr<Color> pFormulaColor;
 
     Color   aGridColor;
 
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 842f42212778..e6549bdd3427 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -220,9 +220,6 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
 
 ScOutputData::~ScOutputData()
 {
-    delete pValueColor;
-    delete pTextColor;
-    delete pFormulaColor;
 }
 
 void ScOutputData::SetSpellCheckContext( const sc::SpellCheckContext* pCxt )
@@ -295,9 +292,9 @@ void ScOutputData::SetSyntaxMode( bool bNewMode )
         if ( !pValueColor )
         {
             const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
-            pValueColor = new Color( rColorCfg.GetColorValue( svtools::CALCVALUE ).nColor );
-            pTextColor = new Color( rColorCfg.GetColorValue( svtools::CALCTEXT ).nColor );
-            pFormulaColor = new Color( rColorCfg.GetColorValue( svtools::CALCFORMULA ).nColor );
+            pValueColor.reset( new Color( rColorCfg.GetColorValue( svtools::CALCVALUE ).nColor ) );
+            pTextColor.reset( new Color( rColorCfg.GetColorValue( svtools::CALCTEXT ).nColor ) );
+            pFormulaColor.reset( new Color( rColorCfg.GetColorValue( svtools::CALCFORMULA ).nColor ) );
         }
 }
 


More information about the Libreoffice-commits mailing list