From 74d020fb1344dd904681b612739727351f183b78 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Wed, 20 May 2020 21:10:41 +0200 Subject: tdf#133190 tdf#133191 Chart OOXML export: fix text wrap and rotation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit of data point labels. Change-Id: Ic61d9ee149e838c000b5dc9ac0411bbe0f07219a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94598 Tested-by: László Németh Reviewed-by: László Németh --- chart2/qa/extras/chart2export.cxx | 25 +++++++++++++++++++++ .../qa/extras/data/xlsx/tdf133190_tdf133191.xlsx | Bin 0 -> 12142 bytes 2 files changed, 25 insertions(+) create mode 100644 chart2/qa/extras/data/xlsx/tdf133190_tdf133191.xlsx (limited to 'chart2') diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 08086d8ae2ab..429ea41c5a5a 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -168,6 +168,8 @@ public: void testTdf131979(); void testTdf132076(); void testTdf125812(); + void testTdf133190(); + void testTdf133191(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -299,6 +301,8 @@ public: CPPUNIT_TEST(testTdf131979); CPPUNIT_TEST(testTdf132076); CPPUNIT_TEST(testTdf125812); + CPPUNIT_TEST(testTdf133190); + CPPUNIT_TEST(testTdf133191); CPPUNIT_TEST_SUITE_END(); @@ -2766,6 +2770,27 @@ void Chart2ExportTest::testTdf125812() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:gradFill/a:path/a:fillToRect", "b", "51000"); } +void Chart2ExportTest::testTdf133190() +{ + load("/chart2/qa/extras/data/xlsx/", "tdf133190_tdf133191.xlsx"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + + // Test word wrap of data point label + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:txPr/a:bodyPr", "wrap", "none"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[2]/c:txPr/a:bodyPr", "wrap", "square"); +} + +void Chart2ExportTest::testTdf133191() +{ + load("/chart2/qa/extras/data/xlsx/", "tdf133190_tdf133191.xlsx"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + + // Test rotation of data point label + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[3]/c:txPr/a:bodyPr", "rot", "-4500000"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/tdf133190_tdf133191.xlsx b/chart2/qa/extras/data/xlsx/tdf133190_tdf133191.xlsx new file mode 100644 index 000000000000..f8cad0e8cfec Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf133190_tdf133191.xlsx differ -- cgit