summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2021-08-17 14:28:48 +0200
committerLászló Németh <nemeth@numbertext.org>2021-08-23 11:50:29 +0200
commite701732725dd641741f39020d7dc965bc4db765d (patch)
tree3643befbd31896d392a015282cfc0617ceafb75c /chart2
parente9f790e59eec134d6b588241d02d3c2bb82cbc27 (diff)
tdf#142351 chart ooxml import: fix category axis cross position
Set PROP_CrossoverPosition value regardless of the mrModel.mbAuto value, which is a different thing. This element specifies that this axis is a date or text axis based on the data that is used for the axis labels, not a specific choice. Change-Id: Ifa291aac2f4bb3981d968de3489b23f1af485104 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120592 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx17
-rw-r--r--chart2/qa/extras/data/xlsx/tdf142351.xlsxbin0 -> 15077 bytes
2 files changed, 14 insertions, 3 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 89dcdeb529fd..608905e59328 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -531,10 +531,21 @@ void Chart2ExportTest::testBarChart()
void Chart2ExportTest::testCrosses()
{
- load(u"/chart2/qa/extras/data/docx/", "Bar_horizontal_cone.docx");
- xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ // test crosses val="autoZero" with DOCX
+ {
+ load(u"/chart2/qa/extras/data/docx/", "Bar_horizontal_cone.docx");
+ xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero");
+ }
+ // tdf#142351: test crossesAt val="-50" with XLSX
+ {
+ load(u"/chart2/qa/extras/data/xlsx/", "tdf142351.xlsx");
+ xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crossesAt", "val", "-50");
+ }
}
void Chart2ExportTest::testScatterChartTextXValues()
diff --git a/chart2/qa/extras/data/xlsx/tdf142351.xlsx b/chart2/qa/extras/data/xlsx/tdf142351.xlsx
new file mode 100644
index 000000000000..0414bb3f1625
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf142351.xlsx
Binary files differ