dbaccess/source/ui/querydesign/QueryTableView.cxx              |    2 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx          |    4 -
 dbaccess/source/ui/querydesign/querycontroller.cxx             |    2 
 dbaccess/source/ui/tabledesign/TEditControl.cxx                |    2 
 editeng/source/editeng/impedit5.cxx                            |    4 -
 framework/source/fwe/helper/undomanagerhelper.cxx              |    2 
 include/svl/undo.hxx                                           |    8 +-
 reportdesign/inc/UndoActions.hxx                               |    2 
 reportdesign/source/ui/dlg/GroupsSorting.cxx                   |    4 -
 reportdesign/source/ui/report/SectionWindow.cxx                |    2 
 sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx |    2 
 sc/source/ui/StatisticsDialogs/SamplingDialog.cxx              |    2 
 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx |    2 
 sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx |    2 
 sc/source/ui/docshell/docfunc.cxx                              |   31 
++++++++--
 sc/source/ui/docshell/docsh4.cxx                               |    5 +
 sc/source/ui/drawfunc/drtxtob.cxx                              |    5 +
 sc/source/ui/drawfunc/futext3.cxx                              |    2 
 sc/source/ui/view/cellsh1.cxx                                  |    2 
 sc/source/ui/view/cellsh2.cxx                                  |    2 
 sc/source/ui/view/dbfunc.cxx                                   |    3 
 sc/source/ui/view/dbfunc3.cxx                                  |    3 
 sc/source/ui/view/editsh.cxx                                   |    5 +
 sc/source/ui/view/formatsh.cxx                                 |    4 -
 sc/source/ui/view/gridwin.cxx                                  |    6 -
 sc/source/ui/view/gridwin2.cxx                                 |    2 
 sc/source/ui/view/tabvwshf.cxx                                 |    2 
 sc/source/ui/view/viewfun3.cxx                                 |    8 +-
 sc/source/ui/view/viewfun6.cxx                                 |    3 
 sc/source/ui/view/viewfunc.cxx                                 |    6 -
 sd/inc/undo/undomanager.hxx                                    |    2 
 sd/source/core/drawdoc3.cxx                                    |   11 ++-
 sd/source/core/undo/undomanager.cxx                            |    4 -
 sd/source/ui/animations/SlideTransitionPane.cxx                |    2 
 sd/source/ui/func/fubullet.cxx                                 |    6 +
 sd/source/ui/func/fuinsfil.cxx                                 |    4 -
 sd/source/ui/func/fuoaprms.cxx                                 |    3 
 sd/source/ui/func/fupage.cxx                                   |    3 
 sd/source/ui/sidebar/DocumentHelper.cxx                        |    4 -
 sd/source/ui/view/ViewShellImplementation.cxx                  |    2 
 sd/source/ui/view/drawview.cxx                                 |    6 +
 sd/source/ui/view/drviews2.cxx                                 |    2 
 sd/source/ui/view/outlview.cxx                                 |    2 
 svl/source/undo/undo.cxx                                       |   18 ++++-
 svx/source/svdraw/svdmodel.cxx                                 |   16 ++++-
 sw/source/core/doc/docnew.cxx                                  |    1 
 sw/source/core/inc/UndoManager.hxx                             |    3 
 sw/source/core/undo/docundo.cxx                                |   23 ++++++-
 vcl/source/edit/texteng.cxx                                    |    2 
 49 files changed, 168 insertions(+), 75 deletions(-)

New commits:
commit b0a1c742a92fa685d45492cbec8a0105375be884
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Mon Aug 1 17:35:23 2016 +0200

    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.
    
    Reviewed-on: https://gerrit.libreoffice.org/27781
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Jenkins <c...@libreoffice.org>
    (cherry picked from commit 4cbaa49c0ee707a2e1e1d842279b32473e8c8a28)
    
    Conflicts:
        sc/source/ui/view/viewfun3.cxx
    
    Change-Id: Idad587e6ca07ba69bf59aa7013b251af8bf95bab

diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx 
b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 8f80056..985b84a 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -746,7 +746,7 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin)
         OQueryDesignView* pParent = 
static_cast<OQueryDesignView*>(getDesignView());
 
         SfxUndoManager& rUndoMgr = m_pView->getController().GetUndoManager();
-        rUndoMgr.EnterListAction( OUString( 
ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString(), 0 );
+        rUndoMgr.EnterListAction( OUString( 
ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString(), 0, -1 );
 
         // add the Undo-Action
         OQueryTabWinDelUndoAct* pUndoAction = new OQueryTabWinDelUndoAct(this);
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx 
b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 8f6cd72..06880c8 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -941,7 +941,7 @@ bool OSelectionBrowseBox::SaveModified()
                         strOldCellContents = pEntry->GetField();
                         bListAction = true;
                         if ( !m_bInUndoMode )
-                            
rController.GetUndoManager().EnterListAction(OUString(),OUString(),0);
+                            
rController.GetUndoManager().EnterListAction(OUString(),OUString(),0,-1);
 
                         sal_Int32 nPos = m_pFieldCell->GetEntryPos(aFieldName);
                         OUString aAliasName = pEntry->GetAlias();
@@ -2457,7 +2457,7 @@ void OSelectionBrowseBox::appendUndoAction(const 
OUString& _rOldValue, const OUS
         if ( !_bListAction )
         {
             _bListAction = true;
-            
static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(OUString(),OUString(),0);
+            
static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(OUString(),OUString(),0,-1);
         }
         appendUndoAction(_rOldValue,_rNewValue,_nRow);
     }
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx 
b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 99d81fa..cae132d 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -684,7 +684,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const 
Sequence< PropertyValue >&
         break;
         case SID_BROWSER_CLEAR_QUERY:
             {
-                GetUndoManager().EnterListAction( OUString( 
ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString(), 0 );
+                GetUndoManager().EnterListAction( OUString( 
ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString(), 0, -1 );
                 getContainer()->clear();
                 GetUndoManager().LeaveListAction();
 
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx 
b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 9ec0806..e523c29 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -654,7 +654,7 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 
nColId )
     default:            sActionDescription = ModuleRes( 
STR_CHANGE_COLUMN_ATTRIBUTE ); break;
     }
 
-    GetUndoManager().EnterListAction( sActionDescription, OUString(),0 );
+    GetUndoManager().EnterListAction( sActionDescription, OUString(),0,-1 );
     if (!pActFieldDescr)
     {
         const OTypeInfoMap& rTypeInfoMap = 
GetView()->getController().getTypeInfo();
diff --git a/editeng/source/editeng/impedit5.cxx 
b/editeng/source/editeng/impedit5.cxx
index 027c3ce..14b1388 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -226,7 +226,7 @@ void ImpEditEngine::UndoActionStart( sal_uInt16 nId, const 
ESelection& aSel )
 {
     if ( IsUndoEnabled() && !IsInUndo() )
     {
-        GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( 
nId ), OUString(), nId );
+        GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( 
nId ), OUString(), nId, -1 );
         DBG_ASSERT( !pUndoMarkSelection, "UndoAction SelectionMarker?" );
         pUndoMarkSelection = new ESelection( aSel );
     }
@@ -236,7 +236,7 @@ void ImpEditEngine::UndoActionStart( sal_uInt16 nId )
 {
     if ( IsUndoEnabled() && !IsInUndo() )
     {
-        GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( 
nId ), OUString(), nId );
+        GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( 
nId ), OUString(), nId, -1 );
         DBG_ASSERT( !pUndoMarkSelection, "UndoAction SelectionMarker?" );
     }
 }
diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx 
b/framework/source/fwe/helper/undomanagerhelper.cxx
index 2cb7d67..772e596 100644
--- a/framework/source/fwe/helper/undomanagerhelper.cxx
+++ b/framework/source/fwe/helper/undomanagerhelper.cxx
@@ -552,7 +552,7 @@ namespace framework
 
         {
             ::comphelper::FlagGuard aNotificationGuard( m_bAPIActionRunning );
-            rUndoManager.EnterListAction( i_title, OUString(), 0 );
+            rUndoManager.EnterListAction( i_title, OUString(), 0, -1 );
         }
 
         m_aContextVisibilities.push( i_hidden );
diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx
index dd7546a..2012df9 100644
--- a/include/svl/undo.hxx
+++ b/include/svl/undo.hxx
@@ -137,7 +137,7 @@ class SVL_DLLPUBLIC SfxListUndoAction : public 
SfxUndoAction, public SfxUndoArra
 public:
 
     SfxListUndoAction(
-        const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 
nId, SfxUndoArray *pFather );
+        const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 
nId, sal_Int32 nViewShellId, SfxUndoArray *pFather );
     virtual ~SfxListUndoAction();
 
     virtual void            Undo() override;
