diff options
author | Armin Le Grand <alg@apache.org> | 2014-01-30 21:34:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-31 21:25:16 +0000 |
commit | 9b677819a703208a650c08186546b11f0a535fd2 (patch) | |
tree | 06474610b3b237c8b0588878c9c0b409e823c66c /vcl/win/source | |
parent | f86b075ebe0ce6abbe573b0663275de7baa0bd57 (diff) |
Resolves: #i12355# Corrected case that...
in WinSalGraphics::setClipRegion an empty Polygon is handed over
(cherry picked from commit 9957d5854dcc65db37f0631c19e3421df1311089)
Change-Id: Id19a708d228d205bb1e14664c04af6eef179a5d4
Diffstat (limited to 'vcl/win/source')
-rw-r--r-- | vcl/win/source/gdi/salgdi.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 591909fa421e..84023168f963 100644 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -1003,13 +1003,19 @@ bool WinSalGraphics::setClipRegion( const Region& i_rClip ) } // create clip region from ClipRgnData - if ( mpClipRgnData->rdh.nCount == 1 ) + if(0 == mpClipRgnData->rdh.nCount) + { + // #i123585# region is empty; this may happen when e.g. a PolyPolygon is given + // that contains no polygons or only empty ones (no width/height). This is + // perfectly fine and we are done, except setting it (see end of method) + } + else if(1 == mpClipRgnData->rdh.nCount) { RECT* pRect = &(mpClipRgnData->rdh.rcBound); mhRegion = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom ); } - else if( mpClipRgnData->rdh.nCount > 1 ) + else if(mpClipRgnData->rdh.nCount > 1) { sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER); mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData ); @@ -1049,8 +1055,14 @@ bool WinSalGraphics::setClipRegion( const Region& i_rClip ) // //bool bBla = true; } + else + { + // #i123585# See above, this is a valid case, execute it + SelectClipRgn( getHDC(), 0 ); + } - return mhRegion != 0; + // #i123585# retval no longer dependent of mhRegion, see TaskId comments above + return true; } // ----------------------------------------------------------------------- |