summaryrefslogtreecommitdiff
path: root/vcl/aqua/source/gdi
diff options
context:
space:
mode:
authorhdu <duerr@sun.com>2009-09-17 13:42:15 +0200
committerhdu <duerr@sun.com>2009-09-17 13:42:15 +0200
commite5def2cead12559525567f2c80b2f642d754e327 (patch)
tree32928c79ae8a91ff5b8093db8df8d7e196bf6f93 /vcl/aqua/source/gdi
parent1f0839c836781bc41f8c301b6262eabc978c90f8 (diff)
#i104121# fix text-justification of all-spaces line
Diffstat (limited to 'vcl/aqua/source/gdi')
-rwxr-xr-xvcl/aqua/source/gdi/salatslayout.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 7ecef01cf0d5..3021e85fed5c 100755
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -302,16 +302,14 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs )
nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
// workaround for ATSUI not using trailing spaces for justification
- mnTrailingSpaceWidth = 0;
int i = mnCharCount;
- while( (--i > 0) && IsSpacingGlyph( rArgs.mpStr[mnMinCharPos+i]|GF_ISCHAR ) )
- mnTrailingSpaceWidth += rArgs.mpDXArray[i] - rArgs.mpDXArray[i-1];
- if( i <= 0 )
+ while( (--i >= 0) && IsSpacingGlyph( rArgs.mpStr[mnMinCharPos+i]|GF_ISCHAR ) ) {}
+ if( i < 0 ) // nothing to do if the text is all spaces
return;
// #i91685# trailing letters are left aligned (right aligned for RTL)
- mnTrailingSpaceWidth += rArgs.mpDXArray[i];
+ mnTrailingSpaceWidth = rArgs.mpDXArray[ mnCharCount-1 ];
if( i > 0 )
- mnTrailingSpaceWidth -= rArgs.mpDXArray[i-1];
+ mnTrailingSpaceWidth -= rArgs.mpDXArray[ i-1 ];
InitGIA(); // ensure valid mpCharWidths[]
mnTrailingSpaceWidth -= Fixed2Vcl( mpCharWidths[i] );
// ignore trailing space for calculating the available width