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 <mst...@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 <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@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 } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits