diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2019-12-10 21:56:59 +1100 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2019-12-23 12:30:35 +0100 |
commit | 65429eac65efbc68f60882e3a87085cf682cf62a (patch) | |
tree | f394ac9c896b9e0a782e11497b537e0dbd05dc1c /drawinglayer | |
parent | 7be16ddb57720a2a5bfb04c3496723dc6f462cc0 (diff) |
drawinglayer: read EmfPlusPointR points in EmfPlusPath record
Change-Id: Iecb0fbd85fd5ceb1d9d9904a6a5482385f8d8622
Reviewed-on: https://gerrit.libreoffice.org/84842
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/tools/emfppath.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drawinglayer/source/tools/emfppath.cxx b/drawinglayer/source/tools/emfppath.cxx index 2f3844b7cc2a..471cc6729cf3 100644 --- a/drawinglayer/source/tools/emfppath.cxx +++ b/drawinglayer/source/tools/emfppath.cxx @@ -25,6 +25,14 @@ namespace emfplushelper { + static sal_Int16 GetEmfPlusInteger(sal_Int32 nInt) + { + if (nInt & 0x80000000) + return (nInt & 0x7FFF) >> 16; + + return nInt >> 24; + } + EMFPPath::EMFPPath (sal_Int32 _nPoints, bool bLines) { if (_nPoints<0 || sal_uInt32(_nPoints)>SAL_MAX_INT32 / (2 * sizeof(float))) @@ -52,7 +60,13 @@ namespace emfplushelper // EMFPlusPointR: points are stored in EMFPlusInteger7 or // EMFPlusInteger15 objects, see section 2.2.2.21/22 // If 0x800 bit is set, the 0x4000 bit is undefined and must be ignored - SAL_WARN("drawinglayer", "EMF+\t\t TODO - parse EMFPlusPointR object (section 2.2.1.6)"); + sal_Int32 x, y; + s.ReadInt32(x).ReadInt32(y); + x = GetEmfPlusInteger(x); + y = GetEmfPlusInteger(y); + pPoints [i*2] = x; + pPoints [i*2 + 1] = y; + SAL_INFO("drawinglayer", "EMF+\t\t\tEmfPlusPointR [x,y]: " << x << ", " << y); } else if (pathFlags & 0x4000) { @@ -60,7 +74,7 @@ namespace emfplushelper sal_Int16 x, y; s.ReadInt16( x ).ReadInt16( y ); - SAL_INFO ("drawinglayer", "EMF+\t EMFPlusPoint [x,y]: " << x << "," << y); + SAL_INFO ("drawinglayer", "EMF+\t\t\tEmfPlusPoint [x,y]: " << x << "," << y); pPoints [i*2] = x; pPoints [i*2 + 1] = y; } |