@@ -150,6 +150,8 @@ public:
     virtual bool            Merge( SfxUndoAction *pNextAction ) override;
 
     virtual OUString        GetComment() const override;
+    /// See SfxUndoAction::GetViewShellId().
+    sal_Int32 GetViewShellId() const override;
     virtual OUString        GetRepeatComment(SfxRepeatTarget&) const override;
     virtual sal_uInt16      GetId() const override;
 
@@ -236,7 +238,7 @@ namespace svl
         virtual bool            Repeat( SfxRepeatTarget &rTarget ) = 0;
         virtual bool            CanRepeat( SfxRepeatTarget &rTarget ) const = 
0;
 
-        virtual void            EnterListAction(const OUString &rComment, 
const OUString& rRepeatComment, sal_uInt16 nId) = 0;
+        virtual void            EnterListAction(const OUString &rComment, 
const OUString& rRepeatComment, sal_uInt16 nId, sal_Int32 nViewShellId) = 0;
 
         /** leaves the list action entered with EnterListAction
             @return the number of the sub actions in the list which has just 
been left. Note that in case no such
@@ -330,7 +332,7 @@ public:
     virtual OUString        GetRepeatActionComment( SfxRepeatTarget &rTarget) 
const override;
     virtual bool            Repeat( SfxRepeatTarget &rTarget ) override;
     virtual bool            CanRepeat( SfxRepeatTarget &rTarget ) const 
override;
-    virtual void            EnterListAction(const OUString &rComment, const 
OUString& rRepeatComment, sal_uInt16 nId) override;
+    virtual void            EnterListAction(const OUString &rComment, const 
OUString& rRepeatComment, sal_uInt16 nId, sal_Int32 nViewShellId) override;
     virtual size_t          LeaveListAction() override;
     virtual size_t          LeaveAndMergeListAction() override;
     virtual bool            IsInListAction() const override;
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx
index 46217f6..aa4d9d2 100644
--- a/reportdesign/inc/UndoActions.hxx
+++ b/reportdesign/inc/UndoActions.hxx
@@ -112,7 +112,7 @@ namespace rptui
         UndoContext( SfxUndoManager& i_undoManager, const OUString& 
i_undoTitle )
             :m_rUndoManager( i_undoManager )
         {
-            m_rUndoManager.EnterListAction( i_undoTitle, OUString(), 0 );
+            m_rUndoManager.EnterListAction( i_undoTitle, OUString(), 0, -1 );
         }
 
         ~UndoContext()
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx 
b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index eaf32eb..63690ae 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -448,7 +448,7 @@ bool OFieldExpressionControl::SaveModified(bool _bAppendRow)
             {
                 bAppend = true;
                 OUString sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP));
-                m_pParent->m_pController->getUndoManager().EnterListAction( 
sUndoAction, OUString(), 0 );
+                m_pParent->m_pController->getUndoManager().EnterListAction( 
sUndoAction, OUString(), 0, -1 );
                 xGroup = m_pParent->getGroups()->createGroup();
                 xGroup->setHeaderOn(sal_True);
 
@@ -787,7 +787,7 @@ void OFieldExpressionControl::DeleteRows()
             {
                 bFirstTime = false;
                 OUString sUndoAction(ModuleRes(RID_STR_UNDO_REMOVE_SELECTION));
-                m_pParent->m_pController->getUndoManager().EnterListAction( 
sUndoAction, OUString(), 0 );
+                m_pParent->m_pController->getUndoManager().EnterListAction( 
sUndoAction, OUString(), 0, -1 );
             }
 
             sal_Int32 nGroupPos = m_aGroupPositions[nIndex];
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx 
b/reportdesign/source/ui/report/SectionWindow.cxx
index c87e80d..9d1069d 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -320,7 +320,7 @@ void OSectionWindow::zoom(const Fraction& _aZoom)
 IMPL_LINK_NOARG_TYPED( OSectionWindow, StartSplitHdl, Splitter*, void)
 {
     const OUString sUndoAction( ModuleRes( RID_STR_UNDO_CHANGE_SIZE ) );
-    
getViewsWindow()->getView()->getReportView()->getController().getUndoManager().EnterListAction(
 sUndoAction, OUString(), 0 );
+    
getViewsWindow()->getView()->getReportView()->getController().getUndoManager().EnterListAction(
 sUndoAction, OUString(), 0, -1 );
 }
 
 IMPL_LINK_NOARG_TYPED( OSectionWindow, EndSplitHdl, Splitter*, void )
diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx 
b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index 6cdd7ad..08467e2 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 a69c82f..f91d250 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 090a4ce..31dd337 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
@@ -283,7 +283,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 d366a39..92d524a 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
@@ -322,7 +322,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 0427b03..604af85 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1799,7 +1799,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)
@@ -2226,7 +2231,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)
@@ -5201,7 +5211,12 @@ bool 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);
 
@@ -5257,7 +5272,10 @@ bool 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);
@@ -5455,7 +5473,10 @@ void ScDocFunc::ConvertFormulaToValue( const ScRange& 
rRange, bool bRecord, bool
 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 a9f3871..4228d8a 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -204,7 +204,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 2c7d0fe..64213f4 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -625,7 +625,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 906ea89..b5837e7 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -83,7 +83,7 @@ void FuText::StopEditMode(bool /*bTextDirection*/)
         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 9ac0cd2..18a63f5 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2266,7 +2266,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 2b1dd9a..6c6fcee 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1005,7 +1005,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 8d22edf..93eac35 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 bd8eedc..6b4d4c4 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 1097321..5c17a02 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -138,7 +138,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 66ebb14..40d0cc6 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -574,7 +574,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;
                             }
 
