sc/source/filter/excel/impop.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit f5d0aac2b413ccedb10b0309451b79d5d9488ef3
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Oct 16 20:57:36 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Oct 17 12:11:00 2024 +0200

    cid#1606594 silence Overflowed constant
    
    Change-Id: I1aff57f76eac334feea9fba02233b9b004ca759c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175063
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 38159100c589..bc6a904c589c 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -471,11 +471,8 @@ void ImportExcel:: WinProtection()
 
 void ImportExcel::Columndefault()
 {// Default Cell Attributes
-    sal_uInt16  nColMic, nColMac;
-    sal_uInt8   nOpt0;
-
-    nColMic = aIn.ReaduInt16();
-    nColMac = aIn.ReaduInt16();
+    sal_uInt16 nColMic = aIn.ReaduInt16();
+    sal_uInt16 nColMac = aIn.ReaduInt16();
 
     OSL_ENSURE( aIn.GetRecLeft() == static_cast<std::size_t>(nColMac - 
nColMic) * 3 + 2,
                 "ImportExcel::Columndefault - wrong record size" );
@@ -486,6 +483,8 @@ void ImportExcel::Columndefault()
         return;
     }
 
+    assert(nColMac > 0 && "coverity 2023.12.2");
+
     nColMac--;
 
     if( nColMac > rD.MaxCol() )
@@ -493,7 +492,7 @@ void ImportExcel::Columndefault()
 
     for( sal_uInt16 nCol = nColMic ; nCol <= nColMac ; nCol++ )
     {
-        nOpt0 = aIn.ReaduInt8();
+        sal_uInt8 nOpt0 = aIn.ReaduInt8();
         aIn.Ignore( 2 );   // only 0. Attribute-Byte used
 
         if( nOpt0 & 0x80 )  // Col hidden?

Reply via email to