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

New commits:
commit 271bdc3469b694c113e4449750866dee032e2d34
Author:     Balazs Varga <balazs.varga...@gmail.com>
AuthorDate: Thu Nov 7 10:31:49 2019 +0100
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Fri Nov 8 12:33:31 2019 +0100

    tdf#128633 Chart OOXML Export: Fix position of bar in charts
    
    Fix export of c:crossBetween tag if the category axis is deleted.
    
    Regression from commit: e0b0502516a10181bbd1737b93b38b2bba4c98e8
    (tdf#128016 Chart OOXML Import: fix duplicated category labels)
    
    Change-Id: I46ab45f3ba4f3d0fdde3ddf017a7f512b6e2e403
    Reviewed-on: https://gerrit.libreoffice.org/82194
    Tested-by: Jenkins
    Reviewed-by: László Németh <nem...@numbertext.org>
    Tested-by: László Németh <nem...@numbertext.org>

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 5f2b9ee6825b..dd07808b1d05 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -123,6 +123,7 @@ public:
     void testCombinedChartSecondaryAxisXLSX();
     void testCombinedChartSecondaryAxisODS();
     void testCrossBetweenXLSX();
+    void testCrossBetweenWithDeletedAxis();
     void testCrossBetweenODS();
     void testAxisTitleRotationXLSX();
     void testAxisTitlePositionDOCX();
@@ -231,6 +232,7 @@ public:
     CPPUNIT_TEST(testCombinedChartSecondaryAxisXLSX);
     CPPUNIT_TEST(testCombinedChartSecondaryAxisODS);
     CPPUNIT_TEST(testCrossBetweenXLSX);
+    CPPUNIT_TEST(testCrossBetweenWithDeletedAxis);
     CPPUNIT_TEST(testCrossBetweenODS);
     CPPUNIT_TEST(testAxisTitleRotationXLSX);
     CPPUNIT_TEST(testAxisTitlePositionDOCX);
@@ -1944,6 +1946,15 @@ void Chart2ExportTest::testCrossBetweenXLSX()
     assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between");
 }
 
+void Chart2ExportTest::testCrossBetweenWithDeletedAxis()
+{
+    // Original file was created with MS Office (the category axis is deleted 
in the file)
+    load("/chart2/qa/extras/data/xlsx/", "tdf128633.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:crossBetween", "val", "between");
+}
+
 void Chart2ExportTest::testCrossBetweenODS()
 {
     // Original file was created with LibreOffice
diff --git a/chart2/qa/extras/data/xlsx/tdf128633.xlsx 
b/chart2/qa/extras/data/xlsx/tdf128633.xlsx
new file mode 100644
index 000000000000..fa186895d65e
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf128633.xlsx differ
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index c4bf38eff9ef..040014912b32 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -251,7 +251,7 @@ static bool lcl_isCategoryAxisShifted(const Reference< 
chart2::XChartDocument >&
                     if( xAxis.is())
                     {
                         chart2::ScaleData aScaleData = xAxis->getScaleData();
-                        if( aScaleData.Categories.is() )
+                        if( aScaleData.AxisType == AXIS_PRIMARY_Y )
                         {
                             isCategoryPositionShifted = 
aScaleData.ShiftedCategoryPosition;
                             break;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to