From c7610f13df9a5f944a2fceb94a7079d3f42fe381 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 20 Jun 2012 20:00:55 +0200 Subject: fix off-by-one when reading WMF/EMF According to docs http://msdn.microsoft.com/en-us/library/dd162589(v=vs.85), cxDest/cyDest are "Logical width/height of the destination rectangle.", so there should be no +1 as there would be if they were the top-bottom corner. Change-Id: Iefa6db8e6131abe785b7878d97df1c891b73011c --- svtools/source/filter/wmf/enhwmf.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'svtools') diff --git a/svtools/source/filter/wmf/enhwmf.cxx b/svtools/source/filter/wmf/enhwmf.cxx index b81d973aa9c7..cce3dca83007 100644 --- a/svtools/source/filter/wmf/enhwmf.cxx +++ b/svtools/source/filter/wmf/enhwmf.cxx @@ -950,7 +950,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF() cxSrc = cySrc = 0; Bitmap aBitmap; - Rectangle aRect( Point( xDest, yDest ), Size( cxDest+1, cyDest+1 ) ); + Rectangle aRect( Point( xDest, yDest ), Size( cxDest, cyDest ) ); cxDest = abs( (int)cxDest ); // sj: i37894, size can be negative cyDest = abs( (int)cyDest ); // and also 122889 @@ -1019,7 +1019,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF() >> cyDest; Bitmap aBitmap; - Rectangle aRect( Point( xDest, yDest ), Size( cxDest+1, cyDest+1 ) ); + Rectangle aRect( Point( xDest, yDest ), Size( cxDest, cyDest ) ); cxDest = abs( (int)cxDest ); // sj: i37894, size can be negative cyDest = abs( (int)cyDest ); // and also 122889 -- cgit