[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - include/oox oox/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Thu Feb 19 01:34:48 PST 2015


 include/oox/helper/graphichelper.hxx               |    2 +-
 oox/source/drawingml/chart/chartspaceconverter.cxx |    9 +--------
 oox/source/drawingml/chart/objectformatter.cxx     |   16 +++++++++++++++-
 oox/source/helper/graphichelper.cxx                |    4 ++--
 oox/source/ppt/pptimport.cxx                       |    6 +++---
 5 files changed, 22 insertions(+), 15 deletions(-)

New commits:
commit f2cf2212a6a9974da558e97be54b97b49ca039f3
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Feb 18 20:16:43 2015 +0100

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/oox/helper/graphichelper.hxx b/include/oox/helper/graphichelper.hxx
index 37c882a..e8be96c 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 37de52d..56a10ae 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 3b49a63..df0c5c1 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 0638ffe..668730159 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 328d16a..fc29c1c 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


More information about the Libreoffice-commits mailing list