[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/inc sc/source

Eike Rathke erack at redhat.com
Thu Jul 9 13:00:10 PDT 2015


 sc/inc/conditio.hxx              |    1 +
 sc/source/core/data/conditio.cxx |    5 +++++
 sc/source/core/data/documen7.cxx |    5 ++++-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 1f3ec2e3cb52c0e10c36ac0b113c37462147f3b1
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Jul 9 21:05:20 2015 +0200

    execute the terrible bottle neck loop only if there are conditional formats
    
    Change-Id: Ic8bd65a728289c9fa1a0721b0ecbd9b4a48672ca
    (cherry picked from commit 2aefb89b299e7ebdca5bb35aa4e9059e59805715)
    Reviewed-on: https://gerrit.libreoffice.org/16902
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index fc039c0..4a813c9 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -495,6 +495,7 @@ public:
     const_iterator end() const;
 
     size_t size() const;
+    bool empty() const;
 
     void erase(sal_uLong nIndex);
 
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 3036999..d4408d9 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -2321,6 +2321,11 @@ size_t ScConditionalFormatList::size() const
     return maConditionalFormats.size();
 }
 
+bool ScConditionalFormatList::empty() const
+{
+    return maConditionalFormats.empty();
+}
+
 void ScConditionalFormatList::erase( sal_uLong nIndex )
 {
     for( iterator itr = begin(); itr != end(); ++itr )
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index b67cce9..795e93c 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -141,8 +141,11 @@ void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint, bool bB
             continue;
 
         ScConditionalFormatList* pCondFormList = GetCondFormList(nTab);
-        if (pCondFormList)
+        if (pCondFormList && !pCondFormList->empty())
         {
+            /* TODO: looping over all possible cells is a terrible bottle neck,
+             * for each cell looping over all conditional formats even worse,
+             * this certainly needs a better method. */
             ScAddress aAddress( 0, 0, nTab);
             for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
             {


More information about the Libreoffice-commits mailing list