Author: hdu
Date: Mon Mar 24 07:51:46 2014
New Revision: 1580780

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

merged from trunk revision 1580779

Modified:
    openoffice/branches/AOO410/   (props changed)
    openoffice/branches/AOO410/main/   (props changed)
    openoffice/branches/AOO410/main/vcl/aqua/source/gdi/ctlayout.cxx

Propchange: openoffice/branches/AOO410/
------------------------------------------------------------------------------
  Merged /openoffice/trunk:r1580779

Propchange: openoffice/branches/AOO410/main/
------------------------------------------------------------------------------
  Merged /openoffice/trunk/main:r1580779

Modified: openoffice/branches/AOO410/main/vcl/aqua/source/gdi/ctlayout.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/vcl/aqua/source/gdi/ctlayout.cxx?rev=1580780&r1=1580779&r2=1580780&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/vcl/aqua/source/gdi/ctlayout.cxx (original)
+++ openoffice/branches/AOO410/main/vcl/aqua/source/gdi/ctlayout.cxx Mon Mar 24 
07:51:46 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);


Reply via email to