diff options
author | Eike Rathke <erack@redhat.com> | 2016-06-07 16:30:45 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-06-07 16:37:15 +0200 |
commit | 81f2bbc2fc42688d5f884d3dde58abe4c265694a (patch) | |
tree | 537880b7b409fa0508f5a06287d549f960404223 | |
parent | 77c55e962140d0c822f05a5d972c450e807ab220 (diff) |
Resolves: tdf#89186 descend into dimension children to obtain leaf result
Change-Id: Iea6c292c6d7347c4abb221672e583118196e6c1f
-rw-r--r-- | sc/source/core/data/dpresfilter.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx index 033762abcda0..d119f09138a8 100644 --- a/sc/source/core/data/dpresfilter.cxx +++ b/sc/source/core/data/dpresfilter.cxx @@ -239,6 +239,24 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults( pMember = itMem->second.get(); } + 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->maChildMembersValueNames.size() != 1) + break; // while + pFieldMember = pDim->maChildMembersValueNames.begin()->second.get(); + if (!pFieldMember->maValues.empty()) + return &pFieldMember->maValues; + } + } + return &pMember->maValues; } |