Kaydet (Commit) 269a448f authored tarafından Herbert Dürr's avatar Herbert Dürr

#i123951# fix CoreText justification of an all-whitespace text

üst 14b36850
...@@ -166,6 +166,13 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) ...@@ -166,6 +166,13 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 - mnTrailingSpaces ]; 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 // in RTL-layouts trailing spaces are leftmost
// TODO: use BiDi-algorithm to thoroughly check this assumption // TODO: use BiDi-algorithm to thoroughly check this assumption
if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL) if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment