[Libreoffice-commits] .: vcl/source vcl/win
Miklos Vajna
vmiklos at kemper.freedesktop.org
Tue May 8 08:28:25 PDT 2012
vcl/source/gdi/sallayout.cxx | 2 +-
vcl/win/source/gdi/winlayout.cxx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit cba7370aab56212ca9e8def72ce821746835b4ff
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue May 8 16:48:23 2012 +0200
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
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index c23c325..d25a4b1 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 fa804d1..a6387eb 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;
}
More information about the Libreoffice-commits
mailing list