sc/qa/unit/tiledrendering/SheetViewTest.cxx |   33 +++++++++++++++++++++++
 sc/source/ui/undo/undoblk.cxx               |    4 +-
 sc/source/ui/undo/undoblk2.cxx              |    4 +-
 sc/source/ui/undo/undodat.cxx               |   40 ++++++++++++++--------------
 sc/source/ui/view/cliputil.cxx              |    2 -
 sc/source/ui/view/dbfunc.cxx                |    6 ++--
 sc/source/ui/view/dbfunc3.cxx               |   20 +++++++-------
 sc/source/ui/view/tabview4.cxx              |    2 -
 sc/source/ui/view/viewfun2.cxx              |    9 ++----
 sc/source/ui/view/viewfun3.cxx              |    3 ++
 sc/source/ui/view/viewfunc.cxx              |   14 ++++-----
 11 files changed, 86 insertions(+), 51 deletions(-)

New commits:
commit f89f9479f265329c23783d087fd986d2a61e4922
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Thu Oct 23 15:29:06 2025 +0900
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Mon Oct 27 06:03:46 2025 +0100

    sc: test view render state is correctly set for sheet views
    
    Adding a missing test for the recent fix.
    
    Change-Id: I7d11631255e78c75dc45682f083dafa5b9545965
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192888
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192997
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/sc/qa/unit/tiledrendering/SheetViewTest.cxx 
b/sc/qa/unit/tiledrendering/SheetViewTest.cxx
index 718e0c27b742..373d52cf2a29 100644
--- a/sc/qa/unit/tiledrendering/SheetViewTest.cxx
+++ b/sc/qa/unit/tiledrendering/SheetViewTest.cxx
@@ -698,6 +698,39 @@ CPPUNIT_TEST_FIXTURE(SheetViewTest, 
testRemoveSheetViewHolderTable)
     }
 }
 
