summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-08-01 21:39:49 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-08-04 12:25:56 -0400
commit4a8f2431718f99de6fd9ee3461d703d007261c03 (patch)
tree86b2eb062346b8eedd5b101890f7866daa802751
parent279fc1a2ae2ae8d51768e438787c3bc9a59df55e (diff)
bnc#886540: Default chart background for pptx docs should be transparent.
Charts in docx and xlsx OTOH use solid white as the default fill style. Change-Id: Ic4351fe65cabc12d60214b67c7026a317841f2c7
-rw-r--r--include/oox/helper/graphichelper.hxx3
-rw-r--r--oox/source/drawingml/chart/chartspaceconverter.cxx8
-rw-r--r--oox/source/helper/graphichelper.cxx5
-rw-r--r--oox/source/ppt/pptimport.cxx6
4 files changed, 21 insertions, 1 deletions
diff --git a/include/oox/helper/graphichelper.hxx b/include/oox/helper/graphichelper.hxx
index feb062973ce5..37c882a258ae 100644
--- a/include/oox/helper/graphichelper.hxx
+++ b/include/oox/helper/graphichelper.hxx
@@ -24,6 +24,7 @@
#include <map>
#include <rtl/ustring.hxx>
#include <com/sun/star/awt/DeviceInfo.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <oox/helper/binarystreambase.hxx>
#include <oox/helper/storagebase.hxx>
@@ -75,6 +76,8 @@ public:
/** Derived classes may implement to resolve a palette index to an RGB color. */
virtual sal_Int32 getPaletteColor( sal_Int32 nPaletteIdx ) const;
+ virtual css::drawing::FillStyle getDefaultChartAreaFillStyle() const;
+
// Device info and device dependent unit conversion -----------------------
/** Returns information about the output device. */
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index b0b5f9cca92c..f29016caa80c 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -25,8 +25,10 @@
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/chart/chartconverter.hxx"
+#include <oox/helper/graphichelper.hxx>
#include "drawingml/chart/chartdrawingfragment.hxx"
#include "drawingml/chart/chartspacemodel.hxx"
#include "drawingml/chart/plotareaconverter.hxx"
@@ -86,8 +88,12 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
{
}
- // formatting of the chart background
+ // formatting of the chart background. The default fill style varies with applications.
PropertySet aBackPropSet( getChartDocument()->getPageBackground() );
+ aBackPropSet.setProperty(
+ PROP_FillStyle,
+ uno::makeAny(getFilter().getGraphicHelper().getDefaultChartAreaFillStyle()));
+
if( mrModel.mxShapeProp.is() )
{
getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
index 11dc2da83ca0..180df3ca5e81 100644
--- a/oox/source/helper/graphichelper.cxx
+++ b/oox/source/helper/graphichelper.cxx
@@ -151,6 +151,11 @@ sal_Int32 GraphicHelper::getPaletteColor( sal_Int32 /*nPaletteIdx*/ ) const
return API_RGB_TRANSPARENT;
}
+drawing::FillStyle GraphicHelper::getDefaultChartAreaFillStyle() const
+{
+ return drawing::FillStyle_SOLID;
+}
+
// Device info and device dependent unit conversion ---------------------------
sal_Int32 GraphicHelper::convertScreenPixelXToHmm( double fPixelX ) const
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 62ed37f0a096..aaaa9fba1f11 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -189,6 +189,7 @@ class PptGraphicHelper : public GraphicHelper
public:
explicit PptGraphicHelper( const PowerPointImport& rFilter );
virtual sal_Int32 getSchemeColor( sal_Int32 nToken ) const SAL_OVERRIDE;
+ virtual drawing::FillStyle getDefaultChartAreaFillStyle() const;
private:
const PowerPointImport& mrFilter;
};
@@ -204,6 +205,11 @@ sal_Int32 PptGraphicHelper::getSchemeColor( sal_Int32 nToken ) const
return mrFilter.getSchemeColor( nToken );
}
+drawing::FillStyle PptGraphicHelper::getDefaultChartAreaFillStyle() const
+{
+ return drawing::FillStyle_NONE;
+}
+
} // namespace
GraphicHelper* PowerPointImport::implCreateGraphicHelper() const