chart2/qa/extras/chart2export.cxx | 22 ++++++++++++++++++++++ chart2/qa/extras/data/docx/tdf134255.docx |binary oox/source/drawingml/chart/objectformatter.cxx | 4 ++++ 3 files changed, 26 insertions(+)
New commits: commit 83b929e3ed9d5b413f074a122480e01373cf99f1 Author: Balazs Varga <balazs.varga...@gmail.com> AuthorDate: Tue Jul 7 13:11:19 2020 +0200 Commit: Gabor Kelemen <kelemen.gab...@nisz.hu> CommitDate: Fri Jul 31 13:09:10 2020 +0200 tdf#134255 Chart OOXML Import: set the auto text wrap property to true, if we do not have text property attribute. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98252 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit c777cb492d12fb7038254f116102716b9cb84fa3) Change-Id: I1a416f74c3f034f902fd583790f9db307f5e8881 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99836 Tested-by: Gabor Kelemen <kelemen.gab...@nisz.hu> Reviewed-by: Gabor Kelemen <kelemen.gab...@nisz.hu> diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 035b35456eba..58c2439d16e0 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -155,6 +155,7 @@ public: void testTdf126076(); void testTdf132076(); void testTdf132594(); + void testTdf134255(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -273,6 +274,7 @@ public: CPPUNIT_TEST(testTdf126076); CPPUNIT_TEST(testTdf132076); CPPUNIT_TEST(testTdf132594); + CPPUNIT_TEST(testTdf134255); CPPUNIT_TEST_SUITE_END(); @@ -2512,6 +2514,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 + xmlDocPtr 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 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf134255.docx differ diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index ed52ccf5c2b1..35663e4ef8b9 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -1086,6 +1086,10 @@ void ObjectFormatter::convertTextWrap( PropertySet& rPropSet, const ModelRef< Te } } } + else + { // set default value (in OOXML the default value is true) + rPropSet.setProperty( PROP_TextWordWrap, true ); + } } void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFormat& rNumberFormat, bool bAxis, bool bShowPercent ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits