summaryrefslogtreecommitdiffstats
path: root/sc/source/core/data/dpoutput.cxx
diff options
context:
space:
mode:
authorluigiiucci <luigi.iucci@collabora.com>2023-05-17 11:02:37 +0200
committerAron Budea <aron.budea@collabora.com>2023-07-05 01:23:40 +0200
commit3a51b402f243eb32b544c16813f682617d88c0b9 (patch)
treef298deb010c82490db9db27db1a0debcf3ea832d /sc/source/core/data/dpoutput.cxx
parentproblem pasting to calc an image copied from firefox (windows) (diff)
downloadcore-3a51b402f243eb32b544c16813f682617d88c0b9.tar.gz
core-3a51b402f243eb32b544c16813f682617d88c0b9.zip
Header columns can disappear with filtered data in pivot tables
When we set on a pivot table a filter that filters all the rows, the pivot table showed only the first header columns and computed column, but all the columns headers should still be shown so we can adjust the filter for the column. This fixes this issue. Also add more debug output and prevent a crash when running pivot table tests. Change-Id: I30b4ee72cf8436c4522ab4ba0781462b214816dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151871 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 3551d18404cb19cdaa8edb170a549f5c5405d0cb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153686 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sc/source/core/data/dpoutput.cxx')
-rw-r--r--sc/source/core/data/dpoutput.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index bf2109b300a3..b8565852d511 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -600,7 +600,11 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
case sheet::DataPilotFieldOrientation_ROW:
{
uno::Sequence<sheet::MemberResult> aResult = xLevRes->getResults();
- if (!lcl_MemberEmpty(aResult))
+ // We want only to remove the DATA column if it is empty
+ // and not any other empty columns (to still show the
+ // header columns)
+ bool bSkip = lcl_MemberEmpty(aResult) && bIsDataLayout;
+ if (!bSkip)
{
ScDPOutLevelData tmp(nDim, nHierarchy, nLev, nDimPos, nNumFmt, aResult, aName,
aCaption, bHasHiddenMember, bIsDataLayout, false);