diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-05-04 16:49:25 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-05-05 10:24:01 +0200 |
commit | 24e71494d7d1a68b2cb5f5d34083ab02009e0982 (patch) | |
tree | e7c247d7a838b214469d10ac32f7286546ef192e /emfio/source | |
parent | c0771af1b35269b58b35df52004604b20971c6ae (diff) |
tdf#55058 tdf#141982 EMF: Add rotation and path support for RECTANGLE record
Previous implementation of EMR_RECTANGLE, doesn't support rotation
and EMR_RECTANGLE was not work with EMR_BEGINPATH, EMR_ENDPATH and EMR_ABORTPATH
The EMR_BEGINPATH opens path bracket construction.
Once path bracket construction is open, an application can begin specifying records to
define the points that lie in the path. Path bracket construction MUST be closed by an
EMR_ABORTPATH or EMR_ENDPATH record.
With this patch all these issue was resolved for EMR_RECTANGLE
Change-Id: Ic51442df8905e47c92eed811cc776762c9752af2
Change-Id: I111f183e509f03c0b276a038680f61156b37b235
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115065
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'emfio/source')
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index ecef6ba6fe95..2296855c7603 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -1341,7 +1341,14 @@ namespace emfio case EMR_RECTANGLE : { mpInputStream->ReadInt32( nX32 ).ReadInt32( nY32 ).ReadInt32( nx32 ).ReadInt32( ny32 ); - DrawRect( ReadRectangle( nX32, nY32, nx32, ny32 ) ); + SAL_INFO("emfio", "\t\t Rectangle, left: " << nX32 << ", top: " << nY32 << ", right: " << nx32 << ", bottom: " << ny32); + Point aPoints[] { Point(nX32, nY32), + Point(nx32, nY32), + Point(nx32, ny32), + Point(nX32, ny32) }; + tools::Polygon aPoly(4, aPoints); + aPoly.Optimize( PolyOptimizeFlags::CLOSE ); + DrawPolygon( aPoly, mbRecordPath ); } break; |