@@ -632,7 +632,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 8b3c334..205a9e6 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4255,7 +4255,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;
@@ -4411,7 +4411,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 )
@@ -4471,7 +4471,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 3ebc3cd..9241a36 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 e6c8539..b6d08d2 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -656,7 +656,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 c1bd5d8..3652e6a 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1182,7 +1182,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)
@@ -1571,7 +1571,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;
@@ -1731,7 +1731,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;
@@ -1802,7 +1802,7 @@ bool ScViewFunc::MoveBlockTo( const ScRange& rSource, 
const ScAddress& rDestPos,
         if ( bRecord )
         {
             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 a366ec9..07bffd2 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 fdc4233..2c2b194 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2292,7 +2292,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();
@@ -2322,7 +2322,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();
@@ -2354,7 +2354,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();
diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx
index ecea0ed..a020038 100644
--- a/sd/inc/undo/undomanager.hxx
+++ b/sd/inc/undo/undomanager.hxx
@@ -31,7 +31,7 @@ class UndoManager : public SdrUndoManager
 public:
     UndoManager( sal_uInt16 nMaxUndoActionCount = 20 );
 
-    virtual void            EnterListAction(const OUString &rComment, const 
OUString& rRepeatComment, sal_uInt16 nId) override;
+    virtual void            EnterListAction(const OUString &rComment, const 
OUString& rRepeatComment, sal_uInt16 nId, sal_Int32 nViewShellId) override;
 
     virtual void            AddUndoAction( SfxUndoAction *pAction, bool 
bTryMerg=false ) override;
 
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index fe2f66c..7817f75 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -60,6 +60,7 @@
 #include "../ui/inc/GraphicDocShell.hxx"
 #include "../ui/inc/ViewShell.hxx"
 #include "../ui/inc/View.hxx"
+#include "../ui/inc/ViewShellBase.hxx"
 #include "../ui/inc/cfgids.hxx"
 #include "../ui/inc/strings.hrc"
 
@@ -488,7 +489,10 @@ bool SdDrawDocument::InsertBookmarkAsPage(
     if( mpDocSh )
     {
         pUndoMgr = mpDocSh->GetUndoManager();
-        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_INSERTPAGES), "", 0);
+        sal_Int32 nViewShellId = -1;
+        if (sd::ViewShell* pViewShell = mpDocSh->GetViewShell())
+            nViewShellId = pViewShell->GetViewShellBase().GetViewShellId();
+        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_INSERTPAGES), "", 0, 
nViewShellId);
     }
 
     // Refactored copy'n'pasted layout name collection into 
IterateBookmarkPages
@@ -1426,7 +1430,10 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
 
     if (bUndo)
     {
-        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), 
OUString(), 0);
+        sal_Int32 nViewShellId = -1;
+        if (sd::ViewShell* pViewShell = mpDocSh->GetViewShell())
+            nViewShellId = pViewShell->GetViewShellBase().GetViewShellId();
+        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), 
OUString(), 0, nViewShellId);
     }
 
     SdPage* pSelectedPage   = GetSdPage(nSdPageNum, PK_STANDARD);
diff --git a/sd/source/core/undo/undomanager.cxx 
b/sd/source/core/undo/undomanager.cxx
index 20e13ed..bbf2069 100644
--- a/sd/source/core/undo/undomanager.cxx
+++ b/sd/source/core/undo/undomanager.cxx
@@ -27,12 +27,12 @@ UndoManager::UndoManager( sal_uInt16 nMaxUndoActionCount /* 
= 20 */ )
 {
 }
 
-void UndoManager::EnterListAction(const OUString &rComment, const OUString& 
rRepeatComment, sal_uInt16 nId /* =0 */)
+void UndoManager::EnterListAction(const OUString &rComment, const OUString& 
rRepeatComment, sal_uInt16 nId, sal_Int32 nViewShellId)
 {
     if( !IsDoing() )
     {
         ClearLinkedRedoActions();
-        SdrUndoManager::EnterListAction( rComment, rRepeatComment, nId );
+        SdrUndoManager::EnterListAction( rComment, rRepeatComment, nId, 
nViewShellId );
     }
 }
 
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
index c8ae5ed..e5c924d 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -249,7 +249,7 @@ void lcl_CreateUndoForPages(
         return;
 
     OUString aComment( SdResId(STR_UNDO_SLIDE_PARAMS) );
-    pManager->EnterListAction(aComment, aComment, 0);
+    pManager->EnterListAction(aComment, aComment, 0, rBase.GetViewShellId());
     SdUndoGroup* pUndoGroup = new SdUndoGroup( pDoc );
     pUndoGroup->SetComment( aComment );
 
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index 9bd3419..895ee2d 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -25,6 +25,7 @@
 #include <editeng/fontitem.hxx>
 #include "OutlineViewShell.hxx"
 #include "DrawViewShell.hxx"
+#include "ViewShellBase.hxx"
 #include "Window.hxx"
 #include "drawdoc.hxx"
 #include "strings.hrc"
@@ -128,7 +129,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
         // prepare undo
         ::svl::IUndoManager& rUndoMgr =  pOL->GetUndoManager();
         rUndoMgr.EnterListAction(SD_RESSTR(STR_UNDO_INSERT_SPECCHAR),
-                                    "", 0 );
+                                    "", 0, 
mpViewShell->GetViewShellBase().GetViewShellId() );
 
         // insert given text
         OUString aStr( cMark );
@@ -255,8 +256,9 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
             aOldSet.Put( pOV->GetAttribs() );
 
             ::svl::IUndoManager& rUndoMgr =  pOL->GetUndoManager();
+            int nViewShellId = mpViewShell ? 
mpViewShell->GetViewShellBase().GetViewShellId() : -1;
             rUndoMgr.EnterListAction(SD_RESSTR(STR_UNDO_INSERT_SPECCHAR),
-                                     "", 0 );
+                                     "", 0, nViewShellId );
             pOV->InsertText(aChars, true);
 
             // set attributes (set font)
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index c1c7a73..018f7fd 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -54,6 +54,7 @@
 #include "glob.hrc"
 #include "sdpage.hxx"
 #include "strmname.h"
+#include "ViewShellBase.hxx"
 #include "DrawViewShell.hxx"
 #include "OutlineViewShell.hxx"
 #include "DrawDocShell.hxx"
@@ -636,8 +637,9 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
 
         nNewPages = 0;
 
+        int nViewShellId = mpViewShell ? 
mpViewShell->GetViewShellBase().GetViewShellId() : -1;
         rDocliner.GetUndoManager().EnterListAction(
-                                    SD_RESSTR(STR_UNDO_INSERT_FILE), 
OUString(), 0 );
+                                    SD_RESSTR(STR_UNDO_INSERT_FILE), 
OUString(), 0, nViewShellId );
 
         sal_Int32 nSourcePos = 0;
         SfxStyleSheet* pStyleSheet = pPage->GetStyleSheetForPresObj( 
PRESOBJ_OUTLINE );
diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index 2f4c672..51458e1 100644
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -36,6 +36,7 @@
 #include "glob.hrc"
 #include "drawdoc.hxx"
 #include "ViewShell.hxx"
+#include "ViewShellBase.hxx"
 #include "anminfo.hxx"
 #include "unoaprms.hxx"
 #include "sdundogr.hxx"
@@ -618,7 +619,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& 
rReq )
 
         // with 'following curves', we have an additional UndoAction
         // therefore cling? here
-        pUndoMgr->EnterListAction(aComment, aComment, 0);
+        pUndoMgr->EnterListAction(aComment, aComment, 0, 
mpViewShell->GetViewShellBase().GetViewShellId());
 
         // create undo group
         SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc);
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 91670b3..aac1366 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -59,6 +59,7 @@
 #include "drawdoc.hxx"
 #include "DrawDocShell.hxx"
 #include "ViewShell.hxx"
+#include "ViewShellBase.hxx"
 #include "DrawViewShell.hxx"
 #include "app.hrc"
 #include "unchss.hxx"
@@ -412,7 +413,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* 
pParent )
             {
                 OUString aComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
                 ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
-                pUndoMgr->EnterListAction(aComment, aComment, 0);
+                pUndoMgr->EnterListAction(aComment, aComment, 0, 
mpViewShell->GetViewShellBase().GetViewShellId());
                 SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc);
                 pUndoGroup->SetComment(aComment);
 
diff --git a/sd/source/ui/sidebar/DocumentHelper.cxx 
b/sd/source/ui/sidebar/DocumentHelper.cxx
index 61205a2..3f90c35 100644
--- a/sd/source/ui/sidebar/DocumentHelper.cxx
+++ b/sd/source/ui/sidebar/DocumentHelper.cxx
@@ -27,6 +27,8 @@
 #include "strings.hrc"
 #include "sdresid.hxx"
 #include "undoback.hxx"
