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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Mar 5 07:53:02 UTC 2019


 chart2/qa/extras/chart2export.cxx                |   19 +++++++++++++++++++
 chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx |binary
 oox/source/export/chartexport.cxx                |    2 ++
 3 files changed, 21 insertions(+)

New commits:
commit 66b9f180c865d0ed57a297fe439a068f513b0fc6
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Thu Feb 14 16:30:43 2019 +0100
Commit:     Bartosz Kosiorek <gang65 at poczta.onet.pl>
CommitDate: Tue Mar 5 08:52:37 2019 +0100

    tdf#97575 Chart OOXML: Export ShapeProps of Error Bars
    
    Export the shapeProps (fillstyle, linestyle, linewidth,
    linecolor etc.) of the Error Bars to OOXML.
    
    Change-Id: Iff74fa463fdd0fb6ed95e4d1bf0d3e906349860c
    Reviewed-on: https://gerrit.libreoffice.org/67825
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit b89f239aa9d3d4660380bbd0c893aecde0986032)
    Reviewed-on: https://gerrit.libreoffice.org/67950
    Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>

diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 88d58bd7c683..839ef8c71752 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -41,6 +41,7 @@ protected:
 public:
     Chart2ExportTest() : ChartTest() {}
     void testErrorBarXLSX();
+    void testErrorBarPropXLSX();
     void testTrendline();
     void testTrendlineOOXML();
     void testTrendlineXLS();
@@ -128,6 +129,7 @@ public:
 
     CPPUNIT_TEST_SUITE(Chart2ExportTest);
     CPPUNIT_TEST(testErrorBarXLSX);
+    CPPUNIT_TEST(testErrorBarPropXLSX);
     CPPUNIT_TEST(testTrendline);
     CPPUNIT_TEST(testTrendlineOOXML);
     CPPUNIT_TEST(testTrendlineXLS);
@@ -490,6 +492,23 @@ void Chart2ExportTest::testErrorBarXLSX()
     }
 }
 
+void Chart2ExportTest::testErrorBarPropXLSX()
+{
+    load("/chart2/qa/extras/data/xlsx/", "testErrorBarProp.xlsx");
+    xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML");
+    CPPUNIT_ASSERT(pXmlDoc);
+
+    // test y error bars property
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:errDir", "val", "y");
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:spPr/a:ln", "w", "12600");
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "ff0000");
+
+    // test x error bars property
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:errDir", "val", "x");
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:spPr/a:ln", "w", "9360");
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:errBars[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", "595959");
+}
+
 // This method tests the preservation of properties for trendlines / regression curves
 // in an export -> import cycle using different file formats - ODS, XLS and XLSX.
 void Chart2ExportTest::testTrendline()
diff --git a/chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx b/chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx
new file mode 100755
index 000000000000..ac9dde9b79b6
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testErrorBarProp.xlsx differ
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 05a2946f9e4a..cf6dcab3139c 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3868,6 +3868,8 @@ void ChartExport::exportErrorBar(const Reference< XPropertySet>& xErrorBarProps,
                 FSEND );
     }
 
+    exportShapeProps( xErrorBarProps );
+
     pFS->endElement( FSNS( XML_c, XML_errBars) );
 }
 


More information about the Libreoffice-commits mailing list