sc/source/core/data/attarray.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 2d65d52bd208acde60e77ec49b995958985babe7
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Oct 27 17:24:15 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Oct 27 20:19:42 2024 +0100

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

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 94b9153b1c41..852db370cf54 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1807,6 +1807,8 @@ void ScAttrArray::FindStyleSheet( const 
SfxStyleSheetBase* pStyleSheet, ScFlatBo
     SCSIZE nPos = 0;
     while (nPos < mvData.size())
     {
+        bool bIterateNext = true;
+
         SCROW nEnd = mvData[nPos].nEndRow;
         if (mvData[nPos].getScPatternAttr()->GetStyleSheet() == pStyleSheet)
         {
@@ -1825,12 +1827,14 @@ void ScAttrArray::FindStyleSheet( const 
SfxStyleSheetBase* pStyleSheet, ScFlatBo
                 if (Concat(nPos))
                 {
                     Search(nStart, nPos);
-                    --nPos;   // because ++ at end
+                    bIterateNext = false; // because ++ at end otherwise
                 }
             }
         }
         nStart = nEnd + 1;
-        ++nPos;
+
+        if (bIterateNext)
+            ++nPos;
     }
 }
 

Reply via email to