You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2014/03/24 08:48:45 UTC

svn commit: r1580779 - /openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx

Author: hdu
Date: Mon Mar 24 07:48:44 2014
New Revision: 1580779

URL: http://svn.apache.org/r1580779
Log:
#i124375# force soft-hyphen visibility for CoreText to meet Writer+EEng expectations

Modified:
    openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx

Modified: openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx?rev=1580779&r1=1580778&r2=1580779&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx Mon Mar 24 07:48:44 2014
@@ -121,8 +121,16 @@ bool CTLayout::LayoutText( ImplLayoutArg
 	if( mnCharCount <= 0 )
 		return false;
 
-	// create the CoreText line layout
+	// prepare the string to be layouted by CoreText
 	CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL, rArgs.mpStr + mnMinCharPos, mnCharCount, kCFAllocatorNull );
+	// #i124375# force soft-hyphen visibility to meet the expectations of Writer+EditEngine
+	if( CFStringFind( aCFText, (CFStringRef)@"\u00AD", 0).length > 0 )
+	{
+		NSString* pDashStr = [(NSString*)aCFText stringByReplacingOccurrencesOfString: @"\u00AD" withString: @"-"];
+		aCFText = CFStringCreateCopy( NULL, (CFStringRef)pDashStr );
+	}
+
+	// create the CoreText line layout using the requested text style
 	mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
 	mpCTLine = CTLineCreateWithAttributedString( mpAttrString );
 	CFRelease( aCFText);