summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/outdev3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/outdev3.cxx')
-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();