Kaydet (Commit) cba7370a authored tarafından Miklos Vajna's avatar Miklos Vajna

n#757651 vcl: sync GenericSalLayout and SimpleWinLayout with MultiSalLayout

These are all derived from the SalLayout interface, with a similar
GetTextBreak() implementation. MultiSalLayout didn't break text that had
exactly the same length as the available space, the other two did. Fix
this inconsistency.

Change-Id: Icd9a81e039492bee82c28b8d8582e3a161dfd283
üst dc0d9e80
......@@ -1263,7 +1263,7 @@ int GenericSalLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor
for( int i = mnMinCharPos; i < mnEndCharPos; ++i )
{
nWidth += pCharWidths[ i - mnMinCharPos ] * nFactor;
if( nWidth >= nMaxWidth )
if( nWidth > nMaxWidth )
return i;
nWidth += nCharExtra;
}
......
......@@ -721,7 +721,7 @@ int SimpleWinLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor
continue;
// add char widths until max
nExtraWidth += mpCharWidths[ n ] * nFactor;
if( nExtraWidth >= nMaxWidth )
if( nExtraWidth > nMaxWidth )
return (mnMinCharPos + n);
nExtraWidth += nCharExtra;
}
......
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