[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 3 07:25:26 UTC 2020


 chart2/qa/extras/chart2import.cxx              |   19 +++++++++++++++++++
 chart2/qa/extras/data/docx/tdf134111.docx      |binary
 oox/source/drawingml/chart/objectformatter.cxx |    2 +-
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit d2cdc4a090b420b79bb5b7b76b152919d3596b15
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Fri Jun 19 11:07:04 2020 +0200
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Mon Aug 3 09:24:57 2020 +0200

    tdf#134111 Chart OOXML Import: set text break to true
    
    of category axis labels, even if the XML do not contain
    Text Properties of category axis labels.
    
    Change-Id: Ia0b154b2dfbfb00ffa0762af771423196586a5ae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96683
    Tested-by: Jenkins
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 6d1e9482cf1519e5b4d73331a5bcdfbbc9a15776)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99842
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index b60540fb3dda..acfe42423231 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -157,6 +157,7 @@ public:
     void testTdf123206CustomLabelField();
     void testStockChartShiftedCategoryPosition();
     void testTdf91250();
+    void testTdf134111();
 
     CPPUNIT_TEST_SUITE(Chart2ImportTest);
     CPPUNIT_TEST(Fdo60083);
@@ -263,6 +264,7 @@ public:
     CPPUNIT_TEST(testTdf123206CustomLabelField);
     CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
     CPPUNIT_TEST(testTdf91250);
+    CPPUNIT_TEST(testTdf134111);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -2466,6 +2468,23 @@ void Chart2ImportTest::testTdf91250()
     CPPUNIT_ASSERT_EQUAL(OUString("8.657"), aCategories[3]);
 }
 
+void Chart2ImportTest::testTdf134111()
+{
+    // tdf134111 : To check TextBreak value is true
+    load("/chart2/qa/extras/data/docx/", "tdf134111.docx");
+    uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromWriter(0);
+    CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+    uno::Reference< chart::XDiagram > mxDiagram(xChartDoc->getDiagram());
+    CPPUNIT_ASSERT(mxDiagram.is());
+    uno::Reference< chart::XAxisXSupplier > xAxisXSupp(mxDiagram, uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xAxisXSupp.is());
+    uno::Reference< beans::XPropertySet > xAxisProp(xAxisXSupp->getXAxis());
+    bool bTextBreak = false;
+    xAxisProp->getPropertyValue("TextBreak") >>= bTextBreak;
+    // Expected value of 'TextBreak' is true
+    CPPUNIT_ASSERT(bTextBreak);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/tdf134111.docx b/chart2/qa/extras/data/docx/tdf134111.docx
new file mode 100644
index 000000000000..26e3a03e0b6d
Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf134111.docx differ
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index 35663e4ef8b9..a12a8b94b12e 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1151,7 +1151,7 @@ bool ObjectFormatter::getTextRotation( const ModelRef< TextBody >& rxTextProp, s
     }
     else
     {
-        return false;
+        return true;
     }
 }
 


More information about the Libreoffice-commits mailing list