Kaydet (Commit) c7243848 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i124375# force soft-hyphen visibility for CoreText to meet Writer+EEng expectations

üst 25905363
...@@ -121,8 +121,16 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs ) ...@@ -121,8 +121,16 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs )
if( mnCharCount <= 0 ) if( mnCharCount <= 0 )
return false; return false;
// create the CoreText line layout // prepare the string to be layouted by CoreText
CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL, rArgs.mpStr + mnMinCharPos, mnCharCount, kCFAllocatorNull ); 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() ); mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
mpCTLine = CTLineCreateWithAttributedString( mpAttrString ); mpCTLine = CTLineCreateWithAttributedString( mpAttrString );
CFRelease( aCFText); CFRelease( aCFText);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment