[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 2 commits - include/oox oox/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Apr 15 00:28:09 PDT 2015


 include/oox/export/chartexport.hxx |    3 ++
 oox/source/export/chartexport.cxx  |   41 +++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)

New commits:
commit 84a63e099c97a721715de1710dc396294426bb6c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Apr 15 00:21:21 2015 +0200

    export missing value treatment to OOXML
    
    Change-Id: I1a448e9c954a3851fe3590a0fae73ed5b27555f0
    (cherry picked from commit e68ceaec43f0c0ff326064642072bb8f904e7e8a)

diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 524c61d..fb32b0c 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -171,6 +171,9 @@ private:
     void exportView3D();
     sal_Bool isDeep3dChart();
 
+    void exportMissingValueTreatment(com::sun::star::uno::Reference<
+            com::sun::star::beans::XPropertySet> xPropSet);
+
 public:
 
     ChartExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 0b63d3e..be38415 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -44,6 +44,7 @@
 #include <com/sun/star/chart/ChartSolidType.hpp>
 #include <com/sun/star/chart/DataLabelPlacement.hpp>
 #include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/chart/MissingValueTreatment.hpp>
 
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/chart2/XDiagram.hpp>
@@ -845,9 +846,44 @@ void ChartExport::exportChart( Reference< ::com::sun::star::chart::XChartDocumen
             XML_val, "1",
             FSEND );
 
+    exportMissingValueTreatment(Reference<beans::XPropertySet>(mxDiagram, uno::UNO_QUERY));
+
     pFS->endElement( FSNS( XML_c, XML_chart ) );
 }
 
+void ChartExport::exportMissingValueTreatment(uno::Reference<beans::XPropertySet> xPropSet)
+{
+    if (!xPropSet.is())
+        return;
+
+    sal_Int32 nVal = 0;
+    uno::Any aAny = xPropSet->getPropertyValue("MissingValueTreatment");
+    if (!(aAny >>= nVal))
+        return;
+
+    const char* pVal = NULL;
+    switch (nVal)
+    {
+        case cssc::MissingValueTreatment::LEAVE_GAP:
+            pVal = "gap";
+        break;
+        case cssc::MissingValueTreatment::USE_ZERO:
+            pVal = "zero";
+        break;
+        case cssc::MissingValueTreatment::CONTINUE:
+            pVal = "span";
+        break;
+        default:
+            SAL_WARN("oox", "unknown MissingValueTreatment value");
+        break;
+    }
+
+    FSHelperPtr pFS = GetFS();
+    pFS->singleElement( FSNS(XML_c, XML_dispBlanksAs),
+            XML_val, pVal,
+            FSEND);
+}
+
 void ChartExport::exportLegend( Reference< ::com::sun::star::chart::XChartDocument > rChartDoc )
 {
     FSHelperPtr pFS = GetFS();
commit 063882a18477abc045719353ac9fbd85763de508
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 14 23:07:22 2015 +0200

    we use the correct OOXML default value now
    
    Change-Id: I1aad3e40ad61a1397b619bdc6e0f578e2c9c141e
    (cherry picked from commit ec2c8a602ecb8664b24d77e6ca6af17bf59d211c)

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 6be487f..0b63d3e 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -800,7 +800,12 @@ void ChartExport::exportChart( Reference< ::com::sun::star::chart::XChartDocumen
     {
         Reference< drawing::XShape > xShape = rChartDoc->getTitle();
         if( xShape.is() )
+        {
             exportTitle( xShape );
+            pFS->singleElement( FSNS(XML_c, XML_autoTitleDeleted),
+                    XML_val, "0",
+                    FSEND);
+        }
     }
     InitPlotArea( );
     if( mbIs3DChart )


More information about the Libreoffice-commits mailing list