ctlayout.cxx (61277561) ctlayout.cxx (250ab64b)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 107 unchanged lines hidden (view full) ---

116
117 SalLayout::AdjustLayout( rArgs );
118 mnCharCount = mnEndCharPos - mnMinCharPos;
119
120 // short circuit if there is nothing to do
121 if( mnCharCount <= 0 )
122 return false;
123
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 107 unchanged lines hidden (view full) ---

116
117 SalLayout::AdjustLayout( rArgs );
118 mnCharCount = mnEndCharPos - mnMinCharPos;
119
120 // short circuit if there is nothing to do
121 if( mnCharCount <= 0 )
122 return false;
123
124 // create the CoreText line layout
124 // prepare the string to be layouted by CoreText
125 CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL, rArgs.mpStr + mnMinCharPos, mnCharCount, kCFAllocatorNull );
125 CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL, rArgs.mpStr + mnMinCharPos, mnCharCount, kCFAllocatorNull );
126 // #i124375# force soft-hyphen visibility to meet the expectations of Writer+EditEngine
127 if( CFStringFind( aCFText, (CFStringRef)@"\u00AD", 0).length > 0 )
128 {
129 NSString* pDashStr = [(NSString*)aCFText stringByReplacingOccurrencesOfString: @"\u00AD" withString: @"-"];
130 aCFText = CFStringCreateCopy( NULL, (CFStringRef)pDashStr );
131 }
132
133 // create the CoreText line layout using the requested text style
126 mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
127 mpCTLine = CTLineCreateWithAttributedString( mpAttrString );
128 CFRelease( aCFText);
129
130 // get info about trailing whitespace to prepare for text justification in AdjustLayout()
131 mnTrailingSpaceCount = 0;
132 for( int i = mnEndCharPos; --i >= mnMinCharPos; ++mnTrailingSpaceCount )
133 if( !IsSpacingGlyph( rArgs.mpStr[i] | GF_ISCHAR )

--- 398 unchanged lines hidden ---
134 mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
135 mpCTLine = CTLineCreateWithAttributedString( mpAttrString );
136 CFRelease( aCFText);
137
138 // get info about trailing whitespace to prepare for text justification in AdjustLayout()
139 mnTrailingSpaceCount = 0;
140 for( int i = mnEndCharPos; --i >= mnMinCharPos; ++mnTrailingSpaceCount )
141 if( !IsSpacingGlyph( rArgs.mpStr[i] | GF_ISCHAR )

--- 398 unchanged lines hidden ---