Anonymous avatar Anonymous committed 528b3af Merge

CWS-TOOLING: integrate CWS pdffix03

Comments (0)

Files changed (2)

vcl/aqua/source/gdi/salatslayout.cxx

 
 	// initial measurement of text break position
 	UniCharArrayOffset nBreakPos = mnMinCharPos;
-    const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); 
+	const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); 
+	if( nATSUMaxWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter
+		return mnMinCharPos;      //           or do ATSUMaxWidth=0x10000;
 	OSStatus eStatus = ATSUBreakLine( maATSULayout, mnMinCharPos,
 		nATSUMaxWidth, false, &nBreakPos );
-
 	if( (eStatus != noErr) && (eStatus != kATSULineBreakInWord) )
 		return STRING_LEN;
 
 	if( eStatus != noErr )
 		return nBreakPos;
 	const ATSUTextMeasurement nATSURemWidth = nATSUMaxWidth - (nRight - nLeft);
-	if( nATSURemWidth <= 0 )
+	if( nATSURemWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter
 		return nBreakPos;
 	UniCharArrayOffset nBreakPosInWord = nBreakPos;
 	eStatus = ATSUBreakLine( maATSULayout, nBreakPos, nATSURemWidth, false, &nBreakPosInWord );

vcl/source/gdi/pdfwriter_impl.cxx

                 // try to handle ligatures and such
                 if( i < nGlyphs-1 )
                 {
-                    pUnicodesPerGlyph[i] = nChars = pCharPosAry[i+1] - pCharPosAry[i];
+                    nChars = pCharPosAry[i+1] - pCharPosAry[i];
+                    // #i115618# fix for simple RTL+CTL cases	
+                    // TODO: sanitize for RTL ligatures, more complex CTL, etc.	
+                    if( nChars < 0 )
+                        nChars = -nChars;		    
+		    else if( nChars == 0 )
+                        nChars = 1;		    
+                    pUnicodesPerGlyph[i] = nChars;
                     for( int n = 1; n < nChars; n++ )
                         aUnicodes.push_back( rText.GetChar( sal::static_int_cast<xub_StrLen>(pCharPosAry[i]+n) ) );
                 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.