From 8797094194acced88f5c73521421798be222af0b Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 19 Aug 2008 23:45:14 +0000 Subject: 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 --- tools/inc/tools/color.hxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include +#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 ) -- cgit