incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1359598 - /incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx
Date Tue, 10 Jul 2012 11:01:06 GMT
Author: af
Date: Tue Jul 10 11:01:05 2012
New Revision: 1359598

URL: http://svn.apache.org/viewvc?rev=1359598&view=rev
Log:
#i119872# Fixed import of custom shapes from PPT.

          Reported by: Li Feng Wang
          Patch by: Jianyuan Li
          Review by: Andre Fischer

Modified:
    incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx

Modified: incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx?rev=1359598&r1=1359597&r2=1359598&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/msdffimp.cxx Tue Jul 10 11:01:05 2012
@@ -2362,23 +2362,24 @@ void DffPropertyReader::ApplyCustomShape
 				{
 					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;



Mime
View raw message