summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-02-16 21:43:43 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-02-21 14:47:44 +0100
commit89c4b004a748457408781972c5b6c6d44360fb3e (patch)
tree0dcc9da44ad85d0b810b915faf9aa120cbf35699 /sc
parentd2071c7d672e4a56cc44659b30bb18247baf31f9 (diff)
Handle the possible case of broadcasted row block, tdf#119083 follow-up
Though unlikely and apparently not happening, the changed ScHint may theoretically notify for a block of rows, not just one address. Do not join out-of-band rows to the dirty header columns. Change-Id: I524bcbedf063fe6b5ff5b99bc984fcb9dc02b6ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130054 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit f6b9c471cace1963e8b625ecfe2c20f5248984eb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130020 Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/dbdata.cxx23
1 files changed, 19 insertions, 4 deletions
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 5842645953d5..e441c7418796 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -933,15 +933,30 @@ void ScDBData::Notify( const SfxHint& rHint )
// multiple cells are affected. Expand the range to what this is
// listening to. Broadcasted address outside should not happen,
// but... let it trigger a refresh if.
- ScRange aHeaderRange( GetHeaderArea());
+ const ScRange aHeaderRange( GetHeaderArea());
+ ScAddress aHintAddress( pScHint->GetStartAddress());
if (aHeaderRange.IsValid())
{
mpContainer->GetDirtyTableColumnNames().Join( aHeaderRange);
- if (!aHeaderRange.In( pScHint->GetRange()))
- mpContainer->GetDirtyTableColumnNames().Join( pScHint->GetRange());
+ // Header range is one row.
+ // The ScHint's "range" is an address with row count.
+ // Though broadcasted is usually only one cell, check for the
+ // possible case of row block and for one cell in the same row.
+ if (aHintAddress.Row() <= aHeaderRange.aStart.Row()
+ && aHeaderRange.aStart.Row() < aHintAddress.Row() + pScHint->GetRowCount())
+ {
+ aHintAddress.SetRow( aHeaderRange.aStart.Row());
+ if (!aHeaderRange.In( aHintAddress))
+ mpContainer->GetDirtyTableColumnNames().Join( aHintAddress);
+ }
}
else
- mpContainer->GetDirtyTableColumnNames().Join( pScHint->GetRange());
+ {
+ // We need *some* range in the dirty list even without header area,
+ // otherwise the container would not attempt to call a refresh.
+ aHintAddress.SetRow( nStartRow);
+ mpContainer->GetDirtyTableColumnNames().Join( aHintAddress);
+ }
}
// Do not refresh column names here, which might trigger unwanted