From 098df8583bc8d4a8d0210525f05f69b460386a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 21 May 2022 17:31:48 +0100 Subject: [PATCH] ofz#47559 Integer-overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setLinearPosX already takes a double so use that type for nOffset, use DeviceCoordinate as the types where that is the type of the source data Change-Id: I411d5034a42648bab94d6b8789bbdd172d0cf841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134713 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/inc/impglyphitem.hxx | 14 +++++++------- vcl/source/gdi/sallayout.cxx | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx index 18764cede500..7c3aa88849df 100644 --- a/vcl/inc/impglyphitem.hxx +++ b/vcl/inc/impglyphitem.hxx @@ -52,18 +52,18 @@ template <> struct typed_flags : is_typed_flags::iterator pGlyphIter = m_GlyphItems.begin(), pGlyphIterEnd = m_GlyphItems.end(); @@ -437,7 +437,7 @@ void GenericSalLayout::ApplyAsianKerning(const OUString& rStr) continue; // apply punctuation compression to logical glyph widths - int nDelta = (nKernCurrent < nKernNext) ? nKernCurrent : nKernNext; + DeviceCoordinate nDelta = (nKernCurrent < nKernNext) ? nKernCurrent : nKernNext; if (nDelta < 0) { nDelta = (nDelta * pGlyphIter->origWidth() + 2) / 4;