From cba7370aab56212ca9e8def72ce821746835b4ff Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 8 May 2012 16:48:23 +0200 Subject: 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 --- vcl/source/gdi/sallayout.cxx | 2 +- vcl/win/source/gdi/winlayout.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl') 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; } -- cgit