From 61d79dd740958186c4a4344e18eaeb5b2c139c91 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 2 Mar 2018 11:43:46 +0200 Subject: use more Color in oox Change-Id: I8fdc6742de5af9101e246411e7208650bae2c4c7 Reviewed-on: https://gerrit.libreoffice.org/50617 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/oox/drawingml/clrscheme.hxx | 9 +++++---- include/oox/drawingml/color.hxx | 10 ++++++---- include/oox/drawingml/shapepropertymap.hxx | 5 +++++ 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'include/oox/drawingml') diff --git a/include/oox/drawingml/clrscheme.hxx b/include/oox/drawingml/clrscheme.hxx index ccf918d7ba74..b37b6659a443 100644 --- a/include/oox/drawingml/clrscheme.hxx +++ b/include/oox/drawingml/clrscheme.hxx @@ -29,6 +29,7 @@ #include #include #include +#include namespace oox { namespace drawingml { @@ -78,15 +79,15 @@ typedef std::shared_ptr< ClrMap > ClrMapPtr; class OOX_DLLPUBLIC ClrScheme { - std::vector< std::pair > maClrScheme; + std::vector< std::pair > maClrScheme; public: - bool getColor( sal_Int32 nSchemeClrToken, sal_Int32& rColor ) const; - void setColor( sal_Int32 nSchemeClrToken, sal_Int32 nColor ); + bool getColor( sal_Int32 nSchemeClrToken, ::Color& rColor ) const; + void setColor( sal_Int32 nSchemeClrToken, ::Color nColor ); bool getColorByIndex(size_t nIndex, - sal_Int32& rColor) const; + ::Color& rColor) const; }; typedef std::shared_ptr< ClrScheme > ClrSchemePtr; diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx index 2ba97d49cf36..94d9050c5b42 100644 --- a/include/oox/drawingml/color.hxx +++ b/include/oox/drawingml/color.hxx @@ -28,6 +28,7 @@ #include #include #include +#include namespace oox { class GraphicHelper; } @@ -41,14 +42,15 @@ public: Color(); /** Returns the RGB value for the passed DrawingML color token, or nDefaultRgb on error. */ - static sal_Int32 getDmlPresetColor( sal_Int32 nToken, sal_Int32 nDefaultRgb ); + static ::Color getDmlPresetColor( sal_Int32 nToken, ::Color nDefaultRgb ); /** Returns the RGB value for the passed VML color token, or nDefaultRgb on error. */ - static sal_Int32 getVmlPresetColor( sal_Int32 nToken, sal_Int32 nDefaultRgb ); + static ::Color getVmlPresetColor( sal_Int32 nToken, ::Color nDefaultRgb ); /** Sets the color to unused state. */ void setUnused(); /** Sets an RGB value (hexadecimal RRGGBB) from the a:srgbClr element. */ void setSrgbClr( sal_Int32 nRgb ); + void setSrgbClr( ::Color nRgb ); /** Sets the percentual RGB values from the a:scrgbClr element. */ void setScrgbClr( sal_Int32 nR, sal_Int32 nG, sal_Int32 nB ); /** Sets the HSL values from the a:hslClr element. */ @@ -84,7 +86,7 @@ public: bool isPlaceHolder() const { return meMode == COLOR_PH; } /** Returns the final RGB color value. @param nPhClr Actual color for the phClr placeholder color used in theme style lists. */ - sal_Int32 getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const; + ::Color getColor( const GraphicHelper& rGraphicHelper, ::Color nPhClr = API_RGB_TRANSPARENT ) const; /** Returns true, if the color is transparent. */ bool hasTransparency() const; @@ -103,7 +105,7 @@ public: private: /** Internal helper for getColor(). */ - void setResolvedRgb( sal_Int32 nRgb ) const; + void setResolvedRgb( ::Color nRgb ) const; /** Converts the color components to RGB values. */ void toRgb() const; diff --git a/include/oox/drawingml/shapepropertymap.hxx b/include/oox/drawingml/shapepropertymap.hxx index 86dbd569ebc7..8ba077ea3d27 100644 --- a/include/oox/drawingml/shapepropertymap.hxx +++ b/include/oox/drawingml/shapepropertymap.hxx @@ -29,6 +29,7 @@ #include #include #include +#include namespace oox { class ModelObjectHelper; } @@ -125,6 +126,10 @@ public: { return setAnyProperty(ePropId, css::uno::Any(rValue)); } + bool setProperty(ShapeProperty ePropId, const ::Color& rValue) + { + return setAnyProperty(ePropId, css::uno::makeAny(rValue)); + } using PropertyMap::setAnyProperty; using PropertyMap::setProperty; -- cgit v1.2.3