From 8214c1d6156c90cbf259b15cf1c8e15ea1c70daf Mon Sep 17 00:00:00 2001 From: Herbert Dürr Date: Mon, 24 Mar 2014 07:48:44 +0000 Subject: 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 --- vcl/quartz/ctlayout.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index b8b1b98e6ce0..e479d31853f6 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -108,11 +108,20 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs ) 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 // CFAttributedStringCreate copies the attribues parameter mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() ); mpCTLine = CTLineCreateWithAttributedString( mpAttrString ); -- cgit