diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-08-03 12:51:32 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-08-03 12:51:32 +0000 |
commit | e5f17b6de07cd5b811ddcc0369078ba142fc6ea3 (patch) | |
tree | 3c01d407eea806ac64e8b0b41504f9350738e9cd /vcl/source/gdi/graph.cxx | |
parent | b1c7f527d03e8aa01f65179ac3728da003730d60 (diff) |
INTEGRATION: CWS hcicons (1.12.248); FILE MERGED
2007/07/23 10:36:52 fs 1.12.248.2: RESYNC: (1.12-1.13); FILE MERGED
2007/06/08 13:34:44 pb 1.12.248.1: fix: #146850# static DrawEx() added
Diffstat (limited to 'vcl/source/gdi/graph.cxx')
-rw-r--r-- | vcl/source/gdi/graph.cxx | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 13bf9c7ab485..4358ad9cbf1b 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -4,9 +4,9 @@ * * $RCSfile: graph.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: rt $ $Date: 2007-07-24 10:09:39 $ + * last change: $Author: hr $ $Date: 2007-08-03 13:51:32 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -84,14 +84,14 @@ using namespace ::com::sun::star; // ----------------------- static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText, - Font* pFont, const Bitmap* pBitmap, + Font* pFont, const Bitmap* pBitmap, const BitmapEx* pBitmapEx, const Point& rDestPt, const Size& rDestSize ) { USHORT nPixel = (USHORT) pOutDev->PixelToLogic( Size( 1, 1 ) ).Width(); USHORT nPixelWidth = nPixel; Point aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth ); Size aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) ); - BOOL bFilled = ( pBitmap != NULL || pFont != NULL ); + BOOL bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL ); Rectangle aBorderRect( aPoint, aSize ); pOutDev->Push(); @@ -123,13 +123,17 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText, aSize.Width() -= 2*nPixelWidth + 4*nPixel; aSize.Height() -= 2*nPixelWidth + 4*nPixel; - if( aSize.Width() > 0 && aSize.Height() > 0 && pBitmap && !!*pBitmap ) + if( aSize.Width() > 0 && aSize.Height() > 0 + && ( ( pBitmap && !!*pBitmap ) || ( pBitmapEx && !!*pBitmapEx ) ) ) { - Size aBitmapSize( pOutDev->PixelToLogic(pBitmap->GetSizePixel() ) ); + Size aBitmapSize( pOutDev->PixelToLogic( pBitmap ? pBitmap->GetSizePixel() : pBitmapEx->GetSizePixel() ) ); if( aSize.Height() > aBitmapSize.Height() && aSize.Width() > aBitmapSize.Width() ) { - pOutDev->DrawBitmap( aPoint, *pBitmap ); + if ( pBitmap ) + pOutDev->DrawBitmap( aPoint, *pBitmap ); + else + pOutDev->DrawBitmapEx( aPoint, *pBitmapEx ); aPoint.X() += aBitmapSize.Width() + 2*nPixel; aSize.Width() -= aBitmapSize.Width() + 2*nPixel; } @@ -601,7 +605,7 @@ void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const { if( GRAPHIC_DEFAULT == mpImpGraphic->ImplGetType() ) - ImplDrawDefault( pOutDev, NULL, NULL, NULL, rDestPt, rDestSz ); + ImplDrawDefault( pOutDev, NULL, NULL, NULL, NULL, rDestPt, rDestSz ); else mpImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz ); } @@ -612,7 +616,16 @@ void Graphic::Draw( OutputDevice* pOutDev, const String& rText, Font& rFont, const Bitmap& rBitmap, const Point& rDestPt, const Size& rDestSz ) { - ImplDrawDefault( pOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz ); + ImplDrawDefault( pOutDev, &rText, &rFont, &rBitmap, NULL, rDestPt, rDestSz ); +} + +// ------------------------------------------------------------------------ + +void Graphic::DrawEx( OutputDevice* pOutDev, const String& rText, + Font& rFont, const BitmapEx& rBitmap, + const Point& rDestPt, const Size& rDestSz ) +{ + ImplDrawDefault( pOutDev, &rText, &rFont, NULL, &rBitmap, rDestPt, rDestSz ); } // ------------------------------------------------------------------------ |