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

Caolán McNamara caolanm at redhat.com
Wed Feb 15 10:20:03 UTC 2017


 sc/source/core/data/global.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit ccd6ed5e3b3978822c00020fbc6baeb4af6628a5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 15 10:19:17 2017 +0000

    no need to check pRscString on every iteration
    
    Change-Id: Icfcf2ca8efbaeaaa8fdddaa57496622a113027f7

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 4e58714..7ff840b 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -599,10 +599,13 @@ void ScGlobal::Clear()
     DELETEZ(pAddInCollection);
     DELETEZ(pUserList);
 
-    for( sal_uInt16 nC = 0 ; nC < SC_GLOBSTR_STR_COUNT ; nC++ )
-        if( ppRscString ) delete ppRscString[ nC ];
-    delete[] ppRscString;
-    ppRscString = nullptr;
+    if (ppRscString)
+    {
+        for (sal_uInt16 nC = 0; nC < SC_GLOBSTR_STR_COUNT; ++nC)
+            delete ppRscString[nC];
+        delete[] ppRscString;
+        ppRscString = nullptr;
+    }
 
     DELETEZ(pStarCalcFunctionList); // Destroy before ResMgr!
     DELETEZ(pStarCalcFunctionMgr);


More information about the Libreoffice-commits mailing list