Author: hdu
Date: Wed Jan 22 13:09:14 2014
New Revision: 1560340
URL: http://svn.apache.org/r1560340
Log:
#i123951# fix CoreText justification of an all-whitespace text
Modified:
openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx
Modified: openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx?rev=1560340&r1=1560339&r2=1560340&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx Wed Jan 22 13:09:14
2014
@@ -166,6 +166,13 @@ void CTLayout::AdjustLayout( ImplLayoutA
nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 -
mnTrailingSpaces ];
}
+ // short-circuit when justifying an all-whitespace string
+ if( mnTrailingSpaces >= mnCharCount)
+ {
+ mfCachedWidth = mfTrailingSpaceWidth = nPixelWidth /
mfFontScale;
+ return;
+ }
+
// in RTL-layouts trailing spaces are leftmost
// TODO: use BiDi-algorithm to thoroughly check this assumption
if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL)