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

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 30 14:33:36 UTC 2019


 chart2/qa/extras/chart2export.cxx |    4 +++-
 oox/source/export/chartexport.cxx |    6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 5b97e75589523b3769ec87e27854e2c841d0d79f
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Thu Aug 29 11:08:04 2019 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Fri Aug 30 16:32:47 2019 +0200

    tdf#103988 OOXML export: fix bubble chart MSO interoperability
    
    Write <c:bubble3D val="0"/> into each <CT_BubbleSer> OOXML element
    to allow file opening in MSO without removing the (previously
    "corrupted") bubble chart.
    
    Change-Id: Idf31a0d3d8f98a3be4c9a3b29e65d4d4c582be53
    Reviewed-on: https://gerrit.libreoffice.org/78259
    Reviewed-by: László Németh <nemeth at numbertext.org>
    Tested-by: László Németh <nemeth at numbertext.org>

diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 40ce4cc9e808..e1c7a4403afe 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -1570,7 +1570,9 @@ void Chart2ExportTest::testBubble3DXLSX()
     load("/chart2/qa/extras/data/xlsx/", "bubble_chart_simple.xlsx");
     xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
     CPPUNIT_ASSERT(pXmlDoc);
-    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:bubble3D", "val", "0");
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[1]/c:bubble3D", "val", "0");
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[2]/c:bubble3D", "val", "0");
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:ser[3]/c:bubble3D", "val", "0");
 }
 
 void Chart2ExportTest::testNoMarkerXLSX()
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index bbf647926b33..a813acfd83b8 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1659,8 +1659,6 @@ void ChartExport::exportBubbleChart( const Reference< chart2::XChartType >& xCha
     bool bPrimaryAxes = true;
     exportAllSeries(xChartType, bPrimaryAxes);
 
-    pFS->singleElement(FSNS(XML_c, XML_bubble3D), XML_val, "0");
-
     exportAxesId(bPrimaryAxes);
 
     pFS->endElement( FSNS( XML_c, XML_bubbleChart ) );
@@ -2191,6 +2189,10 @@ void ChartExport::exportSeries( const Reference<chart2::XChartType>& xChartType,
                             || eChartType == chart::TYPEID_LINE )
                         exportSmooth();
 
+                    // tdf103988: "corrupted" files with Bubble chart opening in MSO
+                    if( eChartType == chart::TYPEID_BUBBLE )
+                        pFS->singleElement(FSNS(XML_c, XML_bubble3D), XML_val, "0");
+
                     pFS->endElement( FSNS( XML_c, XML_ser ) );
                 }
             }


More information about the Libreoffice-commits mailing list