cui/source/dialogs/zoom.cxx             |    7 ++++++-
 dbaccess/source/ui/dlg/dlgsize.cxx      |    5 ++++-
 svtools/source/control/ctrlbox.cxx      |    7 ++++++-
 svx/source/tbxctrls/fontworkgallery.cxx |    5 ++++-
 4 files changed, 20 insertions(+), 4 deletions(-)

New commits:
commit 59b496f0d9e0c15d41795c1233f576476dc81ab2
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Oct 18 20:07:42 2025 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Oct 19 12:41:08 2025 +0200

    cid#1667062 silence Overflowed return value
    
    and
    
    cid#1667089 Overflowed return value
    cid#1667091 Overflowed return value
    cid#1667096 Overflowed return value
    
    Change-Id: I114543d7d31bba52f206f132548ffbcdf4b2fc51
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192653
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 15c8bdc44687..88b12baae3ec 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <osl/diagnose.h>
+#include <o3tl/untaint.hxx>
 #include <svl/itemset.hxx>
 #include <sfx2/objsh.hxx>
 #include <zoom.hxx>
@@ -37,7 +38,11 @@ sal_uInt16 SvxZoomDialog::GetFactor() const
         return 100;
 
     if (m_xUserBtn->get_active())
-        return 
static_cast<sal_uInt16>(m_xUserEdit->get_value(FieldUnit::PERCENT));
+    {
+        sal_Int64 ret = m_xUserEdit->get_value(FieldUnit::PERCENT);
+        o3tl::untaint_for_overrun(ret);
+        return static_cast<sal_uInt16>(ret);
+    }
     else
         return SPECIAL_FACTOR;
 }
diff --git a/dbaccess/source/ui/dlg/dlgsize.cxx 
b/dbaccess/source/ui/dlg/dlgsize.cxx
index ad1d1e4f5dc5..8741f01f26cc 100644
--- a/dbaccess/source/ui/dlg/dlgsize.cxx
+++ b/dbaccess/source/ui/dlg/dlgsize.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <dlgsize.hxx>
+#include <o3tl/untaint.hxx>
 
 namespace dbaui
 {
@@ -60,7 +61,9 @@ sal_Int32 DlgSize::GetValue() const
 {
     if (m_xCB_STANDARD->get_active())
         return -1;
-    return static_cast<sal_Int32>(m_xMF_VALUE->get_value( FieldUnit::CM ));
+    sal_Int64 ret = m_xMF_VALUE->get_value(FieldUnit::CM);
+    o3tl::untaint_for_overrun(ret);
+    return static_cast<sal_Int32>(ret);
 }
 
 IMPL_LINK_NOARG(DlgSize, CbClickHdl, weld::Toggleable&, void)
diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 55f1893ebce6..0e93fb59aa65 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -23,6 +23,7 @@
 #include <comphelper/lok.hxx>
 #include <i18nutil/unicode.hxx>
 #include <o3tl/test_info.hxx>
+#include <o3tl/untaint.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <tools/stream.hxx>
 #include <vcl/customweld.hxx>
@@ -1395,7 +1396,11 @@ int FontSizeBox::get_value() const
         FontSizeNames 
aFontSizeNames(Application::GetSettings().GetUILanguageTag().getLanguageType());
         auto nValue = aFontSizeNames.Name2Size(aStr);
         if (nValue)
-            return vcl::ConvertValue(nValue, 0, GetDecimalDigits(), GetUnit(), 
GetUnit());
+        {
+            sal_Int64 ret = vcl::ConvertValue(nValue, 0, GetDecimalDigits(), 
GetUnit(), GetUnit());
+            o3tl::untaint_for_overrun(ret);
+            return ret;
+        }
     }
 
     const SvtSysLocale aSysLocale;
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx 
b/svx/source/tbxctrls/fontworkgallery.cxx
index a6181d3acf8b..b00b5a520870 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -26,6 +26,7 @@
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/frame/ModuleManager.hpp>
 
+#include <o3tl/untaint.hxx>
 #include <vcl/toolbox.hxx>
 #include <vcl/virdev.hxx>
 
@@ -814,7 +815,9 @@ 
FontworkCharacterSpacingDialog::~FontworkCharacterSpacingDialog()
 
 sal_Int32 FontworkCharacterSpacingDialog::getScale() const
 {
-    return static_cast<sal_Int32>(m_xMtrScale->get_value(FieldUnit::PERCENT));
+    sal_Int64 ret = m_xMtrScale->get_value(FieldUnit::PERCENT);
+    o3tl::untaint_for_overrun(ret);
+    return static_cast<sal_Int32>(ret);
 }
 
 }

Reply via email to