summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-08-01 17:35:23 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-01 17:04:45 +0000
commit4cbaa49c0ee707a2e1e1d842279b32473e8c8a28 (patch)
treedc5fa102c9e8f8dbe68d18290607ee73d365ff1e /sc
parent2e3bc9fcee1c728d9fe91cbdf92b15d090c2b619 (diff)
svl: implement SfxUndoAction::GetViewShellId() interface in SfxListUndoAction
Client code in sw, sd, sc and svx is adapted, the rest is just a placeholder for now. With this, e.g. the undo item for Writer's insert comment properly tracks which window was used for the insertion. Change-Id: Idad587e6ca07ba69bf59aa7013b251af8bf95bab Reviewed-on: https://gerrit.libreoffice.org/27781 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx2
-rw-r--r--sc/source/ui/StatisticsDialogs/SamplingDialog.cxx2
-rw-r--r--sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx2
-rw-r--r--sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx31
-rw-r--r--sc/source/ui/docshell/docsh4.cxx5
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx5
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
-rw-r--r--sc/source/ui/view/cellsh2.cxx2
-rw-r--r--sc/source/ui/view/dbfunc.cxx3
-rw-r--r--sc/source/ui/view/dbfunc3.cxx3
-rw-r--r--sc/source/ui/view/editsh.cxx5
-rw-r--r--sc/source/ui/view/formatsh.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx6
-rw-r--r--sc/source/ui/view/gridwin2.cxx2
-rw-r--r--sc/source/ui/view/tabvwshf.cxx2
-rw-r--r--sc/source/ui/view/viewfun3.cxx8
-rw-r--r--sc/source/ui/view/viewfun6.cxx3
-rw-r--r--sc/source/ui/view/viewfunc.cxx6
20 files changed, 65 insertions, 32 deletions
diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index a859d5974e19..eaf10faedca5 100644
--- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
@@ -289,7 +289,7 @@ void ScRandomNumberGeneratorDialog::GenerateNumbers(RNG& randomGenerator, const
ScDocShell* pDocShell = mpViewData->GetDocShell();
svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager();
- pUndoManager->EnterListAction( aUndo, aUndo, 0 );
+ pUndoManager->EnterListAction( aUndo, aUndo, 0, mpViewData->GetViewShell()->GetViewShellId() );
SCROW nRowStart = maInputRange.aStart.Row();
SCROW nRowEnd = maInputRange.aEnd.Row();
diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
index 9e07e9404025..417de9e6811f 100644
--- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
@@ -273,7 +273,7 @@ void ScSamplingDialog::PerformSampling()
ScRange aModifiedRange;
- pUndoManager->EnterListAction( aUndo, aUndo, 0 );
+ pUndoManager->EnterListAction( aUndo, aUndo, 0, mViewData->GetViewShell()->GetViewShellId() );
if (mpRandomMethodRadio->IsChecked())
{
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
index d2d3e025af38..61a426af4d29 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
@@ -287,7 +287,7 @@ void ScStatisticsInputOutputDialog::CalculateInputAndWriteToOutput()
OUString aUndo(SC_STRLOAD(RID_STATISTICS_DLGS, GetUndoNameId()));
ScDocShell* pDocShell = mViewData->GetDocShell();
svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager();
- pUndoManager->EnterListAction( aUndo, aUndo, 0 );
+ pUndoManager->EnterListAction( aUndo, aUndo, 0, mViewData->GetViewShell()->GetViewShellId() );
ScRange aOutputRange = ApplyOutput(pDocShell);
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
index afb34f3a572b..cc4334e1eae8 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
@@ -326,7 +326,7 @@ void ScStatisticsTwoVariableDialog::CalculateInputAndWriteToOutput()
OUString aUndo(SC_STRLOAD(RID_STATISTICS_DLGS, GetUndoNameId()));
ScDocShell* pDocShell = mViewData->GetDocShell();
svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager();
- pUndoManager->EnterListAction( aUndo, aUndo, 0 );
+ pUndoManager->EnterListAction( aUndo, aUndo, 0, mViewData->GetViewShell()->GetViewShellId() );
ScRange aOutputRange = ApplyOutput(pDocShell);
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 76fd9c511dc3..6e533db37ab4 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1789,7 +1789,12 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
std::vector<ScRange> qIncreaseRange;
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_INSERTCELLS );
if (bRecord)
- rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ {
+ int nViewShellId = -1;
+ if (pViewSh)
+ nViewShellId = pViewSh->GetViewShellId();
+ rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0, nViewShellId );
+ }
itr = aMark.begin();
for (; itr != itrEnd && nTabCount; ++itr)
@@ -2217,7 +2222,12 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
bool bDeletingMerge = false;
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_DELETECELLS );
if (bRecord)
- rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ {
+ int nViewShellId = -1;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ nViewShellId = pViewSh->GetViewShellId();
+ rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0, nViewShellId );
+ }
itr = aMark.begin();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
@@ -5199,7 +5209,12 @@ void ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_RESIZEMATRIX );
bool bUndo(rDoc.IsUndoEnabled());
if (bUndo)
- rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ {
+ int nViewShellId = -1;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ nViewShellId = pViewSh->GetViewShellId();
+ rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0, nViewShellId );
+ }
aFormula = aFormula.copy(1, aFormula.getLength()-2);
@@ -5252,7 +5267,10 @@ void ScDocFunc::InsertAreaLink( const OUString& rFile, const OUString& rFilter,
{
// group all remove and the insert action
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_INSERTAREALINK );
- rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ int nViewShellId = -1;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ nViewShellId = pViewSh->GetViewShellId();
+ rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0, nViewShellId );
}
ScAreaLink* pOldArea = static_cast<ScAreaLink*>(pBase);
@@ -5449,7 +5467,10 @@ void ScDocFunc::ConvertFormulaToValue( const ScRange& rRange, bool bInteraction
void ScDocFunc::EnterListAction( sal_uInt16 nNameResId )
{
OUString aUndo( ScGlobal::GetRscString( nNameResId ) );
- rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ int nViewShellId = -1;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ nViewShellId = pViewSh->GetViewShellId();
+ rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0, nViewShellId );
}
void ScDocFunc::EndListAction()
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 056a45cf6b3f..6ce6eae2e36d 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -196,7 +196,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
if (bUndo)
{
OUString aStrImport = ScGlobal::GetRscString( STR_UNDO_IMPORTDATA );
- GetUndoManager()->EnterListAction( aStrImport, aStrImport, 0 );
+ int nViewShellId = -1;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ nViewShellId = pViewSh->GetViewShellId();
+ GetUndoManager()->EnterListAction( aStrImport, aStrImport, 0, nViewShellId );
}
ScDBData* pDBData = GetDBData( ScRange(aPos), SC_DB_IMPORT, SC_DBSEL_KEEP );
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 99077e499764..c93267e1bbdf 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -621,7 +621,10 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
if (bUpdate)
pOutliner->SetUpdateMode( false );
OUString aName = ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );
- pOutliner->GetUndoManager().EnterListAction( aName, aName, 0 );
+ int nViewShellId = -1;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ nViewShellId = pViewSh->GetViewShellId();
+ pOutliner->GetUndoManager().EnterListAction( aName, aName, 0, nViewShellId );
bChanged = true;
}
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index eeacf24766ab..be4bd71639a2 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -82,7 +82,7 @@ void FuText::StopEditMode()
if(pCalcUndo)
{
const OUString aUndoStr = ScGlobal::GetRscString( STR_UNDO_EDITNOTE );
- pUndoMgr->EnterListAction( aUndoStr, aUndoStr, 0 );
+ pUndoMgr->EnterListAction( aUndoStr, aUndoStr, 0, pViewShell->GetViewShellId() );
/* Note has been created before editing, if first undo action is
an insert action. Needed below to decide whether to drop the
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 50d589260ca6..2f331a28d9f0 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2268,7 +2268,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
size_t nRangeSize = aRanges.size();
OUString aUndo = ScGlobal::GetRscString( bShowNote ? STR_UNDO_SHOWNOTE : STR_UNDO_HIDENOTE );
- pData->GetDocShell()->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pData->GetDocShell()->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pData->GetViewShell()->GetViewShellId() );
for ( size_t i = 0; i < nRangeSize; ++i )
{
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 5a6a60b15749..b0107206e236 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -987,7 +987,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
OSL_ENSURE( pDocSh, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pDocSh is null!" );
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_TEXTTOCOLUMNS );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pData->GetViewShell()->GetViewShellId() );
ScImportExport aImport( pDoc, aRange.aStart );
ScAsciiOptions aOptions;
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index cd1ccff504ed..82f3280a7710 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -36,6 +36,7 @@
#include "editable.hxx"
#include "queryentry.hxx"
#include "markdata.hxx"
+#include "tabvwsh.hxx"
ScDBFunc::ScDBFunc( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) :
ScViewFunc( pParent, rDocSh, pViewShell )
@@ -325,7 +326,7 @@ void ScDBFunc::ToggleAutoFilter()
// use a list action for the AutoFilter buttons (ScUndoAutoFilter) and the filter operation
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_QUERY );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId() );
ScRange aRange;
pDBData->GetArea( aRange );
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 3ad24ce2318c..26916f85d4e4 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -66,6 +66,7 @@
#include "queryentry.hxx"
#include "markdata.hxx"
#include "stringutil.hxx"
+#include "tabvwsh.hxx"
#include <list>
#include <memory>
@@ -2044,7 +2045,7 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet
::svl::IUndoManager* pMgr = GetViewData().GetDocShell()->GetUndoManager();
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_DOOUTLINE );
- pMgr->EnterListAction( aUndo, aUndo, 0 );
+ pMgr->EnterListAction( aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId() );
OUString aNewTabName;
pDoc->CreateValidTabName(aNewTabName);
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index b79ab5ccad7d..50a8ff76b6c8 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -135,7 +135,10 @@ static void lcl_RemoveAttribs( EditView& rEditView )
pEngine->SetUpdateMode(false);
OUString aName = ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );
- pEngine->GetUndoManager().EnterListAction( aName, aName, 0 );
+ int nViewShellId = -1;
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ nViewShellId = pViewSh->GetViewShellId();
+ pEngine->GetUndoManager().EnterListAction( aName, aName, 0, nViewShellId );
rEditView.RemoveAttribs(true);
pEngine->RepeatDefaults(); // paragraph attributes from cell formats must be preserved
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 96c897910163..3383b1de5325 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -572,7 +572,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( bUndo )
{
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_EDITCELLSTYLE );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pTabViewShell->GetViewShellId() );
bListAction = true;
}
@@ -630,7 +630,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( bUndo )
{
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_EDITCELLSTYLE );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pTabViewShell->GetViewShellId() );
bListAction = true;
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index fa477a3e1e38..1e7a3bd41a0c 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4116,7 +4116,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
nSourceTab != nThisTab )
{
OUString aUndo = ScGlobal::GetRscString( bIsMove ? STR_UNDO_MOVE : STR_UNDO_COPY );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pViewData->GetViewShell()->GetViewShellId() );
SCsCOL nCorrectCursorPosCol = 0;
SCsROW nCorrectCursorPosRow = 0;
@@ -4270,7 +4270,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
if (pSourceSh)
{
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_COPY );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pViewData->GetViewShell()->GetViewShellId() );
bDone = true;
if ( meDragInsertMode != INS_NONE )
@@ -4330,7 +4330,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
//! or don't start dragging on a part of a matrix
OUString aUndo = ScGlobal::GetRscString( bIsMove ? STR_UNDO_MOVE : STR_UNDO_COPY );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pViewData->GetViewShell()->GetViewShellId() );
bDone = true;
if ( meDragInsertMode != INS_NONE )
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index c821f4ec9e33..edb5ad6f3ec4 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -961,7 +961,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp )
if (bUndo)
{
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_DRAG_BREAK );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pViewData->GetViewShell()->GetViewShellId() );
}
bool bGrow = !bHide && nNew > nPagebreakBreak;
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index c4a28c071adb..91af95af42dc 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -655,7 +655,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
::svl::IUndoManager* pUndoManager = pDocSh->GetUndoManager();
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_TAB_RTL );
- pUndoManager->EnterListAction( aUndo, aUndo, 0 );
+ pUndoManager->EnterListAction( aUndo, aUndo, 0, rViewData.GetViewShell()->GetViewShellId() );
ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd; ++itr)
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 54cc27a520f4..44a79431fc0c 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1181,7 +1181,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
if ( bRecord )
{
OUString aUndo = ScGlobal::GetRscString( pClipDoc->IsCutMode() ? STR_UNDO_MOVE : STR_UNDO_COPY );
- pUndoMgr->EnterListAction( aUndo, aUndo, 0 );
+ pUndoMgr->EnterListAction( aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId() );
}
if (bClipOver)
@@ -1576,7 +1576,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
OUString aUndo = ScGlobal::GetRscString(
pClipDoc->IsCutMode() ? STR_UNDO_CUT : STR_UNDO_COPY);
- pUndoMgr->EnterListAction(aUndo, aUndo, 0);
+ pUndoMgr->EnterListAction(aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId());
ScUndoPasteOptions aOptions; // store options for repeat
aOptions.nFunction = nFunction;
@@ -1740,7 +1740,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
OUString aUndo = ScGlobal::GetRscString(
pClipDoc->IsCutMode() ? STR_UNDO_CUT : STR_UNDO_COPY);
- pUndoMgr->EnterListAction(aUndo, aUndo, 0);
+ pUndoMgr->EnterListAction(aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId());
ScUndoPasteOptions aOptions; // store options for repeat
aOptions.nFunction = nFunction;
@@ -1809,7 +1809,7 @@ bool ScViewFunc::MoveBlockTo( const ScRange& rSource, const ScAddress& rDestPos,
// moving within one table and several tables selected -> apply to all selected tables
OUString aUndo = ScGlobal::GetRscString( bCut ? STR_UNDO_MOVE : STR_UNDO_COPY );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId() );
// collect ranges of consecutive selected tables
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index 99e088ed9b4f..ae40363227b9 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -45,6 +45,7 @@
#include "drawview.hxx"
#include "globalnames.hxx"
#include "inputhdl.hxx"
+#include "tabvwsh.hxx"
#include <vector>
@@ -438,7 +439,7 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr)
}
::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
- pUndoMgr->EnterListAction(rUndoStr, rUndoStr, 0);
+ pUndoMgr->EnterListAction(rUndoStr, rUndoStr, 0, rViewData.GetViewShell()->GetViewShellId());
pDocSh->GetDocFunc().SetValueCell(aCurPos, fVal, true);
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index a7d4b186d6af..5f23f4ff4f3e 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2290,7 +2290,7 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
if (bUndo)
{
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_PROTECT_TAB );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId() );
}
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
@@ -2320,7 +2320,7 @@ void ScViewFunc::Protect( SCTAB nTab, const OUString& rPassword )
if (bUndo)
{
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_PROTECT_TAB );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId() );
}
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
@@ -2352,7 +2352,7 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& rPassword )
if (bUndo)
{
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_UNPROTECT_TAB );
- pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
+ pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId() );
}
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();