From e9f77854e20433287ca32569af01eb1508ca51a5 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 1 Aug 2014 21:39:49 -0400 Subject: bnc#886540: Default chart background for pptx docs should be transparent. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Charts in docx and xlsx OTOH use solid white as the default fill style. (cherry picked from commit 4a8f2431718f99de6fd9ee3461d703d007261c03) (cherry picked from commit 013744a5b475e151ca0918565fb369e22dfbc1db) Conflicts: oox/source/drawingml/chart/chartspaceconverter.cxx Change-Id: Ic4351fe65cabc12d60214b67c7026a317841f2c7 Reviewed-on: https://gerrit.libreoffice.org/10736 Reviewed-by: Matúš Kukan Tested-by: Matúš Kukan --- oox/source/drawingml/chart/chartspaceconverter.cxx | 8 +++++++- oox/source/helper/graphichelper.cxx | 5 +++++ oox/source/ppt/pptimport.cxx | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'oox/source') diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 2238fe2d10bf..b63bfe99fa2d 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -25,12 +25,14 @@ #include #include #include +#include #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/chart/chartconverter.hxx" #include "oox/drawingml/chart/chartdrawingfragment.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" #include "oox/drawingml/chart/plotareaconverter.hxx" #include "oox/drawingml/chart/titleconverter.hxx" +#include using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; @@ -90,8 +92,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 135a91c06c0f..5281da2ec006 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -158,6 +158,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 --------------------------- const awt::DeviceInfo& GraphicHelper::getDeviceInfo() const diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index c3aa2208beeb..df15d77b857b 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -190,6 +190,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 SAL_OVERRIDE; private: const PowerPointImport& mrFilter; }; @@ -205,6 +206,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 -- cgit v1.2.3