Kaydet (Commit) 4a8f2431 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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
üst 279fc1a2
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <map> #include <map>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <com/sun/star/awt/DeviceInfo.hpp> #include <com/sun/star/awt/DeviceInfo.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
#include <oox/helper/binarystreambase.hxx> #include <oox/helper/binarystreambase.hxx>
#include <oox/helper/storagebase.hxx> #include <oox/helper/storagebase.hxx>
...@@ -75,6 +76,8 @@ public: ...@@ -75,6 +76,8 @@ public:
/** Derived classes may implement to resolve a palette index to an RGB color. */ /** Derived classes may implement to resolve a palette index to an RGB color. */
virtual sal_Int32 getPaletteColor( sal_Int32 nPaletteIdx ) const; virtual sal_Int32 getPaletteColor( sal_Int32 nPaletteIdx ) const;
virtual css::drawing::FillStyle getDefaultChartAreaFillStyle() const;
// Device info and device dependent unit conversion ----------------------- // Device info and device dependent unit conversion -----------------------
/** Returns information about the output device. */ /** Returns information about the output device. */
......
...@@ -25,8 +25,10 @@ ...@@ -25,8 +25,10 @@
#include <com/sun/star/chart2/XTitled.hpp> #include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include "oox/core/xmlfilterbase.hxx" #include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/chart/chartconverter.hxx" #include "oox/drawingml/chart/chartconverter.hxx"
#include <oox/helper/graphichelper.hxx>
#include "drawingml/chart/chartdrawingfragment.hxx" #include "drawingml/chart/chartdrawingfragment.hxx"
#include "drawingml/chart/chartspacemodel.hxx" #include "drawingml/chart/chartspacemodel.hxx"
#include "drawingml/chart/plotareaconverter.hxx" #include "drawingml/chart/plotareaconverter.hxx"
...@@ -86,8 +88,12 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern ...@@ -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() ); PropertySet aBackPropSet( getChartDocument()->getPageBackground() );
aBackPropSet.setProperty(
PROP_FillStyle,
uno::makeAny(getFilter().getGraphicHelper().getDefaultChartAreaFillStyle()));
if( mrModel.mxShapeProp.is() ) if( mrModel.mxShapeProp.is() )
{ {
getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE ); getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
......
...@@ -151,6 +151,11 @@ sal_Int32 GraphicHelper::getPaletteColor( sal_Int32 /*nPaletteIdx*/ ) const ...@@ -151,6 +151,11 @@ sal_Int32 GraphicHelper::getPaletteColor( sal_Int32 /*nPaletteIdx*/ ) const
return API_RGB_TRANSPARENT; return API_RGB_TRANSPARENT;
} }
drawing::FillStyle GraphicHelper::getDefaultChartAreaFillStyle() const
{
return drawing::FillStyle_SOLID;
}
// Device info and device dependent unit conversion --------------------------- // Device info and device dependent unit conversion ---------------------------
sal_Int32 GraphicHelper::convertScreenPixelXToHmm( double fPixelX ) const sal_Int32 GraphicHelper::convertScreenPixelXToHmm( double fPixelX ) const
......
...@@ -189,6 +189,7 @@ class PptGraphicHelper : public GraphicHelper ...@@ -189,6 +189,7 @@ class PptGraphicHelper : public GraphicHelper
public: public:
explicit PptGraphicHelper( const PowerPointImport& rFilter ); explicit PptGraphicHelper( const PowerPointImport& rFilter );
virtual sal_Int32 getSchemeColor( sal_Int32 nToken ) const SAL_OVERRIDE; virtual sal_Int32 getSchemeColor( sal_Int32 nToken ) const SAL_OVERRIDE;
virtual drawing::FillStyle getDefaultChartAreaFillStyle() const;
private: private:
const PowerPointImport& mrFilter; const PowerPointImport& mrFilter;
}; };
...@@ -204,6 +205,11 @@ sal_Int32 PptGraphicHelper::getSchemeColor( sal_Int32 nToken ) const ...@@ -204,6 +205,11 @@ sal_Int32 PptGraphicHelper::getSchemeColor( sal_Int32 nToken ) const
return mrFilter.getSchemeColor( nToken ); return mrFilter.getSchemeColor( nToken );
} }
drawing::FillStyle PptGraphicHelper::getDefaultChartAreaFillStyle() const
{
return drawing::FillStyle_NONE;
}
} // namespace } // namespace
GraphicHelper* PowerPointImport::implCreateGraphicHelper() const GraphicHelper* PowerPointImport::implCreateGraphicHelper() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment