summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-02-18 20:16:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-02-19 09:34:17 +0000
commitf2cf2212a6a9974da558e97be54b97b49ca039f3 (patch)
tree18c76bd56c35916f396f35792fd82c8adae07bc6
parent010cd7e81ef0f8c524ff764eed80e746caa1d94c (diff)
implement fill based on style also for chart area, tdf#89451
Change-Id: I7b488e222cd44e75d1e0ff7f8e545e9399f418b5 better way to set default for chart area fill style, related tdf#89451 Change-Id: Iee7fea0f55cf54d43a349b6cc0ffa25995069e40 no need for that anymore Change-Id: I53002c0b97da66c44429b5ace0fc709b5e8a325f Reviewed-on: https://gerrit.libreoffice.org/14547 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/oox/helper/graphichelper.hxx2
-rw-r--r--oox/source/drawingml/chart/chartspaceconverter.cxx9
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx16
-rw-r--r--oox/source/helper/graphichelper.cxx4
-rw-r--r--oox/source/ppt/pptimport.cxx6
5 files changed, 22 insertions, 15 deletions
diff --git a/include/oox/helper/graphichelper.hxx b/include/oox/helper/graphichelper.hxx
index 37c882a258ae..e8be96cc9236 100644
--- a/include/oox/helper/graphichelper.hxx
+++ b/include/oox/helper/graphichelper.hxx
@@ -76,7 +76,7 @@ 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;
+ virtual sal_Int32 getDefaultChartAreaFillStyle() const;
// Device info and device dependent unit conversion -----------------------
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index 37de52d23832..56a10ae8796b 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -76,14 +76,7 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
// 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 );
- }
+ getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
// convert plot area (container of all chart type groups)
PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() );
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index 3b49a639369a..df0c5c11f378 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -34,6 +34,7 @@
#include "oox/drawingml/theme.hxx"
#include "drawingml/chart/chartspacemodel.hxx"
#include "oox/helper/modelobjecthelper.hxx"
+#include <oox/helper/graphichelper.hxx>
namespace oox {
namespace drawingml {
@@ -167,6 +168,14 @@ static const AutoFormatEntry spNoFormats[] =
AUTOFORMAT_END()
};
+static const AutoFormatEntry spChartSpaceFill[] =
+{
+ AUTOFORMAT_COLOR( 1, 32, THEMED_STYLE_SUBTLE, XML_bg1 ),
+ AUTOFORMAT_COLOR( 33, 40, THEMED_STYLE_SUBTLE, XML_lt1 ),
+ AUTOFORMAT_COLOR( 41, 48, THEMED_STYLE_SUBTLE, XML_dk1 ),
+ AUTOFORMAT_END()
+};
+
static const AutoFormatEntry spDataTableLines[] =
{
AUTOFORMAT_COLORMOD( 1, 32, THEMED_STYLE_SUBTLE, XML_tx1, XML_tint, 75000 ),
@@ -536,7 +545,7 @@ struct ObjectTypeFormatEntry
static const ObjectTypeFormatEntry spObjTypeFormatEntries[] =
{
// object type property info auto text auto line auto fill auto effect
- TYPEFORMAT_FRAME( OBJECTTYPE_CHARTSPACE, &saCommonPropInfo, 0, spNoFormats, spNoFormats, 0 /* eq to Ch2 */ ),
+ TYPEFORMAT_FRAME( OBJECTTYPE_CHARTSPACE, &saCommonPropInfo, 0, spNoFormats, spChartSpaceFill, 0 /* eq to Ch2 */ ),
TYPEFORMAT_FRAME( OBJECTTYPE_CHARTTITLE, &saCommonPropInfo, spChartTitleTexts, 0 /* eq to Ch2 */, 0 /* eq to Ch2 */, 0 /* eq to Ch2 */ ),
TYPEFORMAT_FRAME( OBJECTTYPE_LEGEND, &saCommonPropInfo, spOtherTexts, spNoFormats, spNoFormats, 0 /* eq to Ch2 */ ),
TYPEFORMAT_FRAME( OBJECTTYPE_PLOTAREA2D, &saCommonPropInfo, 0, 0 /* eq to Ch2 */, spPlotArea2dFills, 0 /* eq to Ch2 */ ),
@@ -869,6 +878,11 @@ FillFormatter::FillFormatter( ObjectFormatterData& rData, const AutoFormatEntry*
if( const Theme* pTheme = mrData.mrFilter.getCurrentTheme() )
if( const FillProperties* pFillProps = pTheme->getFillStyle( pAutoFormatEntry->mnThemedIdx ) )
*mxAutoFill = *pFillProps;
+
+ if (eObjType == OBJECTTYPE_CHARTSPACE)
+ {
+ mxAutoFill->moFillType = rData.mrFilter.getGraphicHelper().getDefaultChartAreaFillStyle();
+ }
}
}
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
index 0638ffe6350b..6687301590c8 100644
--- a/oox/source/helper/graphichelper.cxx
+++ b/oox/source/helper/graphichelper.cxx
@@ -152,9 +152,9 @@ sal_Int32 GraphicHelper::getPaletteColor( sal_Int32 /*nPaletteIdx*/ ) const
return API_RGB_TRANSPARENT;
}
-drawing::FillStyle GraphicHelper::getDefaultChartAreaFillStyle() const
+sal_Int32 GraphicHelper::getDefaultChartAreaFillStyle() const
{
- return drawing::FillStyle_SOLID;
+ return XML_solidFill;
}
// Device info and device dependent unit conversion ---------------------------
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 328d16a2f47e..fc29c1ce277b 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -193,7 +193,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;
+ virtual sal_Int32 getDefaultChartAreaFillStyle() const SAL_OVERRIDE;
private:
const PowerPointImport& mrFilter;
};
@@ -209,9 +209,9 @@ sal_Int32 PptGraphicHelper::getSchemeColor( sal_Int32 nToken ) const
return mrFilter.getSchemeColor( nToken );
}
-drawing::FillStyle PptGraphicHelper::getDefaultChartAreaFillStyle() const
+sal_Int32 PptGraphicHelper::getDefaultChartAreaFillStyle() const
{
- return drawing::FillStyle_NONE;
+ return XML_noFill;
}
} // namespace