diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2019-03-08 19:02:13 +0100 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2019-03-14 13:30:41 +0100 |
commit | b795e540e4c4d31618a16ca8456476d5651a4d01 (patch) | |
tree | 960c6aa717d48e7fa1658eed4d27e09572cf3c92 /filter | |
parent | ffcff2fe24ce1fd64b7c45073c09f6d5a5a5d51d (diff) |
tdf#122899 use unsigned integer for mso_sptArc
The path coordinates were read as sal_Int16. But for a
mso_sptArc shape the values are unsigned integer. I correct
it for this shape type only, because I don't know, whether
other places actually need sal_Int16.
The change from 0xa504 to 0xa604 in the defaults means a
change from 'ClockwiseArcTo' to 'ClockwiseArc' so that an
implicit moveto is used, same as in VML command 'wr'.
Change-Id: Ib9c594c15d5a97048595efd644a4a6e8774fcefd
Reviewed-on: https://gerrit.libreoffice.org/68941
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index edf85fe7cbaa..c7a974008f4b 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -2169,12 +2169,25 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt } else { - sal_Int16 nTmpA(0), nTmpB(0); - rIn.ReadInt16( nTmpA ) - .ReadInt16( nTmpB ); - - nX = nTmpA; - nY = nTmpB; + // The mso-spt19 (arc) uses this. But it needs unsigned integer. I don't + // know if other shape types also need it. They can be added as necessary. + bool bNeedsUnsigned = rObjData.eShapeType == mso_sptArc; + if (bNeedsUnsigned) + { + sal_uInt16 nTmpA(0), nTmpB(0); + rIn.ReadUInt16(nTmpA) + .ReadUInt16(nTmpB); + nX = nTmpA; + nY = nTmpB; + } + else + { + sal_Int16 nTmpA(0), nTmpB(0); + rIn.ReadInt16( nTmpA ) + .ReadInt16( nTmpB ); + nX = nTmpA; + nY = nTmpB; + } } EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].First, nX ); EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].Second, nY ); @@ -4528,8 +4541,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r sal_Int32 nX = 0, nY = 0; seqCoordinates[ nPtNum ].First.Value >>= nX; seqCoordinates[ nPtNum ].Second.Value >>= nY; - aP.setX( nX ); - aP.setY( nY ); + aP.setX(nX); + aP.setY(nY); aXP[ static_cast<sal_uInt16>(nPtNum) ] = aP; } aPolyBoundRect = aXP.GetBoundRect(); |