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 c777cb492d12fb7038254f116102716b9cb84fa3
Author:     Balazs Varga <balazs.varga...@gmail.com>
AuthorDate: Tue Jul 7 13:11:19 2020 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Mon Jul 13 10:39:19 2020 +0200

    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 <nem...@numbertext.org>

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
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 c4f48b73e450..7e4073686065 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1077,7 +1077,11 @@ void ObjectFormatter::convertTextRotation( PropertySet& 
rPropSet, const ModelRef
 void ObjectFormatter::convertTextWrap( PropertySet& rPropSet, const ModelRef< 
TextBody >& rxTextProp )
 {
     if( !rxTextProp.is() )
+    {
+        // set default value (in OOXML the default value is true)
+        rPropSet.setProperty( PROP_TextWordWrap, true );
         return;
+    }
 
     PropertyMap& aPropMap = rxTextProp->getTextProperties().maPropertyMap;
     if( aPropMap.hasProperty(PROP_TextWordWrap) )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to