diff options
author | Andre Fischer <af@apache.org> | 2012-07-10 10:01:05 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-06-04 17:35:07 +0200 |
commit | e0413e9da0687d381bac4a7275c56c529f6552cd (patch) | |
tree | 46df8bfcdc4d9651e0d81e6411bb3e3fcf05d81e /filter | |
parent | 49bc98f8ced6cc45a652a2a800975ea494781405 (diff) |
bnc#823049 #i119872# Fixed import of custom shapes from PPT.
Reported by: Li Feng Wang
Patch by: Jianyuan Li
Review by: Andre Fischer
(cherry picked from commit 5278c7770a350771a96780c0e0d7a0bdae0d55b9)
Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index c2b67c568a4d..33a5b990ceec 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -2253,23 +2253,24 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt { rIn >> nTmp; nCommand = EnhancedCustomShapeSegmentCommand::UNKNOWN; - nCnt = (sal_Int16)( nTmp & 0xfff ); - switch( nTmp >> 12 ) + nCnt = (sal_Int16)( nTmp & 0x1fff );//Last 13 bits for segment points number + switch( nTmp >> 13 )//First 3 bits for command type { case 0x0: nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; break; - case 0x1: nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; break; // seems to the relative lineto - case 0x4: nCommand = EnhancedCustomShapeSegmentCommand::MOVETO; if ( !nCnt ) nCnt = 1; break; - case 0x2: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break; - case 0x3: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break; // seems to be the relative curveto - case 0x8: nCommand = EnhancedCustomShapeSegmentCommand::ENDSUBPATH; nCnt = 0; break; - case 0x6: nCommand = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; nCnt = 0; break; - case 0xa: - case 0xb: + case 0x1: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break; + case 0x2: nCommand = EnhancedCustomShapeSegmentCommand::MOVETO; if ( !nCnt ) nCnt = 1; break; + case 0x3: nCommand = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; nCnt = 0; break; + case 0x4: nCommand = EnhancedCustomShapeSegmentCommand::ENDSUBPATH; nCnt = 0; break; + case 0x5: + case 0x6: { - switch ( ( nTmp >> 8 ) & 0xf ) + switch ( ( nTmp >> 8 ) & 0x1f )//5 bits next to command type is for path escape type { case 0x0: { + //It is msopathEscapeExtension which is transformed into LINETO. + //If issue happens, I think this part can be comment so that it will be taken as unknow command. + //When export, origin data will be export without any change. nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; |