diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-02 11:43:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 07:35:01 +0100 |
commit | 61d79dd740958186c4a4344e18eaeb5b2c139c91 (patch) | |
tree | abea71a038352572871ea1fb2a9c40d2f196ddd6 /include/oox/drawingml | |
parent | 04c9cb68dffa2af15661cc35bc61032b036ed2cd (diff) |
use more Color in oox
Change-Id: I8fdc6742de5af9101e246411e7208650bae2c4c7
Reviewed-on: https://gerrit.libreoffice.org/50617
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/oox/drawingml')
-rw-r--r-- | include/oox/drawingml/clrscheme.hxx | 9 | ||||
-rw-r--r-- | include/oox/drawingml/color.hxx | 10 | ||||
-rw-r--r-- | include/oox/drawingml/shapepropertymap.hxx | 5 |
3 files changed, 16 insertions, 8 deletions
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 <oox/dllapi.h> #include <sal/types.h> #include <rtl/ustring.hxx> +#include <tools/color.hxx> namespace oox { namespace drawingml { @@ -78,15 +79,15 @@ typedef std::shared_ptr< ClrMap > ClrMapPtr; class OOX_DLLPUBLIC ClrScheme { - std::vector< std::pair<sal_Int32, sal_Int32> > maClrScheme; + std::vector< std::pair<sal_Int32, ::Color> > 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 <oox/dllapi.h> #include <rtl/ustring.hxx> #include <sal/types.h> +#include <tools/color.hxx> 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 <oox/helper/propertymap.hxx> #include <rtl/ustring.hxx> #include <sal/types.h> +#include <tools/color.hxx> 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; |