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

Michael Stahl mstahl at redhat.com
Mon Apr 18 21:09:13 UTC 2016


 sc/source/core/data/dpsave.cxx  |    6 +++---
 sc/source/ui/unoobj/dapiuno.cxx |    3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit dba0cc1edc6d778805ca8ed4b77800f1e9a95408
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Apr 13 16:39:38 2016 +0200

    tdf#96996 sc: fix the data pilot
    
    ScDPSaveData::GetInnermostDimension() should iterate in reverse (that
    fixes the reported bug), and ScDataPilotFieldObj::setOrientation()
    loop needs an early exit.
    
    (regression from 37856f59d2351951b95cf5eb3a5e4f0c011a8762)
    
    Change-Id: I7e0309385f3444bfd3ad21268cce4d25e60d7b05
    (cherry picked from commit 470f16acc2a798f0ae1ebe9ce2080084ab167e80)
    Reviewed-on: https://gerrit.libreoffice.org/24060
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 82d810c..708c8b2 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -1043,10 +1043,10 @@ ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(sal_uInt16 nOrientation)
     // return the innermost dimension for the given orientation,
     // excluding data layout dimension
 
-    for (auto const& iter : m_DimList)
+    for (auto iter = m_DimList.rbegin(); iter != m_DimList.rend(); ++iter)
     {
-        if (iter->GetOrientation() == nOrientation && !iter->IsDataLayout())
-            return &(*iter);
+        if ((*iter)->GetOrientation() == nOrientation && !(*iter)->IsDataLayout())
+            return iter->get();
     }
 
     return nullptr;
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 8958182..d5881de 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -2071,7 +2071,10 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew)
                 if ( !it->IsDataLayout() && (it->GetName() == maFieldId.maFieldName) )
                 {
                     if ( it->GetOrientation() == DataPilotFieldOrientation_HIDDEN )
+                    {
                         pNewDim = it.get();     // use this one
+                        break;
+                    }
                     else
                         ++nFound;               // count existing non-hidden occurrences
                 }


More information about the Libreoffice-commits mailing list