+CPPUNIT_TEST_FIXTURE(SheetViewTest, testRenderStateInSheetView)
+{
+    // Check the View Render State is set correctly when in sheet view.
+    // When in sheet view, we expect the sheet view ID to be set in the state.
+
+    ScModelObj* pModelObj = createDoc("empty.ods");
+
+    // View 1
+    ScTestViewCallback aView1;
+
+    // View 1 - default state
+    CPPUNIT_ASSERT_EQUAL("S;Default"_ostr, pModelObj->getViewRenderState());
+
+    // View 2
+    SfxLokHelper::createView();
+    ScTestViewCallback aView2;
+
+    // View 2 - default state
+    CPPUNIT_ASSERT_EQUAL("S;Default"_ostr, pModelObj->getViewRenderState());
+
+    // Create a sheet view in View 2
+    dispatchCommand(mxComponent, u".uno:NewSheetView"_ustr, {});
+
+    // View 2 - state includes view sheet ID
+    CPPUNIT_ASSERT_EQUAL("S;Default;VS:0"_ostr, 
pModelObj->getViewRenderState());
+
+    // Switch to View 1
+    SfxLokHelper::setView(aView1.getViewID());
+
+    // View 1 - still default state
+    CPPUNIT_ASSERT_EQUAL("S;Default"_ostr, pModelObj->getViewRenderState());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d3373ccf8658d4db3b8e96fe82c6766ba9614d81
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Thu Oct 23 15:03:47 2025 +0900
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Mon Oct 27 06:03:38 2025 +0100

    sc: sheet geometry and header invalid. needs the actual tab
    
    This fixes row/column header invalidation when using the sheet
    view. Previously, because the wrong tab number was passed, the
    invalidation was not performed and the header didn't reflect the
    cells. This was especially apparent when changing the auto-filter.
    
    In the change all the sheet geometry and header invalidations are
    changed so it should also fix some other - not yet noticed bugs.
    
    Change-Id: Ia382882fedce18750dfc812793501573fff19093
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192887
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192996
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index e2eab9377aa0..4af68591acf7 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -273,7 +273,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
     if (!comphelper::LibreOfficeKit::isActive())
         return;
 
-    SCTAB nTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nTab = pViewShell->GetViewData().GetTabNumber();
     bool bColsAffected = (eCmd == INS_INSCOLS_BEFORE || eCmd == 
INS_INSCOLS_AFTER || eCmd == INS_CELLSRIGHT);
     bool bRowsAffected = (eCmd == INS_INSROWS_BEFORE || eCmd == 
INS_INSROWS_AFTER || eCmd == INS_CELLSDOWN);
 
@@ -544,7 +544,7 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
     if (!comphelper::LibreOfficeKit::isActive())
         return;
 
-    SCTAB nTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nTab = pViewShell->GetViewData().GetTabNumber();
     bool bColsAffected = (eCmd == DelCellCmd::Cols || eCmd == 
DelCellCmd::CellsLeft);
     bool bRowsAffected = (eCmd == DelCellCmd::Rows || eCmd == 
DelCellCmd::CellsUp);
 
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index da66f1045909..105929063c80 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -125,7 +125,7 @@ void ScUndoWidthOrHeight::Undo()
 
     if (pViewShell)
     {
-        SCTAB nCurrentTab = pViewShell->GetViewData().CurrentTabForData();
+        SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNumber();
         bool bAffectsVisibility = (eMode != SC_SIZE_ORIGINAL && eMode != 
SC_SIZE_VISOPT);
         ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
                 pViewShell, bWidth /* bColumns */, !bWidth /* bRows */,
@@ -156,7 +156,7 @@ void ScUndoWidthOrHeight::Redo()
     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     if (pViewShell)
     {
-        SCTAB nTab = pViewShell->GetViewData().CurrentTabForData();
+        SCTAB nTab = pViewShell->GetViewData().GetTabNumber();
         if ( nTab < nStartTab || nTab > nEndTab )
             pViewShell->SetTabNo( nStartTab );
 
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index f66c59b10135..6bdeeae2c9f6 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -87,7 +87,7 @@ void ScUndoDoOutline::Undo()
 
     // sheet has to be switched over (#46952#)!
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -125,7 +125,7 @@ void ScUndoDoOutline::Redo()
 
     // sheet has to be switched over (#46952#)!
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -186,7 +186,7 @@ void ScUndoMakeOutline::Undo()
 
     rDoc.SetOutlineTable( nTab, pUndoTable.get() );
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -291,7 +291,7 @@ void ScUndoOutlineLevel::Undo()
             true /* bGroups */, nTab);
     pViewShell->UpdateScrollBars();
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -310,7 +310,7 @@ void ScUndoOutlineLevel::Redo()
 
     // sheet has to be switched on or off before this (#46952#) !!!
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -391,7 +391,7 @@ void ScUndoOutlineBlock::Undo()
             true /* bGroups */, nTab);
     pViewShell->UpdateScrollBars();
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -483,7 +483,7 @@ void ScUndoRemoveAllOutlines::Undo()
 
     pViewShell->UpdateScrollBars();
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -510,7 +510,7 @@ void ScUndoRemoveAllOutlines::Redo()
     // sheet has to be switched over (#46952#)!
 
     SCTAB nTab = aBlockStart.Tab();
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -579,7 +579,7 @@ void ScUndoAutoOutline::Undo()
         pViewShell->UpdateScrollBars();
     }
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -599,7 +599,7 @@ void ScUndoAutoOutline::Redo()
     SCTAB nTab = aBlockStart.Tab();
     // sheet has to be switched on or off before this (#46952#) !!!
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -709,7 +709,7 @@ void ScUndoSubTotals::Undo()
     if (xUndoDB)
         rDoc.SetDBCollection(std::unique_ptr<ScDBCollection>(new 
ScDBCollection(*xUndoDB)), true);
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -727,7 +727,7 @@ void ScUndoSubTotals::Redo()
 
     BeginRedo();
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -863,7 +863,7 @@ void ScUndoQuery::Undo()
 
     DoSdrUndoAction( pDrawUndo.get(), &rDoc );
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -911,7 +911,7 @@ void ScUndoQuery::Redo()
 
     BeginRedo();
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -1174,7 +1174,7 @@ void ScUndoImportData::Undo()
         ScUndoUtil::MarkSimpleBlock( rDocShell, nCol1, nRow1, nTable, nCol2, 
nRow2, nTable );
     }
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -1246,7 +1246,7 @@ void ScUndoImportData::Redo()
         ScUndoUtil::MarkSimpleBlock( rDocShell, nCol1, nRow1, nTable, nCol2, 
nRow2, nTable );
     }
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -1411,7 +1411,7 @@ void ScUndoRepeatDB::Undo()
             false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
             false /* bGroups */, nTab);
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -1431,7 +1431,7 @@ void ScUndoRepeatDB::Redo()
 
     SCTAB nTab = aBlockStart.Tab();
 
