sc/source/core/data/documen7.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8bc85cd8a6a9a879c143d8defacc45967a0ac99e
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Dec 6 19:24:13 2021 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Dec 6 21:09:47 2021 +0100

    signed-integer-overflow
    
    ...after 8406139062d9ffe1daed32aefe4e261c6c55d63e "process broadcasts for
    adjacent cells together (tdf#119083)" during e.g.
    CppunitTest_sc_ucalc_copypaste,
    
    > sc/source/core/data/documen7.cxx:143:59: runtime error: signed integer 
overflow: 2147483647 + 1 cannot be represented in type 'int'
    
    Change-Id: If848747f6b004219475b39b48c6a3de086bd1ae7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126457
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index bf0d38cb4ec9..28941db7c6d9 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -140,10 +140,10 @@ bool ScDocument::BroadcastHintInternal( const ScHint& 
rHint )
     const ScAddress address(rHint.GetStartAddress());
     SvtBroadcaster* pLastBC = nullptr;
     // Process all broadcasters for the given row range.
-    for( SCROW nRow = address.Row(); nRow < address.Row() + 
rHint.GetRowCount(); ++nRow )
+    for( SCROW nRow = 0; nRow < rHint.GetRowCount(); ++nRow )
     {
         ScAddress a(address);
-        a.SetRow(nRow);
+        a.SetRow(address.Row() + nRow);
         SvtBroadcaster* pBC = GetBroadcaster(a);
         if ( pBC && pBC != pLastBC )
         {

Reply via email to