summaryrefslogtreecommitdiff
path: root/sw/source/core/text/inftxt.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-05-20 18:02:12 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-05-20 22:38:03 +0200
commit301278b656e76b6f42af5cf8a6f5c6c02acfffeb (patch)
treea709ae2713de538eed30c15fd981e729ed926560 /sw/source/core/text/inftxt.cxx
parent6cc4750f36fb505e1d7b8d1406f170807fa55644 (diff)
sw: allow the height of a line to be larger than 65536 twips
The line height can be quite large if the line contains an as-char image. Found by temporarily changing static_cast<sal_uInt16>() in sw/ to a template function to make these conversions implicit (excluding cases where the input and output types can't convert implicitly), then asking -fsanitize=implicit-unsigned-integer-truncation -fsanitize=implicit-signed-integer-truncation to flag the problematic conversions. The first hit was in SwFlyCntPortion::SetBase() (that's where 67408 turns into 1872), then the same pattern at many other places. Change-Id: Ie12f490ed8dd5c531f11506c97598ce4f7610e2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115873 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/text/inftxt.cxx')
-rw-r--r--sw/source/core/text/inftxt.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index bb63a36ae157..261a171d3d6d 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1023,13 +1023,13 @@ void SwTextPaintInfo::DrawRedArrow( const SwLinePortion &rPor ) const
{
aRect.Pos().AdjustY(20 - GetAscent() );
aRect.Pos().AdjustX(20 );
- if( aSize.Height() > rPor.Height() )
+ if( aSize.Height() > static_cast<SwTwips>(rPor.Height()) )
aRect.Height( rPor.Height() );
cChar = CHAR_LEFT_ARROW;
}
else
{
- if( aSize.Height() > rPor.Height() )
+ if( aSize.Height() > static_cast<SwTwips>(rPor.Height()) )
aRect.Height( rPor.Height() );
aRect.Pos().AdjustY( -(aRect.Height() + 20) );
aRect.Pos().AdjustX( -(aRect.Width() + 20) );