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

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


 include/oox/export/chartexport.hxx                |    3 +
 oox/source/drawingml/chart/typegroupconverter.cxx |    1 
 oox/source/export/chartexport.cxx                 |   48 +++++++++++++++++++++-
 3 files changed, 51 insertions(+), 1 deletion(-)

New commits:
commit 7c4461a3cc5af47803a2197e5986e9fd38e54821
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Apr 15 03:25:55 2015 +0200

    import marker color from OOXML, related tdf#81407
    
    Change-Id: Ie416d757b73e99836d14b7f24a5cb4b370284d8c
    (cherry picked from commit 30936e3f6f8242950526ce9a0d02971a881b7910)

diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index 3ca777f..cc05e7d 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -485,6 +485,7 @@ void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSym
         {
             Color aFillColor = xShapeProps->getFillProperties().maFillColor;
             aSymbol.FillColor = aFillColor.getColor(getFilter().getGraphicHelper());
+            rPropSet.setProperty(PROP_Color, aSymbol.FillColor);
         }
 
         // set the property
commit d7bc265531f863ffadea987b0077f6f2f4ad04eb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Apr 15 03:02:01 2015 +0200

    export marker color correctly, tdf#81407
    
    Change-Id: Iebc3d87642c93fcdecddd6332fd57b7fdfb2d337
    (cherry picked from commit 96c05f82cd4df35505497bc29d96c8a250072db0)

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 39d082a..acb4f1f 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3020,7 +3020,12 @@ void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries)
 
     pFS->startElement( FSNS( XML_c, XML_spPr ),
             FSEND );
-    WriteSolidFill(aSymbol.FillColor);
+
+    util::Color aColor = aSymbol.FillColor;
+    if (GetProperty(xPropSet, "Color"))
+        mAny >>= aColor;
+
+    WriteSolidFill(aColor);
     pFS->endElement( FSNS( XML_c, XML_spPr ) );
 
     pFS->endElement( FSNS( XML_c, XML_marker ) );
commit fa125246f444b49073c8039a251048c45bd12c48
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 8d570ec..aaa0ea9 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -181,6 +181,9 @@ private:
     void exportView3D();
     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 a6b1ad1..39d082a 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -45,6 +45,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>
@@ -901,9 +902,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 d0b06ecdfed2e460cc63a96f70470c52b9b97b69
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 0929096..a6b1ad1 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -856,7 +856,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