summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/tools.cxx
diff options
context:
space:
mode:
authorthb <thb@openoffice.org>2010-02-19 12:46:18 +0100
committerthb <thb@openoffice.org>2010-02-19 12:46:18 +0100
commit542222f04c17b7534d34c79d40d609b8eb6ec2fd (patch)
treed7a75d99f87a9b3dd7dafc197531df167773d9a2 /slideshow/source/engine/tools.cxx
parentfc69c9694e7e10309aee1015107e4ef279e31474 (diff)
parent02f1b698feb68c70166be96eae9f557fbf076ac2 (diff)
Merged with dev300_m71
Diffstat (limited to 'slideshow/source/engine/tools.cxx')
-rw-r--r--slideshow/source/engine/tools.cxx48
1 files changed, 40 insertions, 8 deletions
diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx
index 969063d9c21f..ac93183aeb8a 100644
--- a/slideshow/source/engine/tools.cxx
+++ b/slideshow/source/engine/tools.cxx
@@ -164,10 +164,10 @@ namespace slideshow
// =========================
/// extract unary double value from Any
- bool extractValue( double& o_rValue,
- const uno::Any& rSourceAny,
- const ShapeSharedPtr& rShape,
- const ::basegfx::B2DVector& rSlideBounds )
+ bool extractValue( double& o_rValue,
+ const uno::Any& rSourceAny,
+ const ShapeSharedPtr& rShape,
+ const ::basegfx::B2DVector& rSlideBounds )
{
// try to extract numeric value (double, or smaller POD, like float or int)
if( (rSourceAny >>= o_rValue) )
@@ -710,6 +710,38 @@ namespace slideshow
static_cast< sal_uInt8 >( nColor >> 24U ) ) );
}
+ sal_Int32 RGBAColor2UnoColor( ::cppcanvas::Color::IntSRGBA aColor )
+ {
+ return ::cppcanvas::makeColorARGB(
+ // convert from IntSRGBA color to API color
+ // (0xRRGGBBAA -> 0xAARRGGBB)
+ static_cast< sal_uInt8 >(0),
+ ::cppcanvas::getRed(aColor),
+ ::cppcanvas::getGreen(aColor),
+ ::cppcanvas::getBlue(aColor));
+ }
+
+ /*sal_Int32 RGBAColor2UnoColor( ::cppcanvas::Color::IntSRGBA aColor )
+ {
+ return ::cppcanvas::unMakeColor(
+ // convert from IntSRGBA color to API color
+ // (0xRRGGBBAA -> 0xAARRGGBB)
+ static_cast< sal_uInt8 >(0),
+ ::cppcanvas::getRed(aColor),
+ ::cppcanvas::getGreen(aColor),
+ ::cppcanvas::getBlue(aColor));
+ }*/
+
+ sal_Int8 unSignedToSigned(sal_Int8 nInt)
+ {
+ if(nInt < 0 ){
+ sal_Int8 nInt2 = nInt >> 1U;
+ return nInt2;
+ }else{
+ return nInt;
+ }
+ }
+
void fillRect( const ::cppcanvas::CanvasSharedPtr& rCanvas,
const ::basegfx::B2DRectangle& rRect,
::cppcanvas::Color::IntSRGBA aFillColor )
@@ -806,12 +838,12 @@ namespace slideshow
// determine transformed page bounds
const basegfx::B2DRange aRect( 0,0,
- rSlideSize.getX(),
- rSlideSize.getY() );
+ rSlideSize.getX(),
+ rSlideSize.getY() );
basegfx::B2DRange aTmpRect;
canvas::tools::calcTransformedRectBounds( aTmpRect,
- aRect,
- pView->getTransformation() );
+ aRect,
+ pView->getTransformation() );
// #i42440# Returned slide size is one pixel too small, as
// rendering happens one pixel to the right and below the