summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2020-07-07 13:11:19 +0200
committerLászló Németh <nemeth@numbertext.org>2020-07-13 10:39:19 +0200
commitc777cb492d12fb7038254f116102716b9cb84fa3 (patch)
treeb18d318e436eb77b6544ca8a61705f9b98bbedd4 /chart2
parentaa9bca1db35578503003a11f9fee3eb86feebf1a (diff)
tdf#134255 Chart OOXML Import: set the auto text wrap
property to true, if we do not have text property attribute. Change-Id: I1a416f74c3f034f902fd583790f9db307f5e8881 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98252 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx22
-rw-r--r--chart2/qa/extras/data/docx/tdf134255.docxbin0 -> 33169 bytes
2 files changed, 22 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 4e4c7168c3b3..f70898a11ce6 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -171,6 +171,7 @@ public:
void testTdf133190();
void testTdf133191();
void testTdf132594();
+ void testTdf134255();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(testErrorBarXLSX);
@@ -305,6 +306,7 @@ public:
CPPUNIT_TEST(testTdf133190);
CPPUNIT_TEST(testTdf133191);
CPPUNIT_TEST(testTdf132594);
+ CPPUNIT_TEST(testTdf134255);
CPPUNIT_TEST_SUITE_END();
@@ -2802,6 +2804,26 @@ void Chart2ExportTest::testTdf132594()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:cat", 1);
}
+void Chart2ExportTest::testTdf134255()
+{
+ load("/chart2/qa/extras/data/docx/", "tdf134255.docx");
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ // import test
+ Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xDataSeries.is());
+ Reference< beans::XPropertySet > xPropSet(xDataSeries, UNO_QUERY_THROW);
+ bool bWrap = false;
+ CPPUNIT_ASSERT((xPropSet->getPropertyValue("TextWordWrap") >>= bWrap) && bWrap);
+
+ // export test
+ xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:txPr/a:bodyPr", "wrap", "square");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/tdf134255.docx b/chart2/qa/extras/data/docx/tdf134255.docx
new file mode 100644
index 000000000000..ff3cd8b67b53
--- /dev/null
+++ b/chart2/qa/extras/data/docx/tdf134255.docx
Binary files differ