[Libreoffice-commits] core.git: 2 commits - chart2/qa oox/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Jun 2 14:15:47 PDT 2015


 chart2/qa/extras/chart2export.cxx                   |   11 +++++++++++
 chart2/qa/extras/data/xlsx/axis_title_rotation.xlsx |binary
 oox/source/export/chartexport.cxx                   |    2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 365896fe45286c6545915e0fe8be0378f900ebad
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jun 2 14:07:16 2015 +0200

    add test for tdf#91685
    
    Change-Id: I9a08a11038e3e0f873abc4513c0cbda97f0e4795

diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 5b40560..9540ed5 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -98,6 +98,7 @@ public:
     void testPlotVisOnlyXLSX();
     void testBarChartVaryColorsXLSX();
     void testMultipleAxisXLSX();
+    void testAxisTitleRotationXLSX();
 
     CPPUNIT_TEST_SUITE(Chart2ExportTest);
     CPPUNIT_TEST(testErrorBarXLSX);
@@ -160,6 +161,7 @@ public:
     CPPUNIT_TEST(testPlotVisOnlyXLSX);
     CPPUNIT_TEST(testBarChartVaryColorsXLSX);
     CPPUNIT_TEST(testMultipleAxisXLSX);
+    CPPUNIT_TEST(testAxisTitleRotationXLSX);
     CPPUNIT_TEST_SUITE_END();
 
 protected:
@@ -1462,6 +1464,15 @@ void Chart2ExportTest::testMultipleAxisXLSX()
     assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:axPos[@val='r']", 1);
 }
 
+void Chart2ExportTest::testAxisTitleRotationXLSX()
+{
+    load("/chart2/qa/extras/data/xlsx/", "axis_title_rotation.xlsx");
+    xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+    CPPUNIT_ASSERT(pXmlDoc);
+
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:valAx/c:title/c:tx/c:rich/a:bodyPr", "rot", "0");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/axis_title_rotation.xlsx b/chart2/qa/extras/data/xlsx/axis_title_rotation.xlsx
new file mode 100644
index 0000000..fc90e2b
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/axis_title_rotation.xlsx differ
commit fa0e5e2928547398fdb53cafcefcd9c3ba9c6a7e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jun 2 13:47:25 2015 +0200

    that special case was a really stupid idea, tdf#91685
    
    The default value is context depending and not 0. So always export the
    rotation value.
    
    Change-Id: I36162459757c58846f3ecea7dcbcb58b6ef3d1f6

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 2f0853b..f091126 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1110,7 +1110,7 @@ void ChartExport::exportTitle( Reference< XShape > xShape )
 
     pFS->singleElement( FSNS( XML_a, XML_bodyPr ),
             XML_vert, sWritingMode,
-            XML_rot, nRotation == 0 ? NULL : calcRotationValue(nRotation).getStr(),
+            XML_rot, calcRotationValue(nRotation).getStr(),
             FSEND );
     // TODO: lstStyle
     pFS->singleElement( FSNS( XML_a, XML_lstStyle ),


More information about the Libreoffice-commits mailing list