-    SCTAB nVisTab = pViewShell->GetViewData().CurrentTabForData();
+    SCTAB nVisTab = pViewShell->GetViewData().GetTabNumber();
     if ( nVisTab != nTab )
         pViewShell->SetTabNo( nTab );
 
@@ -1689,7 +1689,7 @@ void ScUndoConsolidate::Undo()
     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     if (pViewShell)
     {
-        SCTAB nViewTab = pViewShell->GetViewData().CurrentTabForData();
+        SCTAB nViewTab = pViewShell->GetViewData().GetTabNumber();
         if ( nViewTab != nTab )
             pViewShell->SetTabNo( nTab );
     }
@@ -1706,7 +1706,7 @@ void ScUndoConsolidate::Redo()
     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     if (pViewShell)
     {
-        SCTAB nViewTab = pViewShell->GetViewData().CurrentTabForData();
+        SCTAB nViewTab = pViewShell->GetViewData().GetTabNumber();
         if ( nViewTab != aParam.nTab )
             pViewShell->SetTabNo( aParam.nTab );
     }
diff --git a/sc/source/ui/view/cliputil.cxx b/sc/source/ui/view/cliputil.cxx
index 9d02384b4b3d..60bda414522c 100644
--- a/sc/source/ui/view/cliputil.cxx
+++ b/sc/source/ui/view/cliputil.cxx
@@ -135,7 +135,7 @@ void ScClipUtil::PasteFromClipboard( ScViewData& rViewData, 
ScTabViewShell* pTab
 
             ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
                 pTabViewShell, true /* bColumns */, true /* bRows */, true /* 
bSizes*/,
-                true /* bHidden */, true /* bFiltered */, true /* bGroups */, 
nThisTab);
+                true /* bHidden */, true /* bFiltered */, true /* bGroups */, 
rViewData.GetTabNumber());
         }
     }
     pTabViewShell->CellContentChanged();        // => PasteFromSystem() ???
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index bf317492b961..17e3e5028b71 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -263,7 +263,7 @@ void ScDBFunc::Query( const ScQueryParam& rQueryParam, 
const ScRange* pAdvSource
             GetViewData().GetViewShell(),
             false /* bColumns */, true /* bRows */,
             false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
-            false /* bGroups */, nTab);
+            false /* bGroups */, GetViewData().GetTabNumber());
         UpdateScrollBars(ROW_HEADER);
         SelectionChanged();     // for attribute states (filtered rows are 
ignored)
     }
@@ -305,7 +305,7 @@ void ScDBFunc::ToggleAutoFilter()
             bHasAuto = false;
     }
 
-    if (bHasAuto)                               // remove
+    if (bHasAuto) // remove
     {
         //  hide filter buttons
 
@@ -485,7 +485,7 @@ bool ScDBFunc::ImportData( const ScImportParam& rParam )
 {
     ScDocument& rDoc = GetViewData().GetDocument();
 
-    ScEditableTester aTester = ScEditableTester::CreateAndTestBlock(rDoc, 
GetViewData().CurrentTabForData(), 
+    ScEditableTester aTester = ScEditableTester::CreateAndTestBlock(rDoc, 
GetViewData().CurrentTabForData(),
                                     rParam.nCol1, rParam.nRow1, rParam.nCol2, 
rParam.nRow2);
     if ( !aTester.IsEditable() )
     {
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index f7d0b4ae2968..961976d5eca7 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -93,11 +93,11 @@ void ScDBFunc::MakeOutline( bool bColumns, bool bRecord )
         ScOutlineDocFunc aFunc(rDocSh);
         aFunc.MakeOutline( aRange, bColumns, bRecord, false );
 
-        
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
bColumns ? COLUMN_HEADER : ROW_HEADER, GetViewData().CurrentTabForData());
+        
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
bColumns ? COLUMN_HEADER : ROW_HEADER, GetViewData().GetTabNumber());
         
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
                                                             bColumns, 
!bColumns, false /* bSizes*/,
                                                             false /* bHidden 
*/, false /* bFiltered */,
-                                                            true /* bGroups 
*/, GetViewData().CurrentTabForData());
+                                                            true /* bGroups 
*/, GetViewData().GetTabNumber());
     }
     else
         ErrorMessage(STR_NOMULTISELECT);
