diff options
author | Aron Budea <aron.budea@collabora.com> | 2023-12-03 19:22:17 +1030 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-04 21:28:46 +0100 |
commit | c822a05625da33479527e11a80fe44d3d7b504c8 (patch) | |
tree | da56b47a20a7d1e5016f4146d9ace22fb7fbfa80 /sc | |
parent | 708e379994591c6e73f07bd2aba136841c9cf036 (diff) |
lok: Notify all tabs in the range
34d5abf464dfbf4bdc36f6b87e606c84a1f4d99d restricted this to the
first tab, but PostPaint(...) is sometimes called with a
0..9999 tab range, even if the change only affected somewhere
in between.
In addition, restrict range end to the last actual tab in the
spreadsheet.
Change-Id: I44a7bb351e17bf85b13fedfe2a9f3d76543c4372
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160253
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 4d30910523bccb3b965f254401e6341af2ee8704)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160182
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 788aac9af86e..96546d11a5fe 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -110,12 +110,13 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa { ScRangeList aPaintRanges; std::set<SCTAB> aTabsInvalidated; + const SCTAB nMaxTab = m_pDocument->GetTableCount() - 1; for (size_t i = 0, n = rRanges.size(); i < n; ++i) { const ScRange& rRange = rRanges[i]; SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col(); SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row(); - SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab(); + SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = std::min<SCTAB>(nMaxTab, rRange.aEnd.Tab()); if (!m_pDocument->ValidCol(nCol1)) nCol1 = m_pDocument->MaxCol(); if (!m_pDocument->ValidRow(nRow1)) nRow1 = m_pDocument->MaxRow(); @@ -168,7 +169,8 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa } } aPaintRanges.push_back(ScRange(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2)); - aTabsInvalidated.insert(nTab1); + for (auto nTabNum = nTab1; nTabNum <= nTab2; ++nTabNum) + aTabsInvalidated.insert(nTabNum); } Broadcast(ScPaintHint(aPaintRanges.Combine(), nPart)); |