diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-04-16 00:39:20 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-04-16 08:31:38 +0200 |
commit | ded4d570fde21e55091c9c8c364114e67aa0cdcf (patch) | |
tree | 30bd5cc1d12cc68ca129769e926e40798bb3de94 /sc/qa/unit | |
parent | bdf3b5ce49b0e4ee1b4525d344cfb037ef473059 (diff) |
pivot: suppprt multiple cell format reference indices
This adds support for multiple cell format reference indices, so
the same cell format is applied to multiple cells (defined by
indices) so that each doesn't need to be defined by its own
reference (as they are all the same anyway and only differ by
single index).
The solution is to create multiple format outputs for one format
entry - each for a selection index, but have other data still the
same. This is a bit tricky as previously it was one format output
for one format entry, which is not the case anymore.
Change-Id: I074ac03e7d81e26562a6a6cc395b11cfed16766d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166131
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/PivotTableFormatsImportExport.cxx | 15 | ||||
-rw-r--r-- | sc/qa/unit/data/xlsx/pivot-table/PivotTableCellFormatsTest_9_MultipleSelections.xlsx | bin | 0 -> 12939 bytes |
2 files changed, 15 insertions, 0 deletions
diff --git a/sc/qa/unit/PivotTableFormatsImportExport.cxx b/sc/qa/unit/PivotTableFormatsImportExport.cxx index 1c20cdc3b5ac..40db2afb2292 100644 --- a/sc/qa/unit/PivotTableFormatsImportExport.cxx +++ b/sc/qa/unit/PivotTableFormatsImportExport.cxx @@ -295,6 +295,21 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, assertDocument(*getScDoc()); } +CPPUNIT_TEST_FIXTURE(ScPivotTableFormatsImportExport, + PivotTableCellFormatsTest_9_MultipleSelections) +{ + auto assertDocument = [](ScDocument& rDoc) { + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"I6"_ustr)); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"I7"_ustr)); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getBackgroundColor(rDoc, u"I8"_ustr)); + }; + + createScDoc("xlsx/pivot-table/PivotTableCellFormatsTest_9_MultipleSelections.xlsx"); + assertDocument(*getScDoc()); + saveAndReload("Calc Office Open XML"); + assertDocument(*getScDoc()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/data/xlsx/pivot-table/PivotTableCellFormatsTest_9_MultipleSelections.xlsx b/sc/qa/unit/data/xlsx/pivot-table/PivotTableCellFormatsTest_9_MultipleSelections.xlsx Binary files differnew file mode 100644 index 000000000000..6d317d2e45c0 --- /dev/null +++ b/sc/qa/unit/data/xlsx/pivot-table/PivotTableCellFormatsTest_9_MultipleSelections.xlsx |