diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-07-25 06:12:38 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-07-25 06:12:38 +0000 |
commit | eb41a2b4b233ab223d2eba92c4d82e7cc4241043 (patch) | |
tree | 600f0719e39399b8dc15d6863af6fc6e5226334a /sdext | |
parent | 331c50a08423390b5a8d3ca2148eb766584e61dd (diff) |
INTEGRATION: CWS impress148 (1.2.30); FILE MERGED
2008/07/24 07:59:18 cl 1.2.30.3: fixed merge conflicts
2008/07/23 15:53:47 cl 1.2.30.2: RESYNC: (1.2-1.3); FILE MERGED
2008/07/16 12:47:57 af 1.2.30.1: #i91701# Use only 4 component colors.
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/presenter/PresenterCanvasHelper.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sdext/source/presenter/PresenterCanvasHelper.cxx b/sdext/source/presenter/PresenterCanvasHelper.cxx index d88a9585517c..d6cc9cd4ace9 100644 --- a/sdext/source/presenter/PresenterCanvasHelper.cxx +++ b/sdext/source/presenter/PresenterCanvasHelper.cxx @@ -8,7 +8,7 @@ * * $RCSfile: PresenterCanvasHelper.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -334,10 +334,7 @@ void PresenterCanvasHelper::PaintColor ( // Setup the rendering state to use the given color. rendering::RenderState aRenderState (rDefaultRenderState); - aRenderState.DeviceColor[0] = ((nColor >> 16) & 0x0ff) / 255.0; - aRenderState.DeviceColor[1] = ((nColor >> 8) & 0x0ff) / 255.0; - aRenderState.DeviceColor[2] = ((nColor >> 0) & 0x0ff) / 255.0; - aRenderState.DeviceColor[3] = ((nColor >> 24) & 0x0ff) / 255.0; + SetDeviceColor(aRenderState, nColor); rxCanvas->fillPolyPolygon( rxPolygon, @@ -352,14 +349,15 @@ void PresenterCanvasHelper::SetDeviceColor( rendering::RenderState& rRenderState, const util::Color aColor) { - if (rRenderState.DeviceColor.getLength() >= 3) + // Other component counts then 4 (RGBA) are not accepted (anymore). + + OSL_ASSERT(rRenderState.DeviceColor.getLength() == 4); + if (rRenderState.DeviceColor.getLength() == 4) { rRenderState.DeviceColor[0] = ((aColor >> 16) & 0x0ff) / 255.0; rRenderState.DeviceColor[1] = ((aColor >> 8) & 0x0ff) / 255.0; rRenderState.DeviceColor[2] = ((aColor >> 0) & 0x0ff) / 255.0; - - if (rRenderState.DeviceColor.getLength() >= 4) - rRenderState.DeviceColor[3] = ((aColor >> 24) & 0x0ff) / 255.0; + rRenderState.DeviceColor[3] = 1.0 - ((aColor >> 24) & 0x0ff) / 255.0; } } |