summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-04-20 12:48:59 +0200
committerJan Holesovsky <kendy@collabora.com>2017-04-21 15:35:22 +0200
commit5751291e8cefea4d07b701c51051fc06ce14486e (patch)
tree5a29a59b88a0ba566e4ecbf44e4fa76555861c14 /sc
parentf0340e3dca1091accdb71e0c566b96cdf9e0f791 (diff)
LOK - Calc: changed the way header is updated on row/col insert/remove
This patch introduce a new LOK callback for informing the client that the row/col header is no more valid and needs to be updated. Change-Id: I21a3a41d69bd1a3c11c9ffaf1d7d53dbc3b9681d Reviewed-on: https://gerrit.libreoffice.org/36733 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/viewfunc.cxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 7d4720bbbad7..9c3ff1118dbd 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -78,6 +78,7 @@
#include "tokenarray.hxx"
#include <rowheightcontext.hxx>
#include <docfuncutil.hxx>
+#include <sfx2/lokhelper.hxx>
#include <memory>
@@ -1458,17 +1459,26 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste )
bool bSuccess = pDocSh->GetDocFunc().InsertCells( aRange, &rMark, eCmd, bRecord, false, bPartOfPaste );
if (bSuccess)
{
+ bool bInsertCols = ( eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER);
+ bool bInsertRows = ( eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER );
+
pDocSh->UpdateOle(&GetViewData());
CellContentChanged();
ResetAutoSpell();
- if ( eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSROWS_AFTER || eCmd == INS_INSCOLS_AFTER )
+ if ( bInsertCols || bInsertRows )
{
- OUString aOperation = ( eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER ) ?
+ OUString aOperation = bInsertRows ?
OUString("insert-rows"):
OUString("insert-columns");
HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, aRange, aOperation);
}
+
+ if (bInsertCols)
+ SfxLokHelper::notifyAllViewsHeaderInvalidation("column");
+
+ if (bInsertRows)
+ SfxLokHelper::notifyAllViewsHeaderInvalidation("row");
}
return bSuccess;
}
@@ -1535,6 +1545,12 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
else
nCurY = aRange.aStart.Row();
SetCursor( nCurX, nCurY );
+
+ if (eCmd == DEL_DELCOLS)
+ SfxLokHelper::notifyAllViewsHeaderInvalidation("column");
+
+ if (eCmd == DEL_DELROWS)
+ SfxLokHelper::notifyAllViewsHeaderInvalidation("row");
}
else
{
@@ -2128,6 +2144,12 @@ void ScViewFunc::SetWidthOrHeight(
HelperNotifyChanges::Notify(*pModelObj, aChangeRanges, "column-resize");
}
}
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OString aPayload = bWidth ? "column" : "row";
+ SfxLokHelper::notifyAllViewsHeaderInvalidation(aPayload);
+ }
}
// column width/row height (via marked range)