Blame SOURCES/0080-bnc-886540-Default-chart-background-for-pptx-docs-sh.patch

f085be
From feed03c590232659e6278ed7eb4137c479543b86 Mon Sep 17 00:00:00 2001
f085be
From: Kohei Yoshida <kohei.yoshida@collabora.com>
f085be
Date: Fri, 1 Aug 2014 21:39:49 -0400
f085be
Subject: [PATCH 080/137] bnc#886540: Default chart background for pptx docs
f085be
 should be transparent.
f085be
MIME-Version: 1.0
f085be
Content-Type: text/plain; charset=UTF-8
f085be
Content-Transfer-Encoding: 8bit
f085be
f085be
Charts in docx and xlsx OTOH use solid white as the default fill style.
f085be
f085be
(cherry picked from commit 4a8f2431718f99de6fd9ee3461d703d007261c03)
f085be
f085be
Conflicts:
f085be
	oox/source/drawingml/chart/chartspaceconverter.cxx
f085be
	oox/source/ppt/pptimport.cxx
f085be
f085be
Change-Id: Ic4351fe65cabc12d60214b67c7026a317841f2c7
f085be
Reviewed-on: https://gerrit.libreoffice.org/10737
f085be
Reviewed-by: Matúš Kukan <matus.kukan@collabora.com>
f085be
Tested-by: Matúš Kukan <matus.kukan@collabora.com>
f085be
---
f085be
 include/oox/helper/graphichelper.hxx               | 3 +++
f085be
 oox/source/drawingml/chart/chartspaceconverter.cxx | 9 ++++++++-
f085be
 oox/source/helper/graphichelper.cxx                | 5 +++++
f085be
 oox/source/ppt/pptimport.cxx                       | 6 ++++++
f085be
 4 files changed, 22 insertions(+), 1 deletion(-)
f085be
f085be
diff --git a/include/oox/helper/graphichelper.hxx b/include/oox/helper/graphichelper.hxx
f085be
index b96e993..9e90531 100644
f085be
--- a/include/oox/helper/graphichelper.hxx
f085be
+++ b/include/oox/helper/graphichelper.hxx
f085be
@@ -24,6 +24,7 @@
f085be
 #include <map>
f085be
 #include <rtl/ustring.hxx>
f085be
 #include <com/sun/star/awt/DeviceInfo.hpp>
f085be
+#include <com/sun/star/drawing/FillStyle.hpp>
f085be
 #include <com/sun/star/uno/Reference.hxx>
f085be
 #include <oox/helper/binarystreambase.hxx>
f085be
 #include <oox/helper/storagebase.hxx>
f085be
@@ -75,6 +76,8 @@ public:
f085be
     /** Derived classes may implement to resolve a palette index to an RGB color. */
f085be
     virtual sal_Int32   getPaletteColor( sal_Int32 nPaletteIdx ) const;
f085be
 
f085be
+    virtual css::drawing::FillStyle getDefaultChartAreaFillStyle() const;
f085be
+
f085be
     // Device info and device dependent unit conversion -----------------------
f085be
 
f085be
     /** Returns information about the output device. */
f085be
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
f085be
index db04215..eeba446 100644
f085be
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
f085be
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
f085be
@@ -25,12 +25,14 @@
f085be
 #include <com/sun/star/chart2/XTitled.hpp>
f085be
 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
f085be
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
f085be
+#include <com/sun/star/drawing/FillStyle.hpp>
f085be
 #include "oox/core/xmlfilterbase.hxx"
f085be
 #include "oox/drawingml/chart/chartconverter.hxx"
f085be
 #include "oox/drawingml/chart/chartdrawingfragment.hxx"
f085be
 #include "oox/drawingml/chart/chartspacemodel.hxx"
f085be
 #include "oox/drawingml/chart/plotareaconverter.hxx"
f085be
 #include "oox/drawingml/chart/titleconverter.hxx"
f085be
+#include <oox/helper/graphichelper.hxx>
f085be
 
f085be
 using namespace ::com::sun::star;
f085be
 using ::com::sun::star::uno::Reference;
f085be
@@ -90,8 +92,13 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
f085be
     {
f085be
     }
f085be
 
f085be
-    // formatting of the chart background
f085be
+    // formatting of the chart background.  The default fill style varies with applications.
f085be
     PropertySet aBackPropSet( getChartDocument()->getPageBackground() );
f085be
+
f085be
+    aBackPropSet.setProperty(
f085be
+        PROP_FillStyle,
f085be
+        uno::makeAny(getFilter().getGraphicHelper().getDefaultChartAreaFillStyle()));
f085be
+
f085be
     getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
f085be
 
f085be
     // convert plot area (container of all chart type groups)
f085be
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
f085be
index 5cb2b69..e40f019 100644
f085be
--- a/oox/source/helper/graphichelper.cxx
f085be
+++ b/oox/source/helper/graphichelper.cxx
f085be
@@ -158,6 +158,11 @@ sal_Int32 GraphicHelper::getPaletteColor( sal_Int32 /*nPaletteIdx*/ ) const
f085be
     return API_RGB_TRANSPARENT;
f085be
 }
f085be
 
f085be
+drawing::FillStyle GraphicHelper::getDefaultChartAreaFillStyle() const
f085be
+{
f085be
+    return drawing::FillStyle_SOLID;
f085be
+}
f085be
+
f085be
 // Device info and device dependent unit conversion ---------------------------
f085be
 
f085be
 const awt::DeviceInfo& GraphicHelper::getDeviceInfo() const
f085be
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
f085be
index fc9dadf..d294b79 100644
f085be
--- a/oox/source/ppt/pptimport.cxx
f085be
+++ b/oox/source/ppt/pptimport.cxx
f085be
@@ -185,6 +185,7 @@ class PptGraphicHelper : public GraphicHelper
f085be
 public:
f085be
     explicit            PptGraphicHelper( const PowerPointImport& rFilter );
f085be
     virtual sal_Int32   getSchemeColor( sal_Int32 nToken ) const;
f085be
+    virtual drawing::FillStyle getDefaultChartAreaFillStyle() const;
f085be
 private:
f085be
     const PowerPointImport& mrFilter;
f085be
 };
f085be
@@ -200,6 +201,11 @@ sal_Int32 PptGraphicHelper::getSchemeColor( sal_Int32 nToken ) const
f085be
     return mrFilter.getSchemeColor( nToken );
f085be
 }
f085be
 
f085be
+drawing::FillStyle PptGraphicHelper::getDefaultChartAreaFillStyle() const
f085be
+{
f085be
+    return drawing::FillStyle_NONE;
f085be
+}
f085be
+
f085be
 } // namespace
f085be
 
f085be
 GraphicHelper* PowerPointImport::implCreateGraphicHelper() const
f085be
-- 
f085be
1.9.3
f085be