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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 5 14:39:23 UTC 2018


 sc/inc/global.hxx                |    2 +-
 sc/inc/progress.hxx              |    2 --
 sc/source/core/data/global.cxx   |    1 -
 sc/source/core/tool/progress.cxx |   35 +++++++++++++++--------------------
 4 files changed, 16 insertions(+), 24 deletions(-)

New commits:
commit c64046f61eb8a2d7d288e538377f1464a9ef34eb
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Dec 5 10:59:52 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 5 15:38:57 2018 +0100

    loplugin:singlevalfields in sc
    
    Change-Id: Ia18d05b80f90a2333faf41029e7ae66fbd52dc78
    Reviewed-on: https://gerrit.libreoffice.org/64599
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index e6a33de7830b..38406014c4a8 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -551,7 +551,7 @@ public:
     static ::utl::TransliterationWrapper* GetCaseTransliteration();
 
     SC_DLLPUBLIC static LanguageType            eLnge;
-    static sal_Unicode          cListDelimiter;
+    static constexpr sal_Unicode cListDelimiter = ',';
 
     static const OUString&      GetClipDocName();
     static void                 SetClipDocName( const OUString& rNew );
diff --git a/sc/inc/progress.hxx b/sc/inc/progress.hxx
index 7ad445a0913c..c8fb59646e58 100644
--- a/sc/inc/progress.hxx
+++ b/sc/inc/progress.hxx
@@ -44,9 +44,7 @@ private:
     static  sal_uLong        nGlobalRange;
     static  sal_uLong       nGlobalPercent;
     static  ScProgress*     pInterpretProgress;
-    static  ScProgress*     pOldInterpretProgress;
     static  sal_uLong       nInterpretProgress;
-    static  bool            bAllowInterpretProgress;
     static  ScDocument*     pInterpretDoc;
     static  bool            bIdleWasEnabled;
             bool            bEnabled;
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 2138f3e776b8..22b96ec9b45c 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -83,7 +83,6 @@ std::atomic<CollatorWrapper*> ScGlobal::pCaseCollator(nullptr);
 std::atomic<::utl::TransliterationWrapper*> ScGlobal::pTransliteration(nullptr);
 std::atomic<::utl::TransliterationWrapper*> ScGlobal::pCaseTransliteration(nullptr);
 css::uno::Reference< css::i18n::XOrdinalSuffix> ScGlobal::xOrdinalSuffix;
-sal_Unicode     ScGlobal::cListDelimiter = ',';
 OUString*       ScGlobal::pEmptyOUString = nullptr;
 OUString*       ScGlobal::pStrClipDocName = nullptr;
 
diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index 3ebcdb107138..628f779bd05c 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -40,9 +40,7 @@ SfxProgress*    ScProgress::pGlobalProgress = nullptr;
 sal_uLong       ScProgress::nGlobalRange = 0;
 sal_uLong       ScProgress::nGlobalPercent = 0;
 ScProgress*     ScProgress::pInterpretProgress = &theDummyInterpretProgress;
-ScProgress*     ScProgress::pOldInterpretProgress = nullptr;
 sal_uLong       ScProgress::nInterpretProgress = 0;
-bool            ScProgress::bAllowInterpretProgress = true;
 ScDocument*     ScProgress::pInterpretDoc;
 bool            ScProgress::bIdleWasEnabled = false;
 
@@ -134,30 +132,27 @@ ScProgress::~ScProgress()
 
 void ScProgress::CreateInterpretProgress( ScDocument* pDoc, bool bWait )
 {
-    if ( bAllowInterpretProgress )
+    if ( nInterpretProgress )
+        nInterpretProgress++;
+    else if ( pDoc->GetAutoCalc() )
     {
-        if ( nInterpretProgress )
-            nInterpretProgress++;
-        else if ( pDoc->GetAutoCalc() )
-        {
-            nInterpretProgress = 1;
-            bIdleWasEnabled = pDoc->IsIdleEnabled();
-            pDoc->EnableIdle(false);
-            // Interpreter may be called in many circumstances, also if another
-            // progress bar is active, for example while adapting row heights.
-            // Keep the dummy interpret progress.
-            if ( !pGlobalProgress )
-                pInterpretProgress = new ScProgress( pDoc->GetDocumentShell(),
-                    ScResId( STR_PROGRESS_CALCULATING ),
-                    pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, bWait );
-            pInterpretDoc = pDoc;
-        }
+        nInterpretProgress = 1;
+        bIdleWasEnabled = pDoc->IsIdleEnabled();
+        pDoc->EnableIdle(false);
+        // Interpreter may be called in many circumstances, also if another
+        // progress bar is active, for example while adapting row heights.
+        // Keep the dummy interpret progress.
+        if ( !pGlobalProgress )
+            pInterpretProgress = new ScProgress( pDoc->GetDocumentShell(),
+                ScResId( STR_PROGRESS_CALCULATING ),
+                pDoc->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE, bWait );
+        pInterpretDoc = pDoc;
     }
 }
 
 void ScProgress::DeleteInterpretProgress()
 {
-    if ( bAllowInterpretProgress && nInterpretProgress )
+    if ( nInterpretProgress )
     {
         /*  Do not decrement 'nInterpretProgress', before 'pInterpretProgress'
             is deleted. In rare cases, deletion of 'pInterpretProgress' causes


More information about the Libreoffice-commits mailing list