diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 23:45:14 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 23:45:14 +0000 |
commit | 8797094194acced88f5c73521421798be222af0b (patch) | |
tree | 6842f21821fbf512d7d62196e55e4e8551bdf1e1 /tools | |
parent | bb09a93f869cd9158d19a22a67a7c1420c07fc9b (diff) |
INTEGRATION: CWS aw033 (1.2.20); FILE MERGED
2008/05/14 15:20:46 aw 1.2.20.3: RESYNC: (1.3-1.4); FILE MERGED
2008/03/14 14:42:23 cl 1.2.20.2: RESYNC: (1.2-1.3); FILE MERGED
2007/05/24 10:08:32 aw 1.2.20.1: applied patches to migrated headers
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/color.hxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/inc/tools/color.hxx b/tools/inc/tools/color.hxx index cb5b25a7d5ea..4af82e4f1003 100644 --- a/tools/inc/tools/color.hxx +++ b/tools/inc/tools/color.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: color.hxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.5 $ * * This file is part of OpenOffice.org. * @@ -36,6 +36,10 @@ class SvStream; class ResId; #include <tools/solar.h> +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include <basegfx/color/bcolor.hxx> +#endif + // -------------------- // - ColorCount-Types - // -------------------- @@ -128,6 +132,15 @@ public: Color( const ResId& rResId ); // This ctor is defined in svtools, not tools! + // constructor to create a tools-Color from ::basegfx::BColor + explicit Color(const ::basegfx::BColor& rBColor) + { + mnColor = RGB_COLORDATA( + UINT8((rBColor.getRed() * 255.0) + 0.5), + UINT8((rBColor.getGreen() * 255.0) + 0.5), + UINT8((rBColor.getBlue() * 255.0) + 0.5)); + } + void SetRed( UINT8 nRed ); UINT8 GetRed() const { return COLORDATA_RED( mnColor ); } void SetGreen( UINT8 nGreen ); @@ -178,6 +191,9 @@ public: TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Color& rColor ); TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Color& rColor ); + + // get ::basegfx::BColor from this color + ::basegfx::BColor getBColor() const { return ::basegfx::BColor(GetRed() / 255.0, GetGreen() / 255.0, GetBlue() / 255.0); } }; inline void Color::SetRed( UINT8 nRed ) |