From 997654c21dd3758a58743e9eb660bf0099fd6007 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 10 Mar 2015 11:38:52 +0000 Subject: make SvpSalGraphics::getBitmap more readable Change-Id: I4eb896813d6cec49bf5f1c8ac2ee8fafc06fbf52 --- vcl/headless/svpgdi.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'vcl/headless') diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 6e04a01176ae..a0bea2ba2cad 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -651,18 +651,21 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rPosAry, SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeight ) { - basebmp::BitmapDeviceSharedPtr aCopy; + SvpSalBitmap* pBitmap = new SvpSalBitmap(); + if (m_aDevice) + { + basebmp::BitmapDeviceSharedPtr aCopy; aCopy = cloneBitmapDevice(basegfx::B2IVector(nWidth, nHeight), m_aDevice); - basegfx::B2IBox aSrcRect( nX, nY, nX+nWidth, nY+nHeight ); - basegfx::B2IBox aDestRect( 0, 0, nWidth, nHeight ); + basegfx::B2IBox aSrcRect( nX, nY, nX+nWidth, nY+nHeight ); + basegfx::B2IBox aDestRect( 0, 0, nWidth, nHeight ); - if (aCopy) aCopy->drawBitmap( m_aOrigDevice, aSrcRect, aDestRect, basebmp::DrawMode_PAINT ); - SvpSalBitmap* pBitmap = new SvpSalBitmap(); - pBitmap->setBitmap( aCopy ); + pBitmap->setBitmap( aCopy ); + } + return pBitmap; } -- cgit