From 6e3f9d38c0bdeff606d36ce8daabd3ad8ee1b6bb Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Wed, 3 May 2017 17:22:27 +0200 Subject: lok: sc: invalidate col/row header on undo row/col operations Change-Id: Ia0b2174cfcc3f2b3075e8f6eee1eb0f56b64db44 Reviewed-on: https://gerrit.libreoffice.org/37686 Tested-by: Jenkins Reviewed-by: Marco Cecchetti --- sc/source/ui/undo/undoblk.cxx | 14 ++++++++++++++ sc/source/ui/undo/undoblk2.cxx | 10 +++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'sc/source/ui/undo') diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 291151d11a6d..1c2757c40897 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include "undoblk.hxx" #include "undoutil.hxx" @@ -257,7 +259,19 @@ void ScUndoInsertCells::DoChange( const bool bUndo ) } pDocShell->PostDataChanged(); if (pViewShell) + { pViewShell->CellContentChanged(); + + if (comphelper::LibreOfficeKit::isActive()) + { + if (eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER || eCmd == INS_CELLSRIGHT) + ScTabViewShell::notifyAllViewsHeaderInvalidation("column", pViewShell->GetViewData().GetTabNo()); + + if (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER || eCmd == INS_CELLSDOWN) + ScTabViewShell::notifyAllViewsHeaderInvalidation("row", pViewShell->GetViewData().GetTabNo()); + } + + } } void ScUndoInsertCells::Undo() diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx index 50404d5e09fc..cdf75b9f1882 100644 --- a/sc/source/ui/undo/undoblk2.cxx +++ b/sc/source/ui/undo/undoblk2.cxx @@ -30,6 +30,8 @@ #include "undoolk.hxx" +#include +#include /** Change column widths or row heights */ ScUndoWidthOrHeight::ScUndoWidthOrHeight( ScDocShell* pNewDocShell, @@ -94,6 +96,7 @@ void ScUndoWidthOrHeight::Undo() if (pUndoTab) // Outlines are included when saving ? rDoc.SetOutlineTable( nStartTab, pUndoTab ); + ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); SCTAB nTabCount = rDoc.GetTableCount(); ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end(); for (; itr != itrEnd && *itr < nTabCount; ++itr) @@ -117,7 +120,6 @@ void ScUndoWidthOrHeight::Undo() DoSdrUndoAction( pDrawUndo, &rDoc ); - ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) { pViewShell->UpdateScrollBars(); @@ -125,6 +127,12 @@ void ScUndoWidthOrHeight::Undo() SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNo(); if ( nCurrentTab < nStartTab || nCurrentTab > nEndTab ) pViewShell->SetTabNo( nStartTab ); + + if (comphelper::LibreOfficeKit::isActive()) + { + OString aPayload = bWidth ? "column" : "row"; + ScTabViewShell::notifyAllViewsHeaderInvalidation(aPayload, pViewShell->GetViewData().GetTabNo()); + } } EndUndo(); -- cgit