@@ -114,11 +114,11 @@ void ScDBFunc::RemoveOutline( bool bColumns, bool bRecord 
)
         ScOutlineDocFunc aFunc(rDocSh);
         aFunc.RemoveOutline( aRange, bColumns, bRecord, false );
 
-        
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
bColumns ? COLUMN_HEADER : ROW_HEADER, GetViewData().CurrentTabForData());
+        
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
bColumns ? COLUMN_HEADER : ROW_HEADER, GetViewData().GetTabNumber());
         
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
                                                             bColumns, 
!bColumns, false /* bSizes*/,
                                                             true /* bHidden 
*/, true /* bFiltered */,
-                                                            true /* bGroups 
*/, GetViewData().CurrentTabForData());
+                                                            true /* bGroups 
*/, GetViewData().GetTabNumber());
     }
     else
         ErrorMessage(STR_NOMULTISELECT);
@@ -202,7 +202,7 @@ void ScDBFunc::RemoveAllOutlines( bool bRecord )
         
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
                                                             true /* bColumns 
*/, true /* bRows */, false /* bSizes*/,
                                                             true /* bHidden 
*/, true /* bFiltered */,
-                                                            true /* bGroups 
*/, nTab);
+                                                            true /* bGroups 
*/, GetViewData().GetTabNumber());
         UpdateScrollBars(BOTH_HEADERS);
     }
 }
@@ -241,7 +241,7 @@ void ScDBFunc::SelectLevel( bool bColumns, sal_uInt16 
nLevel, bool bRecord )
         
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
                                                             bColumns, 
!bColumns, false /* bSizes*/,
                                                             true /* bHidden 
*/, true /* bFiltered */,
-                                                            true /* bGroups 
*/, nTab);
+                                                            true /* bGroups 
*/, GetViewData().GetTabNumber());
         UpdateScrollBars(bColumns ? COLUMN_HEADER : ROW_HEADER);
     }
 }
@@ -275,7 +275,7 @@ void ScDBFunc::ShowOutline( bool bColumns, sal_uInt16 
nLevel, sal_uInt16 nEntry,
         
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
                                                             bColumns, 
!bColumns, false /* bSizes*/,
                                                             true /* bHidden 
*/, true /* bFiltered */,
-                                                            true /* bGroups 
*/, nTab);
+                                                            true /* bGroups 
*/, GetViewData().GetTabNumber());
         UpdateScrollBars(bColumns ? COLUMN_HEADER : ROW_HEADER);
     }
 }
@@ -295,7 +295,7 @@ void ScDBFunc::HideOutline( bool bColumns, sal_uInt16 
nLevel, sal_uInt16 nEntry,
         
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
                                                             bColumns, 
!bColumns, false /* bSizes*/,
                                                             true /* bHidden 
*/, true /* bFiltered */,
-                                                            true /* bGroups 
*/, nTab);
+                                                            true /* bGroups 
*/, GetViewData().GetTabNumber());
         UpdateScrollBars(bColumns ? COLUMN_HEADER : ROW_HEADER);
     }
 }
@@ -393,7 +393,7 @@ void ScDBFunc::ShowMarkedOutlines( bool bRecord )
             ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
                 GetViewData().GetViewShell(), true, true,
                 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
-                true /* bGroups */, GetViewData().CurrentTabForData());
+                true /* bGroups */, GetViewData().GetTabNumber());
             UpdateScrollBars();
         }
     }
@@ -416,7 +416,7 @@ void ScDBFunc::HideMarkedOutlines( bool bRecord )
             ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
                 GetViewData().GetViewShell(), true, true,
                 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
-                true /* bGroups */, GetViewData().CurrentTabForData());
+                true /* bGroups */, GetViewData().GetTabNumber());
             UpdateScrollBars();
         }
     }
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 1a5b810d45fc..72469070bc13 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -469,7 +469,7 @@ static tools::Long lcl_GetScrollRange( SCCOLROW nDocEnd, 
SCCOLROW nPos, SCCOLROW
 
 void ScTabView::UpdateScrollBars( HeaderType eHeaderType )
 {
-    
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
eHeaderType, GetViewData().CurrentTabForData());
+    
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
eHeaderType, GetViewData().GetTabNumber());
 
     tools::Long        nDiff;
     bool        bTop =   ( aViewData.GetVSplitMode() != SC_SPLIT_NONE );
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index ccb13f166a98..d54b3355d083 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -177,13 +177,12 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, 
ScMarkData* pMarkData )
 
     if (comphelper::LibreOfficeKit::isActive())
     {
-        SCTAB nTab = GetViewData().CurrentTabForData();
         ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
                 GetViewData().GetViewShell(),
                 false /* bColumns */, true /* bRows */,
                 true /* bSizes*/, false /* bHidden */, false /* bFiltered */,
-                false /* bGroups */, nTab);
-        
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
ROW_HEADER, nTab);
+                false /* bGroups */, GetViewData().GetTabNumber());
+        
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
ROW_HEADER, GetViewData().GetTabNumber());
     }
 
     return bAnyChanged;