+#include "ViewShell.hxx"
+#include "ViewShellBase.hxx"
 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
 #include <com/sun/star/drawing/XDrawPages.hpp>
 #include <com/sun/star/frame/XComponentLoader.hpp>
@@ -320,7 +322,7 @@ void DocumentHelper::AssignMasterPageToPageList (
 
     ::svl::IUndoManager* pUndoMgr = 
rTargetDocument.GetDocSh()->GetUndoManager();
     if( pUndoMgr )
-        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), 
OUString(), 0);
+        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), 
OUString(), 0, 
rTargetDocument.GetDocSh()->GetViewShell()->GetViewShellBase().GetViewShellId());
 
     SdPage* pMasterPageInDocument = 
ProvideMasterPage(rTargetDocument,pMasterPage,rpPageList);
     if (pMasterPageInDocument == nullptr)
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx 
b/sd/source/ui/view/ViewShellImplementation.cxx
index 75c5ca1..d4639fd 100644
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -175,7 +175,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
         if( pUndoManager )
         {
             OUString aComment( SdResId(STR_UNDO_MODIFY_PAGE) );
-            pUndoManager->EnterListAction(aComment, aComment, 0);
+            pUndoManager->EnterListAction(aComment, aComment, 0, 
mrViewShell.GetViewShellBase().GetViewShellId());
             ModifyPageUndoAction* pAction = new ModifyPageUndoAction(
                 pDocument, pUndoPage, aNewName, aNewAutoLayout, bBVisible, 
bBObjsVisible);
             pUndoManager->AddUndoAction(pAction);
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index f929197..72fb3b4 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -52,6 +52,7 @@
 #include "drawdoc.hxx"
 #include "DrawDocShell.hxx"
 #include "sdpage.hxx"
+#include "ViewShellBase.hxx"
 #include "DrawViewShell.hxx"
 #include "pres.hxx"
 #include "sdresid.hxx"
@@ -181,7 +182,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet,
                     // replace placeholder by template name
                     OUString aComment(SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT));
                     aComment = aComment.replaceFirst("$", 
SD_RESSTR(STR_PSEUDOSHEET_OUTLINE));
-                    mpDocSh->GetUndoManager()->EnterListAction( aComment, 
OUString(), 0 );
+                    mpDocSh->GetUndoManager()->EnterListAction( aComment, 
OUString(), 0, mpDrawViewShell->GetViewShellBase().GetViewShellId() );
 
                     std::vector<Paragraph*> aSelList;
                     pOV->CreateSelectionList(aSelList);
