diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-05-08 16:48:23 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-05-08 17:28:19 +0200 |
commit | cba7370aab56212ca9e8def72ce821746835b4ff (patch) | |
tree | 5634df7a3a4d48457f4f9bbe4f0282d0b978234d | |
parent | dc0d9e802a5a243dda684cc670e4ef1de9853fc7 (diff) |
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
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 2 | ||||
-rw-r--r-- | vcl/win/source/gdi/winlayout.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index c23c32534914..d25a4b1602a2 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -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; } diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index fa804d19089a..a6387eb4235a 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -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; } |