@@ -238,8 +237,8 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW 
nEndRow, bool bApi )
                 GetViewData().GetViewShell(),
                 false /* bColumns */, true /* bRows */,
                 true /* bSizes*/, false /* bHidden */, false /* bFiltered */,
-                false /* bGroups */, nTab);
-        
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
ROW_HEADER, GetViewData().CurrentTabForData());
+                false /* bGroups */, GetViewData().GetTabNumber());
+        
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
ROW_HEADER, GetViewData().GetTabNumber());
     }
 
     return bChanged;
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index af92ca4c2b68..799071fbdb7d 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -69,6 +69,7 @@
 #include <sfx2/lokhelper.hxx>
 #include <sc.hrc>
 #include <sfx2/bindings.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
 using namespace com::sun::star;
 
@@ -2075,6 +2076,8 @@ void ScViewFunc::SheetViewChanged()
     {
         ScModelObj* pModel = 
comphelper::getFromUnoTunnel<ScModelObj>(pViewShell->GetCurrentDocument());
         SfxLokHelper::notifyViewRenderState(pViewShell, pModel);
+        pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_HEADER, 
"all"_ostr);
+        
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY, 
"all"_ostr);
     }
     SfxBindings& rBindings = rViewData.GetBindings();
     rBindings.Invalidate(FID_CURRENT_SHEET_VIEW);
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 5bbec50f0eb8..d1526d043a4c 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1964,15 +1964,15 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool 
bRecord, bool bPartOfPaste,
             if (comphelper::LibreOfficeKit::isActive())
             {
                 if (bInsertCols)
-                    
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
COLUMN_HEADER, GetViewData().CurrentTabForData());
+                    
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
COLUMN_HEADER, GetViewData().GetTabNumber());
 
                 if (bInsertRows)
-                    
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
ROW_HEADER, GetViewData().CurrentTabForData());
+                    
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
ROW_HEADER, GetViewData().GetTabNumber());
 
                 
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
                                                                     
bInsertCols, bInsertRows, true /* bSizes*/,
                                                                     true /* 
bHidden */, true /* bFiltered */,
-                                                                    true /* 
bGroups */, GetViewData().CurrentTabForData());
+                                                                    true /* 
bGroups */, GetViewData().GetTabNumber());
             }
         }
         else
@@ -2054,15 +2054,15 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
             bool bColsDeleted = (eCmd == DelCellCmd::Cols);
             bool bRowsDeleted = (eCmd == DelCellCmd::Rows);
             if (bColsDeleted)
-                
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
COLUMN_HEADER, GetViewData().CurrentTabForData());
+                
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
COLUMN_HEADER, GetViewData().GetTabNumber());
 
             if (bRowsDeleted)
-                
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
ROW_HEADER, GetViewData().CurrentTabForData());
+                
ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), 
ROW_HEADER, GetViewData().GetTabNumber());
 
             
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
                                                                 bColsDeleted, 
bRowsDeleted, true /* bSizes*/,
                                                                 true /* 
bHidden */, true /* bFiltered */,
-                                                                true /* 
bGroups */, GetViewData().CurrentTabForData());
+                                                                true /* 
bGroups */, GetViewData().GetTabNumber());
         }
     }
     else
@@ -2637,7 +2637,7 @@ void ScViewFunc::SetWidthOrHeight(
     
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(GetViewData().GetViewShell(),
             bWidth /* bColumns */, !bWidth /* bRows */,
             true /* bSizes*/, bAffectsVisibility /* bHidden */, 
bAffectsVisibility /* bFiltered */,
-            false /* bGroups */, nCurTab);
+            false /* bGroups */, GetViewData().GetTabNumber());
     GetViewData().GetView()->UpdateScrollBars(bWidth ? COLUMN_HEADER : 
ROW_HEADER);
 
     {

Reply via email to