@@ -545,7 +546,8 @@ void DrawView::DeleteMarked()
     {
         OUString aUndo(SVX_RESSTR(STR_EditDelete));
         aUndo = aUndo.replaceFirst("%1", GetDescriptionOfMarkedObjects());
-        pUndoManager->EnterListAction(aUndo, aUndo, 0);
+        sal_Int32 nViewShellId = mpDrawViewShell ? 
mpDrawViewShell->GetViewShellBase().GetViewShellId() : -1;
+        pUndoManager->EnterListAction(aUndo, aUndo, 0, nViewShellId);
     }
 
     SdPage* pPage = nullptr;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 4852ef3..026021c 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -210,7 +210,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
             if( rMarkList.GetMarkCount() == 1 )
             {
-                pUndoManager->EnterListAction("", "", 0);
+                pUndoManager->EnterListAction("", "", 0, 
GetViewShellBase().GetViewShellId());
                 mpDrawView->BegUndo();
 
                 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 09f1008f..1b66c13 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1455,7 +1455,7 @@ void OutlineView::IgnoreCurrentPageChanges (bool 
bIgnoreChanges)
     and or the drawing document model. It will create needed undo actions */
 void OutlineView::BeginModelChange()
 {
-    mrOutliner.GetUndoManager().EnterListAction("", "", 0);
+    mrOutliner.GetUndoManager().EnterListAction("", "", 0, 
mrOutlineViewShell.GetViewShellBase().GetViewShellId());
     BegUndo(SD_RESSTR(STR_UNDO_CHANGE_TITLE_AND_LAYOUT));
 }
 
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index cab0502..154e8e9 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -1024,7 +1024,8 @@ void SfxUndoManager::RemoveUndoListener( SfxUndoListener& 
i_listener )
  * Inserts a ListUndoAction and sets its UndoArray as current.
  */
 void SfxUndoManager::EnterListAction( const OUString& rComment,
-                                      const OUString &rRepeatComment, 
sal_uInt16 nId )
+                                      const OUString &rRepeatComment, 
sal_uInt16 nId,
+                                      sal_Int32 nViewShellId )
 {
     UndoManagerGuard aGuard( *m_xData );
 
@@ -1035,7 +1036,7 @@ void SfxUndoManager::EnterListAction( const OUString& 
rComment,
         return;
 
     m_xData->pFatherUndoArray = m_xData->pActUndoArray;
-    SfxListUndoAction* pAction = new SfxListUndoAction( rComment, 
rRepeatComment, nId, m_xData->pActUndoArray );
+    SfxListUndoAction* pAction = new SfxListUndoAction( rComment, 
rRepeatComment, nId, nViewShellId, m_xData->pActUndoArray );
     OSL_VERIFY( ImplAddUndoAction_NoNotify( pAction, false, false, aGuard ) );
     // expected to succeed: all conditions under which it could fail should 
have been checked already
     m_xData->pActUndoArray = pAction;
@@ -1296,12 +1297,13 @@ void SfxUndoManager::dumpAsXml(xmlTextWriterPtr 
pWriter) const
 struct SfxListUndoAction::Impl
 {
     sal_uInt16 mnId;
+    sal_Int32 mnViewShellId;
 
     OUString maComment;
     OUString maRepeatComment;
 
-    Impl( sal_uInt16 nId, const OUString& rComment, const OUString& 
rRepeatComment ) :
-        mnId(nId), maComment(rComment), maRepeatComment(rRepeatComment) {}
+    Impl( sal_uInt16 nId, sal_Int32 nViewShellId, const OUString& rComment, 
const OUString& rRepeatComment ) :
+        mnId(nId), mnViewShellId(nViewShellId), maComment(rComment), 
maRepeatComment(rRepeatComment) {}
 };
 
 sal_uInt16 SfxListUndoAction::GetId() const
@@ -1314,6 +1316,11 @@ OUString SfxListUndoAction::GetComment() const
     return mpImpl->maComment;
 }
 
+sal_Int32 SfxListUndoAction::GetViewShellId() const
+{
+    return mpImpl->mnViewShellId;
+}
+
 void SfxListUndoAction::SetComment(const OUString& rComment)
 {
     mpImpl->maComment = rComment;
@@ -1328,8 +1335,9 @@ SfxListUndoAction::SfxListUndoAction(
     const OUString &rComment,
     const OUString &rRepeatComment,
     sal_uInt16 nId,
+    sal_Int32 nViewShellId,
     SfxUndoArray *pFather ) :
-    mpImpl(new Impl(nId, rComment, rRepeatComment))
+    mpImpl(new Impl(nId, nViewShellId, rComment, rRepeatComment))
 {
     pFatherUndoArray = pFather;
     nMaxUndoActions = USHRT_MAX;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 6ae28cd..8d5ba7c 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -93,6 +93,7 @@
 #include <libxml/xmlwriter.h>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <comphelper/lok.hxx>
+#include <sfx2/viewsh.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -483,7 +484,10 @@ void SdrModel::BegUndo()
 {
     if( mpImpl->mpUndoManager )
     {
-        mpImpl->mpUndoManager->EnterListAction("","",0);
+        int nViewShellId = -1;
+        if (SfxViewShell* pViewShell = SfxViewShell::Current())
+            nViewShellId = pViewShell->GetViewShellId();
+        mpImpl->mpUndoManager->EnterListAction("","",0,nViewShellId);
         nUndoLevel++;
     }
     else if( IsUndoEnabled() )
@@ -504,7 +508,10 @@ void SdrModel::BegUndo(const OUString& rComment)
 {
     if( mpImpl->mpUndoManager )
     {
-        mpImpl->mpUndoManager->EnterListAction( rComment, "", 0 );
+        int nViewShellId = -1;
+        if (SfxViewShell* pViewShell = SfxViewShell::Current())
+            nViewShellId = pViewShell->GetViewShellId();
+        mpImpl->mpUndoManager->EnterListAction( rComment, "", 0, nViewShellId 
);
         nUndoLevel++;
     }
     else if( IsUndoEnabled() )
@@ -526,7 +533,10 @@ void SdrModel::BegUndo(const OUString& rComment, const 
OUString& rObjDescr, SdrR
         {
             aComment = aComment.replaceFirst("%1", rObjDescr);
         }
-        mpImpl->mpUndoManager->EnterListAction( aComment,"",0 );
+        int nViewShellId = -1;
+        if (SfxViewShell* pViewShell = SfxViewShell::Current())
+            nViewShellId = pViewShell->GetViewShellId();
+        mpImpl->mpUndoManager->EnterListAction( aComment,"",0,nViewShellId );
         nUndoLevel++;
     }
     else if( IsUndoEnabled() )
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 3c04abe..b5198c1 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -607,6 +607,7 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
         if (mpDocShell)
         {
             mpDocShell->SetUndoManager(& GetUndoManager());
+            GetUndoManager().SetDocShell(mpDocShell);
         }
 
         getIDocumentLinksAdministration().GetLinkManager().SetPersist( 
mpDocShell );
diff --git a/sw/source/core/inc/UndoManager.hxx 
b/sw/source/core/inc/UndoManager.hxx
index 95a7cbd..68774c4 100644
--- a/sw/source/core/inc/UndoManager.hxx
+++ b/sw/source/core/inc/UndoManager.hxx
@@ -28,6 +28,7 @@
 class IDocumentDrawModelAccess;
 class IDocumentRedlineAccess;
 class IDocumentState;
+class SwDocShell;
 
 namespace sw {
 
@@ -85,6 +86,7 @@ public:
 
     SwNodes const& GetUndoNodes() const;
     SwNodes      & GetUndoNodes();
+    void SetDocShell(SwDocShell* pDocShell);
 
 private:
     IDocumentDrawModelAccess & m_rDrawModelAccess;
@@ -99,6 +101,7 @@ private:
     bool m_bLockUndoNoModifiedPosition : 1;
     /// position in Undo-Array at which Doc was saved (and is not modified)
     UndoStackMark m_UndoSaveMark;
+    SwDocShell* m_pDocShell;
 
     typedef enum { UNDO = int(true), REDO = int(false) } UndoOrRedo_t;
     bool impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo);
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 02969f6..f59f3dd 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -23,6 +23,8 @@
 #include <svx/svdmodel.hxx>
 #include <swmodule.hxx>
 #include <doc.hxx>
+#include <docsh.hxx>
+#include <view.hxx>
 #include <drawdoc.hxx>
 #include <ndarr.hxx>
 #include <pam.hxx>
@@ -79,6 +81,11 @@ bool UndoManager::IsUndoNodes(SwNodes const& rNodes) const
     return & rNodes == m_xUndoNodes.get();
 }
 
+void UndoManager::SetDocShell(SwDocShell* pDocShell)
+{
+    m_pDocShell = pDocShell;
+}
+
 size_t UndoManager::GetUndoActionCount(const bool bCurrentLevel) const
 {
     return SdrUndoManager::GetUndoActionCount(bCurrentLevel);
@@ -212,7 +219,13 @@ UndoManager::StartUndo(SwUndoId const i_eUndoId,
         comment = pRewriter->Apply(comment);
     }
 
-    SdrUndoManager::EnterListAction(comment, comment, eUndoId);
+    int nViewShellId = -1;
+    if (m_pDocShell)
+    {
+        if (const SwView* pView = m_pDocShell->GetView())
+            nViewShellId = pView->GetViewShellId();
+    }
+    SdrUndoManager::EnterListAction(comment, comment, eUndoId, nViewShellId);
 
     return eUndoId;
 }
@@ -563,7 +576,13 @@ bool UndoManager::Repeat(::sw::RepeatContext & rContext,
     sal_uInt16 const nId(pRepeatAction->GetId());
     if (DoesUndo())
     {
-        EnterListAction(comment, rcomment, nId);
+        int nViewShellId = -1;
+        if (m_pDocShell)
+        {
+            if (const SwView* pView = m_pDocShell->GetView())
+                nViewShellId = pView->GetViewShellId();
+        }
+        EnterListAction(comment, rcomment, nId, nViewShellId);
     }
 
     SwPaM* pTmp = rContext.m_pCurrentPaM;
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 3cfa63c..669ddaf 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1329,7 +1329,7 @@ void TextEngine::UndoActionStart( sal_uInt16 nId )
     if ( IsUndoEnabled() && !IsInUndo() )
     {
         OUString aComment;
-        GetUndoManager().EnterListAction( aComment, OUString(), nId );
+        GetUndoManager().EnterListAction( aComment, OUString(), nId, -1 );
     }
 }
 
commit 2aa728780e273feaa3646f0299b727c02502c18d
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Mon Aug 1 11:46:42 2016 +0200

    svl: avoid defaulted parameter in SfxUndoManager::EnterListAction()
    
    It's a virtual function, and defaulted parameters there are problematic.
    
    Reviewed-on: https://gerrit.libreoffice.org/27772
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Jenkins <c...@libreoffice.org>
    (cherry picked from commit 6850f4e8454652ec475811860f5e8cf9bdea67a7)
    
    Conflicts:
        sc/source/ui/view/viewfun3.cxx
    
    Change-Id: I3f110c7ac36dfda90811b033620286ad9fce1af1

diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx 
b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 710efd3..8f80056 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -746,7 +746,7 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin)
         OQueryDesignView* pParent = 
static_cast<OQueryDesignView*>(getDesignView());
 
         SfxUndoManager& rUndoMgr = m_pView->getController().GetUndoManager();
-        rUndoMgr.EnterListAction( OUString( 
ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString() );
+        rUndoMgr.EnterListAction( OUString( 
ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString(), 0 );
 
         // add the Undo-Action
         OQueryTabWinDelUndoAct* pUndoAction = new OQueryTabWinDelUndoAct(this);
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx 
b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 4727b23..8f6cd72 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -941,7 +941,7 @@ bool OSelectionBrowseBox::SaveModified()
                         strOldCellContents = pEntry->GetField();
                         bListAction = true;
                         if ( !m_bInUndoMode )
-                            
rController.GetUndoManager().EnterListAction(OUString(),OUString());
+                            
rController.GetUndoManager().EnterListAction(OUString(),OUString(),0);
 
                         sal_Int32 nPos = m_pFieldCell->GetEntryPos(aFieldName);
                         OUString aAliasName = pEntry->GetAlias();
@@ -2457,7 +2457,7 @@ void OSelectionBrowseBox::appendUndoAction(const 
OUString& _rOldValue, const OUS
         if ( !_bListAction )
         {
             _bListAction = true;
-            
static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(OUString(),OUString());
+            
static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(OUString(),OUString(),0);
         }
         appendUndoAction(_rOldValue,_rNewValue,_nRow);
     }
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx 
b/dbaccess/source/ui/querydesign/querycontroller.cxx
index cec0338..99d81fa 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -684,7 +684,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const 
Sequence< PropertyValue >&
         break;
         case SID_BROWSER_CLEAR_QUERY:
             {
-                GetUndoManager().EnterListAction( OUString( 
ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString() );
+                GetUndoManager().EnterListAction( OUString( 
ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), OUString(), 0 );
                 getContainer()->clear();
                 GetUndoManager().LeaveListAction();
 
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx 
b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index acf5bbd..9ec0806 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -654,7 +654,7 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 
nColId )
     default:            sActionDescription = ModuleRes( 
STR_CHANGE_COLUMN_ATTRIBUTE ); break;
     }
 
-    GetUndoManager().EnterListAction( sActionDescription, OUString() );
+    GetUndoManager().EnterListAction( sActionDescription, OUString(),0 );
     if (!pActFieldDescr)
     {
         const OTypeInfoMap& rTypeInfoMap = 
GetView()->getController().getTypeInfo();
diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx 
b/framework/source/fwe/helper/undomanagerhelper.cxx
index ebdd544..2cb7d67 100644
--- a/framework/source/fwe/helper/undomanagerhelper.cxx
+++ b/framework/source/fwe/helper/undomanagerhelper.cxx
@@ -552,7 +552,7 @@ namespace framework
 
         {
             ::comphelper::FlagGuard aNotificationGuard( m_bAPIActionRunning );
-            rUndoManager.EnterListAction( i_title, OUString() );
+            rUndoManager.EnterListAction( i_title, OUString(), 0 );
         }
 
         m_aContextVisibilities.push( i_hidden );
diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx
index 94322f9..dd7546a 100644
--- a/include/svl/undo.hxx
+++ b/include/svl/undo.hxx
@@ -236,7 +236,7 @@ namespace svl
         virtual bool            Repeat( SfxRepeatTarget &rTarget ) = 0;
         virtual bool            CanRepeat( SfxRepeatTarget &rTarget ) const = 
0;
 
-        virtual void            EnterListAction(const OUString &rComment, 
const OUString& rRepeatComment, sal_uInt16 nId=0) = 0;
+        virtual void            EnterListAction(const OUString &rComment, 
const OUString& rRepeatComment, sal_uInt16 nId) = 0;
 
         /** leaves the list action entered with EnterListAction
             @return the number of the sub actions in the list which has just 
been left. Note that in case no such
@@ -330,7 +330,7 @@ public:
     virtual OUString        GetRepeatActionComment( SfxRepeatTarget &rTarget) 
const override;
     virtual bool            Repeat( SfxRepeatTarget &rTarget ) override;
     virtual bool            CanRepeat( SfxRepeatTarget &rTarget ) const 
override;
-    virtual void            EnterListAction(const OUString &rComment, const 
OUString& rRepeatComment, sal_uInt16 nId=0) override;
+    virtual void            EnterListAction(const OUString &rComment, const 
OUString& rRepeatComment, sal_uInt16 nId) override;
     virtual size_t          LeaveListAction() override;
     virtual size_t          LeaveAndMergeListAction() override;
     virtual bool            IsInListAction() const override;
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx
index 4317b50..46217f6 100644
--- a/reportdesign/inc/UndoActions.hxx
+++ b/reportdesign/inc/UndoActions.hxx
@@ -112,7 +112,7 @@ namespace rptui
         UndoContext( SfxUndoManager& i_undoManager, const OUString& 
i_undoTitle )
             :m_rUndoManager( i_undoManager )
         {
-            m_rUndoManager.EnterListAction( i_undoTitle, OUString() );
+            m_rUndoManager.EnterListAction( i_undoTitle, OUString(), 0 );
         }
 
         ~UndoContext()
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx 
b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index fd6a172..eaf32eb 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -448,7 +448,7 @@ bool OFieldExpressionControl::SaveModified(bool _bAppendRow)
             {
                 bAppend = true;
                 OUString sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP));
-                m_pParent->m_pController->getUndoManager().EnterListAction( 
sUndoAction, OUString() );
+                m_pParent->m_pController->getUndoManager().EnterListAction( 
sUndoAction, OUString(), 0 );
                 xGroup = m_pParent->getGroups()->createGroup();
                 xGroup->setHeaderOn(sal_True);
 
@@ -787,7 +787,7 @@ void OFieldExpressionControl::DeleteRows()
             {
                 bFirstTime = false;
                 OUString sUndoAction(ModuleRes(RID_STR_UNDO_REMOVE_SELECTION));
-                m_pParent->m_pController->getUndoManager().EnterListAction( 
sUndoAction, OUString() );
+                m_pParent->m_pController->getUndoManager().EnterListAction( 
sUndoAction, OUString(), 0 );
             }
 
             sal_Int32 nGroupPos = m_aGroupPositions[nIndex];
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx 
b/reportdesign/source/ui/report/SectionWindow.cxx
index 2c6de37..c87e80d 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -320,7 +320,7 @@ void OSectionWindow::zoom(const Fraction& _aZoom)
 IMPL_LINK_NOARG_TYPED( OSectionWindow, StartSplitHdl, Splitter*, void)
 {
     const OUString sUndoAction( ModuleRes( RID_STR_UNDO_CHANGE_SIZE ) );
-    
getViewsWindow()->getView()->getReportView()->getController().getUndoManager().EnterListAction(
 sUndoAction, OUString() );
+    
getViewsWindow()->getView()->getReportView()->getController().getUndoManager().EnterListAction(
 sUndoAction, OUString(), 0 );
 }
 
 IMPL_LINK_NOARG_TYPED( OSectionWindow, EndSplitHdl, Splitter*, void )
diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx 
b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index 83b1ced..6cdd7ad 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 );
+    pUndoManager->EnterListAction( aUndo, aUndo, 0 );
 
     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 4a03c7e..a69c82f 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 );
+    pUndoManager->EnterListAction( aUndo, aUndo, 0 );
 
     if (mpRandomMethodRadio->IsChecked())
     {
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx 
b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
index 02a3e71..090a4ce 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
@@ -283,7 +283,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 );
+    pUndoManager->EnterListAction( aUndo, aUndo, 0 );
 
     ScRange aOutputRange = ApplyOutput(pDocShell);
 
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx 
b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
index df6dc01..d366a39 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
@@ -322,7 +322,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 );
+    pUndoManager->EnterListAction( aUndo, aUndo, 0 );
 
     ScRange aOutputRange = ApplyOutput(pDocShell);
 
diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index 7f47245..0427b03 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1799,7 +1799,7 @@ 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 );
+        rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
 
     itr = aMark.begin();
     for (; itr != itrEnd && nTabCount; ++itr)
@@ -2226,7 +2226,7 @@ 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 );
+        rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
 
     itr = aMark.begin();
     for (; itr != itrEnd && *itr < nTabCount; ++itr)
@@ -5201,7 +5201,7 @@ bool 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 );
+            rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
 
         aFormula = aFormula.copy(1, aFormula.getLength()-2);
 
@@ -5257,7 +5257,7 @@ bool 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 
);
+                    rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 
0 );
                 }
 
                 ScAreaLink* pOldArea = static_cast<ScAreaLink*>(pBase);
@@ -5455,7 +5455,7 @@ void ScDocFunc::ConvertFormulaToValue( const ScRange& 
rRange, bool bRecord, bool
 void ScDocFunc::EnterListAction( sal_uInt16 nNameResId )
 {
     OUString aUndo( ScGlobal::GetRscString( nNameResId ) );
-    rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo );
+    rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
 }
 
 void ScDocFunc::EndListAction()
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index c3e9671..a9f3871 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -204,7 +204,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                             if (bUndo)
                             {
                                 OUString aStrImport = ScGlobal::GetRscString( 
STR_UNDO_IMPORTDATA );
-                                GetUndoManager()->EnterListAction( aStrImport, 
aStrImport );
+                                GetUndoManager()->EnterListAction( aStrImport, 
aStrImport, 0 );
                             }
 
                             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 5e9c762..2c7d0fe 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -625,7 +625,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
                             if (bUpdate)
                                 pOutliner->SetUpdateMode( false );
                             OUString aName = ScGlobal::GetRscString( 
STR_UNDO_DELETECONTENTS );
-                            pOutliner->GetUndoManager().EnterListAction( 
aName, aName );
+                            pOutliner->GetUndoManager().EnterListAction( 
aName, aName, 0 );
                             bChanged = true;
                         }
 
diff --git a/sc/source/ui/drawfunc/futext3.cxx 
b/sc/source/ui/drawfunc/futext3.cxx
index f59e889..906ea89 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -83,7 +83,7 @@ void FuText::StopEditMode(bool /*bTextDirection*/)
         if(pCalcUndo)
         {
             const OUString aUndoStr = ScGlobal::GetRscString( 
STR_UNDO_EDITNOTE );
-            pUndoMgr->EnterListAction( aUndoStr, aUndoStr );
+            pUndoMgr->EnterListAction( aUndoStr, aUndoStr, 0 );
 
             /*  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 e389787..9ac0cd2 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2266,7 +2266,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 );
+                    pData->GetDocShell()->GetUndoManager()->EnterListAction( 
aUndo, aUndo, 0 );
 
                     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 b83c750..2b1dd9a 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1005,7 +1005,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 );
+                        pDocSh->GetUndoManager()->EnterListAction( aUndo, 
aUndo, 0 );
 
                         ScImportExport aImport( pDoc, aRange.aStart );
                         ScAsciiOptions aOptions;
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 407f029..8d22edf 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -325,7 +325,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 );
+        pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
 
         ScRange aRange;
         pDBData->GetArea( aRange );
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index aadea8b..bd8eedc 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -2044,7 +2044,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 );
+    pMgr->EnterListAction( aUndo, aUndo, 0 );
 
     OUString aNewTabName;
     pDoc->CreateValidTabName(aNewTabName);
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index c23a7be..1097321 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -138,7 +138,7 @@ static void lcl_RemoveAttribs( EditView& rEditView )
     pEngine->SetUpdateMode(false);
 
     OUString aName = ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );
-    pEngine->GetUndoManager().EnterListAction( aName, aName );
+    pEngine->GetUndoManager().EnterListAction( aName, aName, 0 );
 
     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 bc8f446..66ebb14 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -574,7 +574,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
                             if ( bUndo )
                             {
                                 OUString aUndo = ScGlobal::GetRscString( 
STR_UNDO_EDITCELLSTYLE );
-                                pDocSh->GetUndoManager()->EnterListAction( 
aUndo, aUndo );
+                                pDocSh->GetUndoManager()->EnterListAction( 
aUndo, aUndo, 0 );
                                 bListAction = true;
                             }
 
@@ -632,7 +632,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
                                 if ( bUndo )
                                 {
                                     OUString aUndo = ScGlobal::GetRscString( 
STR_UNDO_EDITCELLSTYLE );
-                                    pDocSh->GetUndoManager()->EnterListAction( 
aUndo, aUndo );
+                                    pDocSh->GetUndoManager()->EnterListAction( 
aUndo, aUndo, 0 );
                                     bListAction = true;
                                 }
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 18dbaad..8b3c334 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4255,7 +4255,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 );
+                pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
 
                 SCsCOL nCorrectCursorPosCol = 0;
                 SCsROW nCorrectCursorPosRow = 0;
@@ -4411,7 +4411,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* 
pTransObj, SCCOL nDestPos
             if (pSourceSh)
             {
                 OUString aUndo = ScGlobal::GetRscString( STR_UNDO_COPY );
-                pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo );
+                pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
 
                 bDone = true;
                 if ( meDragInsertMode != INS_NONE )
@@ -4471,7 +4471,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 );
+            pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
 
             bDone = true;
             if ( meDragInsertMode != INS_NONE )
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 1c1fee5..3ebc3cd 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 );
+                    pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 
);
                 }
 
                 bool bGrow = !bHide && nNew > nPagebreakBreak;
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index cba480b..e6c8539 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -656,7 +656,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
 
                     ::svl::IUndoManager* pUndoManager = 
pDocSh->GetUndoManager();
                     OUString aUndo = ScGlobal::GetRscString( STR_UNDO_TAB_RTL 
);
-                    pUndoManager->EnterListAction( aUndo, aUndo );
+                    pUndoManager->EnterListAction( aUndo, aUndo, 0 );
 
                     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 04e0829..c1bd5d8 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1182,7 +1182,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 );
+        pUndoMgr->EnterListAction( aUndo, aUndo, 0 );
     }
 
     if (bClipOver)
@@ -1571,7 +1571,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);
+        pUndoMgr->EnterListAction(aUndo, aUndo, 0);
 
         ScUndoPasteOptions aOptions;            // store options for repeat
         aOptions.nFunction  = nFunction;
@@ -1731,7 +1731,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);
+        pUndoMgr->EnterListAction(aUndo, aUndo, 0);
 
         ScUndoPasteOptions aOptions;            // store options for repeat
         aOptions.nFunction  = nFunction;
@@ -1802,7 +1802,7 @@ bool ScViewFunc::MoveBlockTo( const ScRange& rSource, 
const ScAddress& rDestPos,
         if ( bRecord )
         {
             OUString aUndo = ScGlobal::GetRscString( bCut ? STR_UNDO_MOVE : 
STR_UNDO_COPY );
-            pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo );
+            pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
         }
 
         //  collect ranges of consecutive selected tables
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index 2a30506..a366ec9 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -438,7 +438,7 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const 
OUString& rUndoStr)
         }
 
         ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
-        pUndoMgr->EnterListAction(rUndoStr, rUndoStr);
+        pUndoMgr->EnterListAction(rUndoStr, rUndoStr, 0);
 
         pDocSh->GetDocFunc().SetValueCell(aCurPos, fVal, true);
 
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index a07ed37..fdc4233 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2292,7 +2292,7 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const 
ScTableProtection& rProtect )
     if (bUndo)
     {
         OUString aUndo = ScGlobal::GetRscString( STR_UNDO_PROTECT_TAB );
-        pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo );
+        pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
     }
 
     ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
@@ -2322,7 +2322,7 @@ void ScViewFunc::Protect( SCTAB nTab, const OUString& 
rPassword )
         if (bUndo)
         {
             OUString aUndo = ScGlobal::GetRscString( STR_UNDO_PROTECT_TAB );
-            pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo );
+            pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
         }
 
         ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
@@ -2354,7 +2354,7 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& 
rPassword )
         if (bUndo)
         {
             OUString aUndo = ScGlobal::GetRscString( STR_UNDO_UNPROTECT_TAB );
-            pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo );
+            pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0 );
         }
 
         ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx
index 53bfc4b..ecea0ed 100644
--- a/sd/inc/undo/undomanager.hxx
+++ b/sd/inc/undo/undomanager.hxx
@@ -31,7 +31,7 @@ class UndoManager : public SdrUndoManager
 public:
     UndoManager( sal_uInt16 nMaxUndoActionCount = 20 );
 
-    virtual void            EnterListAction(const OUString &rComment, const 
OUString& rRepeatComment, sal_uInt16 nId=0) override;
+    virtual void            EnterListAction(const OUString &rComment, const 
OUString& rRepeatComment, sal_uInt16 nId) override;
 
     virtual void            AddUndoAction( SfxUndoAction *pAction, bool 
bTryMerg=false ) override;
 
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 36e16cc..fe2f66c 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -488,7 +488,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
     if( mpDocSh )
     {
         pUndoMgr = mpDocSh->GetUndoManager();
-        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_INSERTPAGES), "");
+        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_INSERTPAGES), "", 0);
     }
 
     // Refactored copy'n'pasted layout name collection into 
IterateBookmarkPages
@@ -1426,7 +1426,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
 
     if (bUndo)
     {
-        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), 
OUString());
+        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), 
OUString(), 0);
     }
 
     SdPage* pSelectedPage   = GetSdPage(nSdPageNum, PK_STANDARD);
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
index 44c10f1..c8ae5ed 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -249,7 +249,7 @@ void lcl_CreateUndoForPages(
         return;
 
     OUString aComment( SdResId(STR_UNDO_SLIDE_PARAMS) );
-    pManager->EnterListAction(aComment, aComment);
+    pManager->EnterListAction(aComment, aComment, 0);
     SdUndoGroup* pUndoGroup = new SdUndoGroup( pDoc );
     pUndoGroup->SetComment( aComment );
 
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index d98fe2f..9bd3419 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -128,7 +128,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
         // prepare undo
         ::svl::IUndoManager& rUndoMgr =  pOL->GetUndoManager();
         rUndoMgr.EnterListAction(SD_RESSTR(STR_UNDO_INSERT_SPECCHAR),
-                                    "" );
+                                    "", 0 );
 
         // insert given text
         OUString aStr( cMark );
@@ -256,7 +256,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
 
             ::svl::IUndoManager& rUndoMgr =  pOL->GetUndoManager();
             rUndoMgr.EnterListAction(SD_RESSTR(STR_UNDO_INSERT_SPECCHAR),
-                                     "" );
+                                     "", 0 );
             pOV->InsertText(aChars, true);
 
             // set attributes (set font)
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index b768b07..c1c7a73 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -637,7 +637,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
         nNewPages = 0;
 
         rDocliner.GetUndoManager().EnterListAction(
-                                    SD_RESSTR(STR_UNDO_INSERT_FILE), 
OUString() );
+                                    SD_RESSTR(STR_UNDO_INSERT_FILE), 
OUString(), 0 );
 
         sal_Int32 nSourcePos = 0;
         SfxStyleSheet* pStyleSheet = pPage->GetStyleSheetForPresObj( 
PRESOBJ_OUTLINE );
diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index a7068b0..2f4c672 100644
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -618,7 +618,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& 
rReq )
 
         // with 'following curves', we have an additional UndoAction
         // therefore cling? here
-        pUndoMgr->EnterListAction(aComment, aComment);
+        pUndoMgr->EnterListAction(aComment, aComment, 0);
 
         // create undo group
         SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc);
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 96a1ef3..91670b3 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -412,7 +412,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* 
pParent )
             {
                 OUString aComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
                 ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
-                pUndoMgr->EnterListAction(aComment, aComment);
+                pUndoMgr->EnterListAction(aComment, aComment, 0);
                 SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc);
                 pUndoGroup->SetComment(aComment);
 
diff --git a/sd/source/ui/sidebar/DocumentHelper.cxx 
b/sd/source/ui/sidebar/DocumentHelper.cxx
index 9e1d855..61205a2 100644
--- a/sd/source/ui/sidebar/DocumentHelper.cxx
+++ b/sd/source/ui/sidebar/DocumentHelper.cxx
@@ -320,7 +320,7 @@ void DocumentHelper::AssignMasterPageToPageList (
 
     ::svl::IUndoManager* pUndoMgr = 
rTargetDocument.GetDocSh()->GetUndoManager();
     if( pUndoMgr )
-        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), 
OUString());
+        pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), 
OUString(), 0);
 
     SdPage* pMasterPageInDocument = 
ProvideMasterPage(rTargetDocument,pMasterPage,rpPageList);
     if (pMasterPageInDocument == nullptr)
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx 
b/sd/source/ui/view/ViewShellImplementation.cxx
index 7944304..75c5ca1 100644
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -175,7 +175,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
         if( pUndoManager )
         {
             OUString aComment( SdResId(STR_UNDO_MODIFY_PAGE) );
-            pUndoManager->EnterListAction(aComment, aComment);
+            pUndoManager->EnterListAction(aComment, aComment, 0);
             ModifyPageUndoAction* pAction = new ModifyPageUndoAction(
                 pDocument, pUndoPage, aNewName, aNewAutoLayout, bBVisible, 
bBObjsVisible);
             pUndoManager->AddUndoAction(pAction);
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 4343113..f929197 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -181,7 +181,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet,
                     // replace placeholder by template name
                     OUString aComment(SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT));
                     aComment = aComment.replaceFirst("$", 
SD_RESSTR(STR_PSEUDOSHEET_OUTLINE));
-                    mpDocSh->GetUndoManager()->EnterListAction( aComment, 
OUString() );
+                    mpDocSh->GetUndoManager()->EnterListAction( aComment, 
OUString(), 0 );
 
                     std::vector<Paragraph*> aSelList;
                     pOV->CreateSelectionList(aSelList);
@@ -545,7 +545,7 @@ void DrawView::DeleteMarked()
     {
         OUString aUndo(SVX_RESSTR(STR_EditDelete));
         aUndo = aUndo.replaceFirst("%1", GetDescriptionOfMarkedObjects());
-        pUndoManager->EnterListAction(aUndo, aUndo);
+        pUndoManager->EnterListAction(aUndo, aUndo, 0);
     }
 
     SdPage* pPage = nullptr;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 40e34a0..4852ef3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -210,7 +210,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
             if( rMarkList.GetMarkCount() == 1 )
             {
-                pUndoManager->EnterListAction("", "");
+                pUndoManager->EnterListAction("", "", 0);
                 mpDrawView->BegUndo();
 
                 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 0359203..09f1008f 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1455,7 +1455,7 @@ void OutlineView::IgnoreCurrentPageChanges (bool 
bIgnoreChanges)
     and or the drawing document model. It will create needed undo actions */
 void OutlineView::BeginModelChange()
 {
-    mrOutliner.GetUndoManager().EnterListAction("", "");
+    mrOutliner.GetUndoManager().EnterListAction("", "", 0);
     BegUndo(SD_RESSTR(STR_UNDO_CHANGE_TITLE_AND_LAYOUT));
 }
 
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index b94daa4..6ae28cd 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -483,7 +483,7 @@ void SdrModel::BegUndo()
 {
     if( mpImpl->mpUndoManager )
     {
-        mpImpl->mpUndoManager->EnterListAction("","");
+        mpImpl->mpUndoManager->EnterListAction("","",0);
         nUndoLevel++;
     }
     else if( IsUndoEnabled() )
@@ -504,7 +504,7 @@ void SdrModel::BegUndo(const OUString& rComment)
 {
     if( mpImpl->mpUndoManager )
     {
-        mpImpl->mpUndoManager->EnterListAction( rComment, "" );
+        mpImpl->mpUndoManager->EnterListAction( rComment, "", 0 );
         nUndoLevel++;
     }
     else if( IsUndoEnabled() )
@@ -526,7 +526,7 @@ void SdrModel::BegUndo(const OUString& rComment, const 
OUString& rObjDescr, SdrR
         {
             aComment = aComment.replaceFirst("%1", rObjDescr);
         }
-        mpImpl->mpUndoManager->EnterListAction( aComment,"" );
+        mpImpl->mpUndoManager->EnterListAction( aComment,"",0 );
         nUndoLevel++;
     }
     else if( IsUndoEnabled() )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to