[Libreoffice-commits] core.git: 3 commits - include/oox oox/source

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Dec 13 11:49:01 PST 2013


 include/oox/export/chartexport.hxx |    2 
 oox/source/export/chartexport.cxx  |   80 +++++++++++++++++++++++++------------
 2 files changed, 58 insertions(+), 24 deletions(-)

New commits:
commit 6483f39e8959050ca4d5df42c27695ae98efa8c9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Dec 13 20:47:12 2013 +0100

    also export hiLowLines for lineChart
    
    Change-Id: I7b96fcb1e537517a80de87d997818d372d03f74a

diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 833b90a..1e6278b 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -130,6 +130,7 @@ private:
     void exportScatterChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
     void exportStockChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
     void exportSuffaceChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+    void exportHiLowLines();
     void exportUpDownBars(com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
 
     void exportSeries( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType, sal_Int32& nAttachedAxis );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index fddaf8e..0c06208 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1246,6 +1246,7 @@ void ChartExport::exportLineChart( Reference< chart2::XChartType > xChartType )
 
     if( !mbIs3DChart )
     {
+        exportHiLowLines();
         exportUpDownBars(xChartType);
         const char* marker = nSymbolType == ::com::sun::star::chart::ChartSymbolType::NONE? "0":"1";
         pFS->singleElement( FSNS( XML_c, XML_marker ),
@@ -1347,15 +1348,7 @@ void ChartExport::exportStockChart( Reference< chart2::XChartType > xChartType )
     Reference< ::com::sun::star::chart::XStatisticDisplay > xStockPropProvider( mxDiagram, uno::UNO_QUERY );
     if( xStockPropProvider.is())
     {
-        // stock-range-line
-        Reference< beans::XPropertySet > xStockPropSet = xStockPropProvider->getMinMaxLine();
-        if( xStockPropSet.is() )
-        {
-            pFS->startElement( FSNS( XML_c, XML_hiLowLines ),
-                FSEND );
-            exportShapeProps( xStockPropSet );
-            pFS->endElement( FSNS( XML_c, XML_hiLowLines ) );
-        }
+        exportHiLowLines();
         exportUpDownBars(xChartType);
     }
 
@@ -1364,6 +1357,25 @@ void ChartExport::exportStockChart( Reference< chart2::XChartType > xChartType )
     pFS->endElement( FSNS( XML_c, XML_stockChart ) );
 }
 
+void ChartExport::exportHiLowLines()
+{
+    FSHelperPtr pFS = GetFS();
+    // export the chart property
+    Reference< ::com::sun::star::chart::XStatisticDisplay > xChartPropProvider( mxDiagram, uno::UNO_QUERY );
+
+    if (!xChartPropProvider.is())
+        return;
+
+    Reference< beans::XPropertySet > xStockPropSet = xChartPropProvider->getMinMaxLine();
+    if( xStockPropSet.is() )
+    {
+        pFS->startElement( FSNS( XML_c, XML_hiLowLines ),
+                FSEND );
+        exportShapeProps( xStockPropSet );
+        pFS->endElement( FSNS( XML_c, XML_hiLowLines ) );
+    }
+}
+
 void ChartExport::exportUpDownBars( Reference< chart2::XChartType > xChartType)
 {
     FSHelperPtr pFS = GetFS();
commit e1ace08771da5b32ed9801d4ee6166c619aae8fa
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Dec 13 20:30:13 2013 +0100

    fix an OOXML validation error with the last patch
    
    Change-Id: I1aa1b2675a23b124666fce25807ddf65dfdcb8d5

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 095203f..fddaf8e 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1246,13 +1246,13 @@ void ChartExport::exportLineChart( Reference< chart2::XChartType > xChartType )
 
     if( !mbIs3DChart )
     {
+        exportUpDownBars(xChartType);
         const char* marker = nSymbolType == ::com::sun::star::chart::ChartSymbolType::NONE? "0":"1";
         pFS->singleElement( FSNS( XML_c, XML_marker ),
                 XML_val, marker,
                 FSEND );
     }
 
-    exportUpDownBars(xChartType);
     exportAxesId( nAttachedAxis );
 
     pFS->endElement( FSNS( XML_c, nTypeId ) );
commit 077213c23e377fd7398b35b88050ac173d22d268
Author: YogeshBharate <yogesh.bharate at synerzip.com>
Date:   Wed Dec 11 18:01:27 2013 +0530

    fdo#72345: Fixed for Charts - Up Down Bars are missing after Round trip
    
    UpDownBars missing after Roundtrip in case of LineChart.
    
    Change-Id: Ia3e574aefb9436a2f5b2b88e8824625d09d35c38

diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 237b410..833b90a 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -130,6 +130,7 @@ private:
     void exportScatterChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
     void exportStockChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
     void exportSuffaceChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
+    void exportUpDownBars(com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
 
     void exportSeries( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType, sal_Int32& nAttachedAxis );
     void exportCandleStickSeries(
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 9655f3e..095203f 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1252,6 +1252,7 @@ void ChartExport::exportLineChart( Reference< chart2::XChartType > xChartType )
                 FSEND );
     }
 
+    exportUpDownBars(xChartType);
     exportAxesId( nAttachedAxis );
 
     pFS->endElement( FSNS( XML_c, nTypeId ) );
@@ -1355,38 +1356,57 @@ void ChartExport::exportStockChart( Reference< chart2::XChartType > xChartType )
             exportShapeProps( xStockPropSet );
             pFS->endElement( FSNS( XML_c, XML_hiLowLines ) );
         }
-        // stock updownbar
+        exportUpDownBars(xChartType);
+    }
+
+    exportAxesId( nAttachedAxis );
+
+    pFS->endElement( FSNS( XML_c, XML_stockChart ) );
+}
+
+void ChartExport::exportUpDownBars( Reference< chart2::XChartType > xChartType)
+{
+    FSHelperPtr pFS = GetFS();
+    // export the chart property
+    Reference< ::com::sun::star::chart::XStatisticDisplay > xChartPropProvider( mxDiagram, uno::UNO_QUERY );
+    if(xChartPropProvider.is())
+    {
+        Reference< beans::XPropertySet > xChartPropSet = xChartPropProvider->getMinMaxLine();
+        //  updownbar
         pFS->startElement( FSNS( XML_c, XML_upDownBars ),
                 FSEND );
         // TODO: gapWidth
         sal_Int32 nGapWidth = 150;
         pFS->singleElement( FSNS( XML_c, XML_gapWidth ),
-            XML_val, I32S( nGapWidth ),
-            FSEND );
+                XML_val, I32S( nGapWidth ),
+                    FSEND );
 
-        xStockPropSet = xStockPropProvider->getUpBar();
-        if( xStockPropSet.is() )
+        xChartPropSet = xChartPropProvider->getUpBar();
+        if( xChartPropSet.is() )
         {
             pFS->startElement( FSNS( XML_c, XML_upBars ),
-                FSEND );
-            exportShapeProps( xStockPropSet );
+                    FSEND );
+            // For Linechart with UpDownBars, spPr is not getting imported
+            // so no need to call the exportShapeProps() for LineChart
+            if(xChartType->getChartType().equals("com.sun.star.chart2.CandleStickChartType"))
+            {
+                exportShapeProps(xChartPropSet);
+            }
             pFS->endElement( FSNS( XML_c, XML_upBars ) );
         }
-
-        xStockPropSet = xStockPropProvider->getDownBar();
-        if( xStockPropSet.is() )
+        xChartPropSet = xChartPropProvider->getDownBar();
+        if( xChartPropSet.is() )
         {
             pFS->startElement( FSNS( XML_c, XML_downBars ),
-                FSEND );
-            exportShapeProps( xStockPropSet );
+                    FSEND );
+            if(xChartType->getChartType().equals("com.sun.star.chart2.CandleStickChartType"))
+            {
+                exportShapeProps(xChartPropSet);
+            }
             pFS->endElement( FSNS( XML_c, XML_downBars ) );
         }
         pFS->endElement( FSNS( XML_c, XML_upDownBars ) );
     }
-
-    exportAxesId( nAttachedAxis );
-
-    pFS->endElement( FSNS( XML_c, XML_stockChart ) );
 }
 
 void ChartExport::exportSuffaceChart( Reference< chart2::XChartType > xChartType )


More information about the Libreoffice-commits mailing list