summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/edit/texteng.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 859468fd9861..47ed32960866 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -2146,9 +2146,8 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
std::size_t nTmpPortion = pLine->GetStartPortion();
long nTmpWidth = mpDoc->GetLeftMargin();
// do not subtract margin; it is included in TmpWidth
- long nXWidth = mnMaxTextWidth ? mnMaxTextWidth : std::numeric_limits<long>::max();
- if ( nXWidth < nTmpWidth )
- nXWidth = nTmpWidth;
+ long nXWidth = std::max(
+ mnMaxTextWidth ? mnMaxTextWidth : std::numeric_limits<long>::max(), nTmpWidth);
// search for Portion that does not fit anymore into line
TETextPortion* pPortion = nullptr;