Author: alg
Date: Thu Jan 30 21:34:57 2014
New Revision: 1562980
URL: http://svn.apache.org/r1562980
Log:
i12355 Corrected case that in WinSalGraphics::setClipRegion an empty Polygon is
handed over
Modified:
openoffice/trunk/main/vcl/win/source/gdi/salgdi.cxx
Modified: openoffice/trunk/main/vcl/win/source/gdi/salgdi.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/win/source/gdi/salgdi.cxx?rev=1562980&r1=1562979&r2=1562980&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/win/source/gdi/salgdi.cxx (original)
+++ openoffice/trunk/main/vcl/win/source/gdi/salgdi.cxx Thu Jan 30 21:34:57 2014
@@ -1017,13 +1017,19 @@ bool WinSalGraphics::setClipRegion( cons
}
// create clip region from ClipRgnData
- if ( mpClipRgnData->rdh.nCount == 1 )
+ if(0 == mpClipRgnData->rdh.nCount)
+ {
+ // #123585# 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)
{
ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
@@ -1063,8 +1069,14 @@ bool WinSalGraphics::setClipRegion( cons
//
//bool bBla = true;
}
+ else
+ {
+ // #123585# See above, this is a valid case, execute it
+ SelectClipRgn( getHDC(), 0 );
+ }
- return mhRegion != 0;
+ // #123585# retval no longer dependent of mhRegion, see TaskId comments
above
+ return true;
}
// -----------------------------------------------------------------------