diff options
author | Paris Oplopoios <paris.oplopoios@collabora.com> | 2022-11-01 14:25:38 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-11-08 10:50:30 +0100 |
commit | b9eaed7a4c484dde0b5c61b34b4beb60a101f661 (patch) | |
tree | 233f04916a8826c3e9014acc957c4c415bf35d2e /emfio/source | |
parent | 3c4ee1f180aed4bc09cf8dab2a1101feb0d95fa6 (diff) |
tdf#151844 Make EMR_EXTSELECTCLIPRGN factor in WinOrg coordinates
EMR_EXTSELECTCLIPRGN would not factor in WinOrg coordinates which would
give the clip box wrong coordinates causing some graphics to look
chopped in the wrong way.
Change-Id: I4f9a1b1c27fc276d188d0d865991795dab48dce5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142110
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'emfio/source')
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index 7baa7c8ed949..207d8373e309 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -332,7 +332,7 @@ SvStream& operator>>(SvStream& rInStream, BLENDFUNCTION& rBlendFun) return rInStream; } -bool ImplReadRegion( basegfx::B2DPolyPolygon& rPolyPoly, SvStream& rStream, sal_uInt32 nLen ) +bool ImplReadRegion( basegfx::B2DPolyPolygon& rPolyPoly, SvStream& rStream, sal_uInt32 nLen, Point aWinOrg ) { if (nLen < 32) // 32 bytes - Size of RegionDataHeader return false; @@ -369,6 +369,10 @@ bool ImplReadRegion( basegfx::B2DPolyPolygon& rPolyPoly, SvStream& rStream, sal_ rStream.ReadInt32(nTop); rStream.ReadInt32(nRight); rStream.ReadInt32(nBottom); + nLeft += aWinOrg.X(); + nRight += aWinOrg.X(); + nTop += aWinOrg.Y(); + nBottom += aWinOrg.Y(); rPolyPoly.append( basegfx::utils::createPolygonFromRect( ::basegfx::B2DRectangle( nLeft, nTop, nRight, nBottom ) ) ); SAL_INFO("emfio", "\t\t" << i << " Left: " << nLeft << ", top: " << nTop << ", right: " << nRight << ", bottom: " << nBottom); } @@ -1348,7 +1352,7 @@ namespace emfio { basegfx::B2DPolyPolygon aPolyPoly; if (cbRgnData) - ImplReadRegion(aPolyPoly, *mpInputStream, nRemainingRecSize); + ImplReadRegion(aPolyPoly, *mpInputStream, nRemainingRecSize, GetWinOrg()); const tools::PolyPolygon aPolyPolygon(aPolyPoly); SetClipPath(aPolyPolygon, static_cast<RegionMode>(nClippingMode), false); } @@ -1930,7 +1934,7 @@ namespace emfio mpInputStream->ReadUInt32( nRgnDataSize ).ReadUInt32( nIndex ); nRemainingRecSize -= 24; - if (ImplReadRegion(aPolyPoly, *mpInputStream, nRemainingRecSize)) + if (ImplReadRegion(aPolyPoly, *mpInputStream, nRemainingRecSize, GetWinOrg())) { Push(); SelectObject( nIndex ); @@ -1955,7 +1959,7 @@ namespace emfio mpInputStream->ReadUInt32( nRgnDataSize ); nRemainingRecSize -= 20; - if (ImplReadRegion(aPolyPoly, *mpInputStream, nRemainingRecSize)) + if (ImplReadRegion(aPolyPoly, *mpInputStream, nRemainingRecSize, GetWinOrg())) { tools::PolyPolygon aPolyPolygon(aPolyPoly); DrawPolyPolygon( aPolyPolygon ); |