summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-07-07 11:58:42 +0200
committerMichael Meeks <michael.meeks@suse.com>2013-07-08 08:54:56 +0000
commit4d268e8302d13b81494305eab68e60ab6d0ef264 (patch)
tree7a67ea47dff571b3f3de398738c65eea9b273cc0 /vcl
parent5430b9e0f4082025ff9bf7621d18292db0361121 (diff)
fdo#66478: sw: un-break hyphenation
The main problem is calling SetHyphPos with a stack pointer. Converting STRING_LEN <-> -1 can't hurt though. (regression from a2f6402b1fe769a430019042e14e63c9414715dc) Change-Id: I59a4e3b16b418082de468c7d7f7f38a9b0bccd01 (cherry picked from commit 6fa07d2d608646004bc45261275c4ebabb578a09) Reviewed-on: https://gerrit.libreoffice.org/4757 Reviewed-by: Michael Meeks <michael.meeks@suse.com> Tested-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/outdev3.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 3b8e3c539828..8304746141e9 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6156,10 +6156,14 @@ xub_StrLen OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
if( nExtraPixelWidth > 0 )
nTextPixelWidth -= nExtraPixelWidth;
- rHyphenatorPos = sal::static_int_cast<sal_Int32>(pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor ));
+ // why does this return "int" and use STRING_LEN for errors???
+ xub_StrLen nTmp = sal::static_int_cast<xub_StrLen>(
+ pSalLayout->GetTextBreak(nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor));
- if( rHyphenatorPos > nRetVal )
- rHyphenatorPos = nRetVal;
+ nTmp = std::min(nTmp, nRetVal);
+
+ // TODO: remove nTmp when GetTextBreak sal_Int32
+ rHyphenatorPos = (nTmp == STRING_LEN) ? -1 : nTmp;
}
pSalLayout->Release();