summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-07-04 23:19:41 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-07-05 09:36:38 +0000
commitf2f076aff2d1d21958b55938cd55f65f0d5a0aa4 (patch)
treef1bb315d1f4baf4b6edd341e61143330621bbd92
parent2bda972c0f40a0d69749504f51e3c16d7488d011 (diff)
explicitly disable partial cell shift with change-tracking, tdf#73335 related
... in ScDocFunc::InsertCells()/DeleteCells() that can be reached via API but ChangeTrack produces a SC_CAT_NONE action because the partial shift is not handled. UI slots are disabled for this. Change-Id: Ie0f992b05753bb1467d3f7a80263714bfcc1a2d7 (cherry picked from commit 9f8e2065c42f1724ac7a24f1bb0531e8c954698a) Reviewed-on: https://gerrit.libreoffice.org/26922 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/ui/docshell/docfunc.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 0ed1c8952331..6f923ba54515 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1619,6 +1619,16 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScDocShellModificator aModificator( rDocShell );
+ if (rDocShell.GetDocument().GetChangeTrack() &&
+ ((eCmd == INS_CELLSDOWN && (rRange.aStart.Col() != 0 || rRange.aEnd.Col() != MAXCOL)) ||
+ (eCmd == INS_CELLSRIGHT && (rRange.aStart.Row() != 0 || rRange.aEnd.Row() != MAXROW))))
+ {
+ // We should not reach this via UI disabled slots.
+ assert(bApi);
+ SAL_WARN("sc.ui","ScDocFunc::InsertCells - no change-tracking of partial cell shift");
+ return false;
+ }
+
ScRange aTargetRange( rRange );
// If insertion is for full cols/rows and after the current
@@ -2081,6 +2091,16 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScDocShellModificator aModificator( rDocShell );
+ if (rDocShell.GetDocument().GetChangeTrack() &&
+ ((eCmd == DEL_CELLSUP && (rRange.aStart.Col() != 0 || rRange.aEnd.Col() != MAXCOL)) ||
+ (eCmd == DEL_CELLSLEFT && (rRange.aStart.Row() != 0 || rRange.aEnd.Row() != MAXROW))))
+ {
+ // We should not reach this via UI disabled slots.
+ assert(bApi);
+ SAL_WARN("sc.ui","ScDocFunc::DeleteCells - no change-tracking of partial cell shift");
+ return false;
+ }
+
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCTAB nStartTab = rRange.aStart.Tab();