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

Eike Rathke erack at redhat.com
Tue Jun 7 15:55:16 UTC 2016


 sc/source/core/data/dpresfilter.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit f6b76c9d7fa989ac9475ff6d2ab45c257f96ad3e
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jun 7 16:30:45 2016 +0200

    Resolves: tdf#89186 descend into dimension children to obtain leaf result
    
    (cherry picked from commit 81f2bbc2fc42688d5f884d3dde58abe4c265694a)
    
    Backported.
    
    Change-Id: Iea6c292c6d7347c4abb221672e583118196e6c1f
    Reviewed-on: https://gerrit.libreoffice.org/26026
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx
index f66e7f1..bed460d 100644
--- a/sc/source/core/data/dpresfilter.cxx
+++ b/sc/source/core/data/dpresfilter.cxx
@@ -219,6 +219,24 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults(
         pMember = itMem->second;
     }
 
+    if (pMember->maValues.empty())
+    {
+        // Descend into dimension member children while there is no result and
+        // exactly one dimension field with exactly one member item, for which
+        // no further constraint (filter) has to match.
+        const MemberNode* pFieldMember = pMember;
+        while (pFieldMember->maChildDimensions.size() == 1)
+        {
+            DimensionsType::const_iterator itDim( pFieldMember->maChildDimensions.begin());
+            const DimensionNode* pDim = itDim->second;
+            if (pDim->maChildMembers.size() != 1)
+                break;  // while
+            pFieldMember = pDim->maChildMembers.begin()->second;
+            if (!pFieldMember->maValues.empty())
+                return &pFieldMember->maValues;
+        }
+    }
+
     return &pMember->maValues;
 }
 


More information about the Libreoffice-commits mailing list