From bffdf143d5924fd277000fad4a7e7108d6d8f041 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 28 Dec 2009 15:02:47 +0000 Subject: #i107965# report rectangles with 0 or negative width or height as empty --- vcl/source/gdi/outdev3.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 51aad0790a26..e39ca248567f 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -7479,7 +7479,7 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect, { bRet = pSalLayout->GetBoundRect( *mpGraphics, aPixelRect ); - if( bRet ) + if( bRet && (aPixelRect.GetWidth() > 0) || (aPixelRect.GetHeight() > 0) ) { int nWidthFactor = pSalLayout->GetUnitsPerPixel(); @@ -7601,6 +7601,12 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect, aBmp.ReleaseAccess( pAcc ); + if( (nRight <= nLeft) || (nBottom <= nTop) ) + { + rRect.SetEmpty(); + return TRUE; + } + if( nTop <= nBottom ) { Size aSize( nRight - nLeft + 1, nBottom - nTop + 1 ); -- cgit From 0b2cc3465d5a793c36b6ba2752d4b332a6d61e05 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 7 Jan 2010 11:53:09 +0000 Subject: reverted previous patch --- vcl/source/gdi/outdev3.cxx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index e39ca248567f..51aad0790a26 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -7479,7 +7479,7 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect, { bRet = pSalLayout->GetBoundRect( *mpGraphics, aPixelRect ); - if( bRet && (aPixelRect.GetWidth() > 0) || (aPixelRect.GetHeight() > 0) ) + if( bRet ) { int nWidthFactor = pSalLayout->GetUnitsPerPixel(); @@ -7601,12 +7601,6 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect, aBmp.ReleaseAccess( pAcc ); - if( (nRight <= nLeft) || (nBottom <= nTop) ) - { - rRect.SetEmpty(); - return TRUE; - } - if( nTop <= nBottom ) { Size aSize( nRight - nLeft + 1, nBottom - nTop + 1 ); -- cgit