Resolves: #i124375# force soft-hyphen visibility for CoreText...
to meet Writer+EEng expectations (cherry picked from commit c7243848547b19a3b237f18629b809d93ee821c4) Conflicts: vcl/aqua/source/gdi/ctlayout.cxx Change-Id: If580bcb517695ae1c94657ac9348ad36eda37e9d
This commit is contained in:
committed by
Caolán McNamara
parent
9afdc72df6
commit
8214c1d615
@@ -108,11 +108,20 @@ 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,
|
CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL,
|
||||||
rArgs.mpStr + mnMinCharPos,
|
rArgs.mpStr + mnMinCharPos,
|
||||||
mnCharCount,
|
mnCharCount,
|
||||||
kCFAllocatorNull );
|
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
|
||||||
// CFAttributedStringCreate copies the attribues parameter
|
// CFAttributedStringCreate copies the attribues parameter
|
||||||
mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
|
mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
|
||||||
mpCTLine = CTLineCreateWithAttributedString( mpAttrString );
|
mpCTLine = CTLineCreateWithAttributedString( mpAttrString );
|
||||||
|
Reference in New Issue
Block a user