diff options
author | Justin Luth <justin.luth@collabora.com> | 2024-01-05 21:20:02 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2024-01-09 21:33:38 +0100 |
commit | 0dd3df9400cebeb7cf24887a8640d07a3f9eb4b2 (patch) | |
tree | 92be33ecb1faa2b5357067829f235d295bcd23d2 /chart2/qa/extras | |
parent | 2bafeb5835d1c11b3e217c0de3f9f430824079de (diff) |
tdf#137691 chart2 import: provide NumberFormat to DataSeries
make CppunitTest_chart2_export3 CPPUNIT_TEST_NAME=tdf137691
This patch provides some very foundational support
to importing a chart. It will open up a lot of doors
to improve LinkToSource - since now the Source key is defined.
Likely the source key should default to -1 instead of 0,
so that LinkToSource can know whether or not the source is defined.
/chart2/qa/extras/data/docx/testSeriesIdxOrder.docx
is an example of where this patchset SHOULD have worked,
but somehow it is losing its key during import...
Unfortunately I have run out of time and can not follow
these rabbit trails. Well, at least not until this change
is considered a regression for some particular document...
Change-Id: Ieddf2103002616aca2a408bde1f86d45c08dfc85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161702
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'chart2/qa/extras')
-rw-r--r-- | chart2/qa/extras/chart2export3.cxx | 21 | ||||
-rw-r--r-- | chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx | bin | 0 -> 49901 bytes |
2 files changed, 21 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export3.cxx b/chart2/qa/extras/chart2export3.cxx index 59416198ce0f..70bcc8fdfb18 100644 --- a/chart2/qa/extras/chart2export3.cxx +++ b/chart2/qa/extras/chart2export3.cxx @@ -664,6 +664,27 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTableOnPage3) CPPUNIT_ASSERT_EQUAL(OUString("If oversubscription relative to allowance holds steady at average oversubscription level B15-B17"), aColumnDesc[3]); } +CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, tdf137691) +{ + // given a doc where the banana negative data formats as ($123) and the pineapple data as $(123) + loadFromFile(u"pptx/tdf137691_dataTable.pptx"); + // saveAndReload("Impress MS PowerPoint 2007 XML"); // Always exports as key 0 (General) + + Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + + Reference< chart2::data::XDataSequence > xDataSeq; + xDataSeq.set(getDataSequenceFromDocByRole(xChartDoc, u"values-y", 0)); + const sal_Int32 nKey_bananas = xDataSeq->getNumberFormatKeyByIndex(-1); + // This should not be General format (0), but a defined format (129) + CPPUNIT_ASSERT(nKey_bananas); + + xDataSeq.set(getDataSequenceFromDocByRole(xChartDoc, u"values-y", 1)); + const sal_Int32 nKey_pineapples = xDataSeq->getNumberFormatKeyByIndex(-1); + // This should not be General format (0), but a defined format (130) + CPPUNIT_ASSERT(nKey_pineapples); + CPPUNIT_ASSERT(nKey_pineapples != nKey_bananas); +} + CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testMultipleAxisXLSX) { loadFromFile(u"ods/multiple_axis.ods"); diff --git a/chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx b/chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx Binary files differnew file mode 100644 index 000000000000..edb465d729af --- /dev/null +++ b/chart2/qa/extras/data/pptx/tdf137691_dataTable.pptx |