[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sun May 22 03:33:32 UTC 2016


 sc/source/core/data/fillinfo.cxx |   23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

New commits:
commit 16c3defa8ff6330e4c21ba42177d92665a67ac0b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 27 00:30:09 2016 +0100

    extract function from ScDocument::FillInfo
    
    A first step in breaking the function into smaller pieces.
    
    Change-Id: I94aeb11fd9c44a7eaa198cb39f208b574ef2758d
    Reviewed-on: https://gerrit.libreoffice.org/23548
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit efea43b4c4f42023a540079866b065068ae8a8e5)
    Reviewed-on: https://gerrit.libreoffice.org/25280
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index e0e2623..b301796 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -191,6 +191,20 @@ public:
     }
 };
 
+bool isRotateItemUsed(ScDocumentPool *pPool)
+{
+    sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE );
+    for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++)
+    {
+        if (pPool->GetItem2( ATTR_ROTATE_VALUE, nItem ))
+        {
+            return true;
+        }
+    }
+
+    return false;
+}
+
 }
 
 void ScDocument::FillInfo(
@@ -308,14 +322,7 @@ void ScDocument::FillInfo(
     // Rotated text...
 
     // Is Attribute really used in document?
-    bool bAnyItem = false;
-    sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE );
-    for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++)
-        if (pPool->GetItem2( ATTR_ROTATE_VALUE, nItem ))
-        {
-            bAnyItem = true;
-            break;
-        }
+    bool bAnyItem = isRotateItemUsed(pPool);
 
     SCCOL nRotMax = nCol2;
     if ( bAnyItem && HasAttrib( 0,nRow1,nTab, MAXCOL,nRow2+1,nTab,


More information about the Libreoffice-commits mailing list