editeng/source/editeng/impedit.hxx |   14 ++++++--------
 include/o3tl/unit_conversion.hxx   |    1 +
 sw/inc/view.hxx                    |   29 +++++++++--------------------
 vcl/source/outdev/map.cxx          |    2 ++
 4 files changed, 18 insertions(+), 28 deletions(-)

New commits:
commit 2b8394b36bf1602ca3f33a00dacd18329cc91d2d
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Nov 14 13:12:46 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Nov 16 22:55:53 2024 +0100

    cid#1606752 silence Overflowed return value
    
    and
    
    cid#1607158 Overflowed return value
    cid#1607271 Overflowed return value
    cid#1608107 Overflowed return value
    cid#1606975 Overflowed return value
    cid#1608009 Overflowed return value
    cid#1608353 Overflowed return value
    cid#1608486 Overflowed return value
    cid#1607009 Overflowed return value
    cid#1606780 Overflowed return value
    
    its totally unclear what the source of these warnings is
    
    Change-Id: If46cac6a329dec397bd784f57d9ffe5e53af9a1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176683
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index aa2846126c23..a76d50855d9c 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -228,7 +228,9 @@ public:
 
     tools::Long GetVisDocLeft() const { return maVisDocStartPos.X(); }
     tools::Long GetVisDocTop() const  { return maVisDocStartPos.Y(); }
+    // coverity[ tainted_data_return : FALSE ] version 2023.12.2
     tools::Long GetVisDocRight() const  { return maVisDocStartPos.X() + 
(!IsVertical() ? maOutArea.GetWidth() : maOutArea.GetHeight()); }
+    // coverity[ tainted_data_return : FALSE ] version 2023.12.2
     tools::Long GetVisDocBottom() const { return maVisDocStartPos.Y() + 
(!IsVertical() ? maOutArea.GetHeight() : maOutArea.GetWidth()); }
     tools::Rectangle GetVisDocArea() const;
 
@@ -387,14 +389,10 @@ public:
 
     tools::Long GetVisDocLeft() const { return maVisDocStartPos.X(); }
     tools::Long GetVisDocTop() const { return maVisDocStartPos.Y(); }
-    tools::Long GetVisDocRight() const
-    {
-        return maVisDocStartPos.X() + ( !IsVertical() ? 
maOutputArea.GetWidth() : maOutputArea.GetHeight() );
-    }
-    tools::Long GetVisDocBottom() const
-    {
-        return maVisDocStartPos.Y() + ( !IsVertical() ? 
maOutputArea.GetHeight() : maOutputArea.GetWidth() );
-    }
+    // coverity[ tainted_data_return : FALSE ] version 2023.12.2
+    tools::Long GetVisDocRight() const  { return maVisDocStartPos.X() + ( 
!IsVertical() ? maOutputArea.GetWidth() : maOutputArea.GetHeight() ); }
+    // coverity[ tainted_data_return : FALSE ] version 2023.12.2
+    tools::Long GetVisDocBottom() const { return maVisDocStartPos.Y() + ( 
!IsVertical() ? maOutputArea.GetHeight() : maOutputArea.GetWidth() ); }
     tools::Rectangle       GetVisDocArea() const;
 
     const EditSelection&  GetEditSelection() const { return maEditSelection; }
diff --git a/include/o3tl/unit_conversion.hxx b/include/o3tl/unit_conversion.hxx
index 54eb8cd246eb..5f78d2ef32c6 100644
--- a/include/o3tl/unit_conversion.hxx
+++ b/include/o3tl/unit_conversion.hxx
@@ -103,6 +103,7 @@ constexpr sal_Int64 MulDivSaturate(I n, sal_Int64 m, 
sal_Int64 d)
         {
             if (m > d && std::make_unsigned_t<I>(n) > sal_uInt64(SAL_MAX_INT64 
/ m * d - d_2))
                 return SAL_MAX_INT64; // saturate
+            // coverity[ tainted_data_return : FALSE ] version 2023.12.2
             return saturating_add<sal_uInt64>(n, d_2) / d * m; // divide 
before multiplication
         }
         else if constexpr (std::is_signed_v<I>) // n < 0; don't compile for 
unsigned n
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 9d096d9171d8..c57d8d228f92 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -294,8 +294,11 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
 
     DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
 
-    inline tools::Long                  GetXScroll() const;
-    inline tools::Long                  GetYScroll() const;
+    // coverity[ tainted_data_return : FALSE ] version 2023.12.2
+    tools::Long GetXScroll() const { return (m_aVisArea.GetWidth() * nScrollX) 
/ 100; }
+    // coverity[ tainted_data_return : FALSE ] version 2023.12.2
+    tools::Long GetYScroll() const { return (m_aVisArea.GetHeight() * 
nScrollY) / 100; }
+
     SAL_DLLPRIVATE Point         AlignToPixel(const Point& rPt) const;
     SAL_DLLPRIVATE void          CalcPt( Point* pPt,const tools::Rectangle& 
rRect,
                                     sal_uInt16 nRangeX,
@@ -590,9 +593,10 @@ public:
     }
 
     // hand over Shell
-                 SfxShell       *GetCurShell()  { return m_pShell; }
-                 SwDocShell     *GetDocShell();
-    inline const SwDocShell     *GetDocShell() const;
+    SfxShell       *GetCurShell()  { return m_pShell; }
+    SwDocShell     *GetDocShell();
+    const SwDocShell *GetDocShell() const { return 
const_cast<SwView*>(this)->GetDocShell(); }
+
     virtual       FmFormShell    *GetFormShell()       override { return 
m_pFormShell; }
     virtual const FmFormShell    *GetFormShell() const override { return 
m_pFormShell; }
 
@@ -738,21 +742,6 @@ public:
     void BringToAttention(const SwNode* pNode);
 };
 
-inline tools::Long SwView::GetXScroll() const
-{
-    return (m_aVisArea.GetWidth() * nScrollX) / 100;
-}
-
-inline tools::Long SwView::GetYScroll() const
-{
-    return (m_aVisArea.GetHeight() * nScrollY) / 100;
-}
-
-inline const SwDocShell *SwView::GetDocShell() const
-{
-    return const_cast<SwView*>(this)->GetDocShell();
-}
-
 std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, 
weld::DialogController* pController,
                                           const SfxItemSet &rOptions,
                                           bool bPreview);
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 487088bd6014..eec697efcc53 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -277,6 +277,7 @@ tools::Long OutputDevice::ImplLogicXToDevicePixel( 
tools::Long nX ) const
     if ( !mbMap )
         return nX+mnOutOffX;
 
+    // coverity[ tainted_data_return : FALSE ] version 2023.12.2
     return ImplLogicToPixel( nX + maMapRes.mnMapOfsX, mnDPIX,
                              maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX 
)+mnOutOffX+mnOutOffOrigX;
 }
@@ -286,6 +287,7 @@ tools::Long OutputDevice::ImplLogicYToDevicePixel( 
tools::Long nY ) const
     if ( !mbMap )
         return nY+mnOutOffY;
 
+    // coverity[ tainted_data_return : FALSE ] version 2023.12.2
     return ImplLogicToPixel( nY + maMapRes.mnMapOfsY, mnDPIY,
                              maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY 
)+mnOutOffY+mnOutOffOrigY;
 }

Reply via email to