diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-10 11:38:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-10 12:02:04 +0000 |
commit | 997654c21dd3758a58743e9eb660bf0099fd6007 (patch) | |
tree | f400a1fab5ec540ad8a3131b7792cdd24db705f7 | |
parent | 662f88b0b0c3d7c10b7a8e5c8298f320e3151c94 (diff) |
make SvpSalGraphics::getBitmap more readable
Change-Id: I4eb896813d6cec49bf5f1c8ac2ee8fafc06fbf52
-rw-r--r-- | vcl/headless/svpgdi.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
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; } |