diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-04-02 23:35:10 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-04-12 00:59:23 +0200 |
commit | 6d95493690def02b15c28f2ab1c9b5831675b326 (patch) | |
tree | c7db104873d952da8d3b37cc05367d2edef4125b /sc | |
parent | 81a24b62c72d722fd4a80878300e7ab257ecdcc7 (diff) |
pivot: also set format on a data field within row/column output
Change-Id: I83cd4edd8fd64698170e1e8ac83f5017af80042f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165685
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dpoutput.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 1da4fccec769..f19f0ff57f7e 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -1095,7 +1095,10 @@ void ScDPOutput::outputColumnHeaders(SCTAB nTab, ScDPOutputImpl& rOutputImpl) if (mpFormats) { auto& rColumnField = mpColFields[nField]; - tools::Long nDimension = rColumnField.mnDim; + tools::Long nDimension = -2; + if (!rColumnField.mbDataLayout) + nDimension = rColumnField.mnDim; + for (auto& aFormat : mpFormats->getVector()) { if (aFormat.nField == nDimension && aFormat.nDataIndex == nColumnIndex) @@ -1197,7 +1200,9 @@ void ScDPOutput::outputRowHeader(SCTAB nTab, ScDPOutputImpl& rOutputImpl) if (mpFormats) { auto& rRowField = mpRowFields[nField]; - tools::Long nDimension = rRowField.mnDim; + tools::Long nDimension = -2; + if (!rRowField.mbDataLayout) + nDimension = rRowField.mnDim; for (auto& aFormat : mpFormats->getVector()) { if (aFormat.nField == nDimension && aFormat.nDataIndex == nRowIndex) |