sw/inc/crsrsh.hxx                               |   13 +++++++------
 sw/qa/extras/mailmerge/mailmerge.cxx            |    2 +-
 sw/source/core/crsr/crsrsh.cxx                  |   12 ++++++------
 sw/source/core/docnode/section.cxx              |    2 +-
 sw/source/core/edit/autofmt.cxx                 |    4 ++--
 sw/source/core/edit/edfld.cxx                   |    2 +-
 sw/source/core/edit/editsh.cxx                  |    2 +-
 sw/source/core/edit/edlingu.cxx                 |   22 +++++++++++-----------
 sw/source/core/edit/edtox.cxx                   |    2 +-
 sw/source/core/edit/edundo.cxx                  |    4 ++--
 sw/source/core/fields/fldlst.cxx                |    2 +-
 sw/source/core/frmedt/fecopy.cxx                |    6 +++---
 sw/source/core/text/EnhancedPDFExportHelper.cxx |    2 +-
 sw/source/core/txtnode/txtedt.cxx               |    2 +-
 sw/source/core/undo/docundo.cxx                 |    2 +-
 sw/source/filter/basflt/shellio.cxx             |    2 +-
 sw/source/ui/chrdlg/drpcps.cxx                  |    2 +-
 sw/source/ui/dbui/mmlayoutpage.cxx              |    4 ++--
 sw/source/ui/dbui/mmresultdialogs.cxx           |    6 +++---
 sw/source/ui/index/swuiidxmrk.cxx               |    2 +-
 sw/source/ui/misc/titlepage.cxx                 |    2 +-
 sw/source/uibase/app/applab.cxx                 |    4 ++--
 sw/source/uibase/app/docsh.cxx                  |    2 +-
 sw/source/uibase/dochdl/swdtflvr.cxx            |    2 +-
 sw/source/uibase/docvw/PageBreakWin.cxx         |    2 +-
 sw/source/uibase/docvw/edtwin.cxx               |    4 ++--
 sw/source/uibase/fldui/fldmgr.cxx               |    2 +-
 sw/source/uibase/inc/wrtsh.hxx                  |    2 +-
 sw/source/uibase/lingu/olmenu.cxx               |    8 ++++----
 sw/source/uibase/misc/redlndlg.cxx              |    2 +-
 sw/source/uibase/ribbar/inputwin.cxx            |    6 +++---
 sw/source/uibase/shells/langhelper.cxx          |    2 +-
 sw/source/uibase/shells/listsh.cxx              |    2 +-
 sw/source/uibase/shells/tabsh.cxx               |    4 ++--
 sw/source/uibase/shells/textfld.cxx             |   14 +++++++-------
 sw/source/uibase/shells/textsh1.cxx             |    8 ++++----
 sw/source/uibase/uiview/formatclipboard.cxx     |    2 +-
 sw/source/uibase/uiview/view2.cxx               |    2 +-
 sw/source/uibase/uiview/viewling.cxx            |    4 ++--
 sw/source/uibase/uiview/viewsrch.cxx            |    4 ++--
 sw/source/uibase/utlui/content.cxx              |    2 +-
 sw/source/uibase/wrtsh/delete.cxx               |   16 ++++++++--------
 sw/source/uibase/wrtsh/select.cxx               |   10 +++++-----
 sw/source/uibase/wrtsh/wrtsh1.cxx               |    4 ++--
 sw/source/uibase/wrtsh/wrtsh4.cxx               |   12 ++++++------
 45 files changed, 109 insertions(+), 108 deletions(-)

New commits:
commit 2308bea5ba38250133d7e344484e688ecaab6d8d
Author: Michael Stahl <mst...@redhat.com>
Date:   Fri May 12 21:31:15 2017 +0200

    sw: change SwCursorShell::Pop() parameter from meaningless bool to enum
    
    Change-Id: Iadc660025e1501118cb0a659d92d42af924b1c6f

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 26b33a3df3c2..24e5b4ea3672 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -418,16 +418,17 @@ public:
                       bool bTstHit = false);   // only exact matches
     void KillPams();
 
-    // story a copy of the cursor in the stack
+    /// store a copy of the current cursor on the cursor stack
     void Push();
+    enum class PopMode { DeleteCurrent, DeleteStack };
     /*
-     * Delete a cursor (controlled by bOldCursor)
-     *      - from stack or (bOldCursor = true)
-     *      - delete the current one and replace it with the cursor from the
+     * Delete a cursor
+     *    - either from the top of the stack
+     *    - or delete the current one and replace it with the cursor from the
      *      stack
-     * Return: whether there was one left one the stack
+     *  @return <true> if there was one on the stack, <false> otherwise
      */
-    bool Pop( bool bOldCursor = true );
+    bool Pop(PopMode = PopMode::DeleteStack);
     /*
      * Combine 2 Cursors.
      * Delete the topmost from the stack and move its Mark into the current.
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx 
b/sw/qa/extras/mailmerge/mailmerge.cxx
index 9a6c23d1dbdd..e97edbd11306 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -342,7 +342,7 @@ int MMTest::documentStartPageNumber( int document ) const
     shell->Push();
     shell->GotoMark( mark->get());
     shell->GetPageNum( page, dummy );
-    shell->Pop(false);
+    shell->Pop(SwCursorShell::PopMode::DeleteCurrent);
     return page;
 }
 
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 1ebdcd656669..e3494ff9ef8b 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2000,11 +2000,11 @@ void SwCursorShell::Push()
 
 /** delete cursor
 
-    @param bOldCursor If <true> so delete from stack, if <false> delete current
+    @param eDelete  delete from stack, or delete current
                     and assign the one from stack as the new current cursor.
     @return <true> if there was one on the stack, <false> otherwise
 */
-bool SwCursorShell::Pop( bool bOldCursor )
+bool SwCursorShell::Pop(PopMode const eDelete)
 {
     SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed
 
@@ -2020,12 +2020,12 @@ bool SwCursorShell::Pop( bool bOldCursor )
         pTmp = dynamic_cast<SwShellCursor*>(m_pStackCursor->GetNext());
     }
 
-    if( bOldCursor ) // delete from stack
+    if (PopMode::DeleteStack == eDelete)
         delete m_pStackCursor;
 
     m_pStackCursor = pTmp; // assign new one
 
-    if( !bOldCursor )
+    if (PopMode::DeleteCurrent == eDelete)
     {
         SwCursorSaveState aSaveState( *m_pCurrentCursor );
 
@@ -3477,7 +3477,7 @@ void SwCursorShell::GetSmartTagRect( const Point& rPt, 
SwRect& rSelectRect )
             const sal_Int32 nLineStart = 
GetCursor()->GetPoint()->nContent.GetIndex();
             RightMargin();
             const sal_Int32 nLineEnd = 
GetCursor()->GetPoint()->nContent.GetIndex();
-            Pop(false);
+            Pop(PopMode::DeleteCurrent);
 
             // make sure the selection build later from the data below does not
             // include "in word" character to the left and right in order to
@@ -3517,7 +3517,7 @@ void SwCursorShell::GetSmartTagRect( const Point& rPt, 
SwRect& rSelectRect )
             SwRect aEndRect;
             pContentFrame->GetCharRect( aEndRect, *pCursor->GetPoint(),&aState 
);
             rSelectRect = aStartRect.Union( aEndRect );
-            Pop(false);
+            Pop(PopMode::DeleteCurrent);
         }
     }
 }
diff --git a/sw/source/core/docnode/section.cxx 
b/sw/source/core/docnode/section.cxx
index cb3e24a58f95..79e181f6770f 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1415,7 +1415,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, 
SwSectionNode& rSectNd )
 
         if( pESh )
         {
-            pESh->Pop( false );
+            pESh->Pop(SwCursorShell::PopMode::DeleteCurrent);
             pPam = nullptr; // pam was deleted earlier
         }
     }
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 8598414ac6b1..09bd92e16f6f 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2200,7 +2200,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, 
SvxSwAutoFormatFlags& rFlags,
                 if( m_aFlags.bAFormatByInput && m_aFlags.bCreateTable && 
DoTable() )
                 {
                     //JP 30.09.96: DoTable() builds on PopCursor and 
MoveCursor after AutoFormat!
-                    pEdShell->Pop( false );
+                    pEdShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
                     *pEdShell->GetCursor() = m_aDelPam;
                     pEdShell->Push();
 
@@ -2608,7 +2608,7 @@ void SwEditShell::AutoFormatBySplitNode()
                                     &pCursor->GetPoint()->nNode );
 
             //JP 30.09.96: DoTable() builds on PopCursor and MoveCursor!
-            Pop( false );
+            Pop(PopMode::DeleteCurrent);
             pCursor = GetCursor();
         }
         pCursor->DeleteMark();
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index f7d4b1b71f87..9e572fb73385 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -141,7 +141,7 @@ void SwEditShell::FieldToText( SwFieldType* pType )
         pClient->SwClientNotifyCall( *pType, aHint );
     }
 
-    Pop( false );
+    Pop(PopMode::DeleteCurrent);
     EndAllAction();
     EndUndo( SwUndoId::DELETE );
 }
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 4772f2d756d0..c01a28fcfde6 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -801,7 +801,7 @@ void SwEditShell::SetNumberingRestart()
         }
     }
 
-    Pop(false);
+    Pop(PopMode::DeleteCurrent);
     EndAllAction();
 }
 
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 6bebf435306c..2c01c9e5cff0 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -224,7 +224,7 @@ void SwLinguIter::Start_( SwEditShell *pShell, 
SwDocPositions eStart,
             pSh->Push();
             pSh->DestroyCursor();
         }
-        pSh->Pop( false );
+        pSh->Pop(SwCursorShell::PopMode::DeleteCurrent);
     }
     else
     {
@@ -260,7 +260,7 @@ void SwLinguIter::End_(bool bRestoreSelection)
     if(bRestoreSelection)
     {
         while( nCursorCnt-- )
-            pSh->Pop( false );
+            pSh->Pop(SwCursorShell::PopMode::DeleteCurrent);
 
         pSh->KillPams();
         pSh->ClearMark();
@@ -322,7 +322,7 @@ uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, 
sal_uInt16* pPageSt )
         }
         if( bGoOn )
         {
-            pMySh->Pop( false );
+            pMySh->Pop(SwCursorShell::PopMode::DeleteCurrent);
             pCursor = pMySh->GetCursor();
             if ( *pCursor->GetPoint() > *pCursor->GetMark() )
                 pCursor->Exchange();
@@ -390,7 +390,7 @@ uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, 
sal_uInt16* pPageSt )
         }
         if( bGoOn )
         {
-            pMySh->Pop( false );
+            pMySh->Pop(SwCursorShell::PopMode::DeleteCurrent);
             pCursor = pMySh->GetCursor();
             if ( *pCursor->GetPoint() > *pCursor->GetMark() )
                 pCursor->Exchange();
@@ -494,7 +494,7 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, 
sal_uInt16* pPageSt )
 
         if( bGoOn )
         {
-            pMySh->Pop( false );
+            pMySh->Pop(SwCursorShell::PopMode::DeleteCurrent);
             pCursor = pMySh->GetCursor();
             if ( *pCursor->GetPoint() > *pCursor->GetMark() )
                 pCursor->Exchange();
@@ -892,7 +892,7 @@ uno::Reference< XSpellAlternatives >
                 const sal_Int32 nLineStart = 
GetCursor()->GetPoint()->nContent.GetIndex();
                 RightMargin();
                 const sal_Int32 nLineEnd = 
GetCursor()->GetPoint()->nContent.GetIndex();
-                Pop(false);
+                Pop(PopMode::DeleteCurrent);
 
                 // make sure the selection build later from the data below does
                 // not "in word" character to the left and right in order to
@@ -932,7 +932,7 @@ uno::Reference< XSpellAlternatives >
                 SwRect aEndRect;
                 pContentFrame->GetCharRect( aEndRect, 
*pCursor->GetPoint(),&aState );
                 rSelectRect = aStartRect.Union( aEndRect );
-                Pop(false);
+                Pop(PopMode::DeleteCurrent);
             }
         }
     }
@@ -1017,7 +1017,7 @@ bool SwEditShell::GetGrammarCorrection(
                 const sal_Int32 nLineStart = 
GetCursor()->GetPoint()->nContent.GetIndex();
                 RightMargin();
                 const sal_Int32 nLineEnd = 
GetCursor()->GetPoint()->nContent.GetIndex();
-                Pop(false);
+                Pop(PopMode::DeleteCurrent);
 
                 // make sure the selection build later from the data below does
                 // not include "in word" character to the left and right in
@@ -1057,7 +1057,7 @@ bool SwEditShell::GetGrammarCorrection(
                 SwRect aEndRect;
                 pContentFrame->GetCharRect( aEndRect, 
*pCursor->GetPoint(),&aState );
                 rSelectRect = aStartRect.Union( aEndRect );
-                Pop(false);
+                Pop(PopMode::DeleteCurrent);
             }
         }
     }
@@ -1247,7 +1247,7 @@ void SwEditShell::ApplyChangedSentence(const 
svx::SpellPortions& rNewPortions, b
         // restore cursor to the end of the sentence
         // (will work also if the sentence length has changed,
         // since cursors get updated automatically!)
-        Pop( false );
+        Pop(PopMode::DeleteCurrent);
 
         // collapse cursor to the end of the modified sentence
         *pCursor->Start() = *pCursor->End();
@@ -1388,7 +1388,7 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& 
rPortions, bool bIsGrammarCh
         }
         if( bGoOn )
         {
-            pMySh->Pop( false );
+            pMySh->Pop(SwCursorShell::PopMode::DeleteCurrent);
             pCursor = pMySh->GetCursor();
             if ( *pCursor->GetPoint() > *pCursor->GetMark() )
                 pCursor->Exchange();
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 478d915f7490..e37d8884859c 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -395,7 +395,7 @@ void SwEditShell::ApplyAutoMark()
             }
         }
         KillPams();
-        Pop(false);
+        Pop(PopMode::DeleteCurrent);
     }
     DoUndo(bDoesUndo);
     EndAllAction();
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index 133770d50d6a..58b8af364f45 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -140,7 +140,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount)
         {   // fdo#39003 Pop does not touch the rest of the cursor ring
             KillPams(); // so call this first to get rid of unwanted cursors
         }
-        Pop( !bRestoreCursor );
+        Pop((bRestoreCursor) ? PopMode::DeleteCurrent : PopMode::DeleteStack);
 
         GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOld );
         GetDoc()->getIDocumentRedlineAccess().CompressRedlines();
@@ -192,7 +192,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount)
                     "SwEditShell::Redo(): exception caught: " << e.Message);
         }
 
-        Pop( !bRestoreCursor );
+        Pop((bRestoreCursor) ? PopMode::DeleteCurrent : PopMode::DeleteStack);
 
         GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOld );
         GetDoc()->getIDocumentRedlineAccess().CompressRedlines();
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index 216473997382..438843d5a9ab 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -105,7 +105,7 @@ void SwInputFieldList::PushCursor()
 /// get cursor
 void SwInputFieldList::PopCursor()
 {
-    pSh->Pop(false);
+    pSh->Pop(SwCursorShell::PopMode::DeleteCurrent);
 }
 
 /// go to position of a field
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 4dc6d5140f91..42c09bd5555a 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1106,7 +1106,7 @@ bool SwFEShell::PastePages( SwFEShell& rToFill, 
sal_uInt16 nStartPage, sal_uInt1
     Push();
     if(!GotoPage(nStartPage))
     {
-        Pop(false);
+        Pop(PopMode::DeleteCurrent);
         return false;
     }
     MovePage( GetThisFrame, GetFirstSub );
@@ -1118,7 +1118,7 @@ bool SwFEShell::PastePages( SwFEShell& rToFill, 
sal_uInt16 nStartPage, sal_uInt1
 
     if(!GotoPage(nEndPage))
     {
-        Pop(false);
+        Pop(PopMode::DeleteCurrent);
         return false;
     }
     //if the page starts with a table a paragraph has to be inserted before
@@ -1181,7 +1181,7 @@ bool SwFEShell::PastePages( SwFEShell& rToFill, 
sal_uInt16 nStartPage, sal_uInt1
     }
     GetDoc()->getIDocumentFieldsAccess().UnlockExpFields();
     GetDoc()->getIDocumentFieldsAccess().UpdateFields(false);
-    Pop(false);
+    Pop(PopMode::DeleteCurrent);
     EndAllAction();
 
     return true;
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 369924a4a1e7..e2b7500c16eb 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -2170,7 +2170,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
 
     // Restore view, cursor, and outdev:
     mrSh.LockView( bOldLockView );
-    mrSh.SwCursorShell::Pop( false );
+    mrSh.SwCursorShell::Pop(SwCursorShell::PopMode::DeleteCurrent);
     mrOut.Pop();
 }
 
diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 8bf9f294ab8d..e0c41585bf50 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1199,7 +1199,7 @@ bool SwTextNode::Convert( SwConversionArgs &rArgs )
                 pEditShell->Push();             // save current cursor on stack
                 pEditShell->SetSelection( aCurPaM );
                 bool bIsAsianScript = (SvtScriptType::ASIAN == 
pEditShell->GetScriptType());
-                pEditShell->Pop( false );   // restore cursor from stack
+                pEditShell->Pop(SwCursorShell::PopMode::DeleteCurrent); // 
restore cursor from stack
 
                 if (!bIsAsianScript && 
rArgs.bAllowImplicitChangesForNotConvertibleText)
                 {
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 42417c94af38..a9f107cb1170 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -550,7 +550,7 @@ public:
     {
         if (m_bSaveCursor)
         {
-            m_rShell.Pop( false );
+            m_rShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
         }
     }
 private:
diff --git a/sw/source/filter/basflt/shellio.cxx 
b/sw/source/filter/basflt/shellio.cxx
index d2fa62bf0672..615c0d938780 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -875,7 +875,7 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const 
OUString* pRealFileName )
         if(!bHasMark)
         {
             if( pShell )
-                pShell->Pop( false );
+                pShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
             else
                 delete pPam;
         }
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 135469e6f955..99578d72c177 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -293,7 +293,7 @@ void SwDropCapsPict::UpdatePaintSettings()
             GetFontSettings( *mpPage, maCTLFont, RES_CHRATR_CTL_FONT );
 
             mpPage->rSh.EndCursorMove();
-            mpPage->rSh.Pop(false);
+            mpPage->rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
         }
         else
         {
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx 
b/sw/source/ui/dbui/mmlayoutpage.cxx
index e84429aef9ed..721a51b883be 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -214,7 +214,7 @@ void SwMailMergeLayoutPage::ActivatePage()
                 m_pExampleWrtShell->GotoFly( m_pAddressBlockFormat->GetName() 
);
                 m_pExampleWrtShell->DelRight();
                 m_pAddressBlockFormat = nullptr;
-                m_pExampleWrtShell->Pop(false);
+                m_pExampleWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
             }
             else
             {
@@ -612,7 +612,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& 
rShell, SwMailMergeConfig
     {
         rShell.Push();
         rShell.SplitNode();
-        rShell.Pop(false);
+        rShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
     }
     //put the cursor to the start of the paragraph
     rShell.SttPara();
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index a61fa90c0909..5493126901cb 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -525,7 +525,7 @@ int documentStartPageNumber(SwMailMergeConfigItem* 
pConfigItem, int document)
     shell.Push();
     shell.GotoMark( info.startPageInTarget );
     shell.GetPageNum( page, dummy );
-    shell.Pop(false);
+    shell.Pop(SwCursorShell::PopMode::DeleteCurrent);
     return page;
 }
 
@@ -543,7 +543,7 @@ int documentEndPageNumber(SwMailMergeConfigItem* 
pConfigItem, int document)
         shell.GotoMark( info.startPageInTarget );
         shell.EndPrvPg();
         shell.GetPageNum( page, dummy );
-        shell.Pop(false);
+        shell.Pop(SwCursorShell::PopMode::DeleteCurrent);
         return page;
     }
     else
@@ -552,7 +552,7 @@ int documentEndPageNumber(SwMailMergeConfigItem* 
pConfigItem, int document)
         shell.Push();
         shell.SttEndDoc( false ); // go to doc end
         shell.GetPageNum( page, dummy );
-        shell.Pop(false);
+        shell.Pop(SwCursorShell::PopMode::DeleteCurrent);
         return page;
     }
 }
diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index 6226c55f7c8f..cc5e6ee1567b 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -503,7 +503,7 @@ void SwIndexMarkPane::InsertMark()
     SwTOXMgr aMgr(pSh);
     aMgr.InsertTOXMark(aDesc);
     if(bApplyAll)
-        pSh->Pop(false);
+        pSh->Pop(SwCursorShell::PopMode::DeleteCurrent);
 
     pSh->EndAllAction();
 }
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
index a150e32df126..14751a4ecafa 100644
--- a/sw/source/ui/misc/titlepage.cxx
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -111,7 +111,7 @@ namespace
 
     void lcl_PopCursor(SwWrtShell *pSh)
     {
-        pSh->SwCursorShell::Pop( false );
+        pSh->SwCursorShell::Pop(SwCursorShell::PopMode::DeleteCurrent);
         pSh->EndAllAction();
         pSh->LockView( false );
     }
diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx
index 208cbeb6cec4..8fe5e3493e4c 100644
--- a/sw/source/uibase/app/applab.cxx
+++ b/sw/source/uibase/app/applab.cxx
@@ -327,7 +327,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
                                 pSh->Push();
                                 pSh->SttDoc();
                                 bool bInFly = nullptr != pSh->WizardGetFly();
-                                pSh->Pop( bInFly );
+                                pSh->Pop((bInFly) ? 
SwCursorShell::PopMode::DeleteStack : SwCursorShell::PopMode::DeleteCurrent);
 
                                 if( bInFly )
                                     pSh->EndDoc(true);  // select all content
@@ -354,7 +354,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
                             pSh->EndDoc(true);  // Select everything in the 
frame
                             pSh->InsertSection(aSect);
                         }
-                        pSh->Pop( false );
+                        pSh->Pop(SwCursorShell::PopMode::DeleteCurrent);
                     }
                 }
             }
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 58af1d2cd3f3..4d1b3d9c1d31 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -728,7 +728,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
         //JP 16.05.97: In case the SFX revokes the View while saving
         if (m_pWrtShell)
         {
-            m_pWrtShell->Pop(false);
+            m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
             m_pWrtShell->EndAllAction();
             // #i106906#
             m_pWrtShell->LockView( bFormerLockView );
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 4787dc9a7a4d..897bd01281ae 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3493,7 +3493,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const 
Point& rDragPt,
             }
         }
         rSrcSh.KillPams();
-        rSrcSh.Pop( false );
+        rSrcSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
 
         /* after dragging a table selection inside one shell
             set cursor to the drop position. */
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx 
b/sw/source/uibase/docvw/PageBreakWin.cxx
index 1ca06e2ce527..6611f113f169 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -250,7 +250,7 @@ void SwPageBreakWin::Select()
                         SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
                         { &aItem });
 
-                rSh.Pop( false );
+                rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
             }
             else
             {
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 4645376d7223..f69e8c64184d 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -940,7 +940,7 @@ void SwEditWin::FlushInBuffer()
 
             // at this point now we will insert the buffer text 'normally' 
some lines below...
 
-            rSh.Pop( false );  // pop old cursor from stack
+            rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
 
             if (m_aInBuffer.isEmpty())
                 return;
@@ -1638,7 +1638,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
                     sFormulaEntry = "=";
                 }
                 else
-                    rSh.Pop( false );
+                    rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
             }
             else
             {
diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index d28bb81de56a..14870351d835 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -1335,7 +1335,7 @@ bool SwFieldMgr::InsertField(
                 false, (INP_VAR == (nSubType & 0xff)) ? 1 : 2, false );
         pCurShell->StartInputFieldDlg(pField, false, rData.m_pParent);
 
-        pCurShell->Pop(false);
+        pCurShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
     }
 
     if(bExp && bEvalExp)
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 497f9e9c7b2f..2900b5e4948c 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -130,7 +130,7 @@ public:
         // is there a text- or frameselection?
     bool    HasSelection() const { return SwCursorShell::HasSelection() ||
                                         IsMultiSelection() || IsSelFrameMode() 
|| IsObjSelected(); }
-    bool     Pop( bool bOldCursor = true );
+    bool    Pop(SwCursorShell::PopMode = PopMode::DeleteStack);
 
     void    EnterStdMode();
     bool    IsStdMode() const { return !m_bExtMode && !m_bAddMode && 
!m_bBlockMode; }
diff --git a/sw/source/uibase/lingu/olmenu.cxx 
b/sw/source/uibase/lingu/olmenu.cxx
index 946fa274a6db..a00ddc42404e 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -856,7 +856,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             m_pSh->Push();        // save cursor
             SwLangHelper::SelectCurrentPara( *m_pSh );
             SwLangHelper::SetLanguage( *m_pSh, aNewLangText, true, aCoreSet );
-            m_pSh->Pop( false );  // restore cursor
+            m_pSh->Pop(SwCursorShell::PopMode::DeleteCurrent); // restore 
cursor
         }
         else if (nId == MN_SET_PARA_NONE)
         {
@@ -864,7 +864,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             m_pSh->Push();        // save cursor
             SwLangHelper::SelectCurrentPara( *m_pSh );
             SwLangHelper::SetLanguage_None( *m_pSh, true, aCoreSet );
-            m_pSh->Pop( false );  // restore cursor
+            m_pSh->Pop(SwCursorShell::PopMode::DeleteCurrent); // restore 
cursor
         }
         else if (nId == MN_SET_PARA_RESET)
         {
@@ -872,7 +872,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             m_pSh->Push();        // save cursor
             SwLangHelper::SelectCurrentPara( *m_pSh );
             SwLangHelper::ResetLanguages( *m_pSh, true );
-            m_pSh->Pop( false );  // restore cursor
+            m_pSh->Pop(SwCursorShell::PopMode::DeleteCurrent); // restore 
cursor
         }
         else if (nId == MN_SET_PARA_MORE)
         {
@@ -880,7 +880,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             SwLangHelper::SelectCurrentPara( *m_pSh );
             //Open Format/Character Dialog
             sw_CharDialog( *m_pSh, true, SID_ATTR_CHAR_FONT, nullptr, nullptr 
);
-            m_pSh->Pop( false );  // restore cursor
+            m_pSh->Pop(SwCursorShell::PopMode::DeleteCurrent); // restore 
cursor
         }
     }
 
diff --git a/sw/source/uibase/misc/redlndlg.cxx 
b/sw/source/uibase/misc/redlndlg.cxx
index 32a9df7865b8..d2474432d08c 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -736,7 +736,7 @@ void 
SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli
             pSh->SwCursorShell::Push();
             if( nullptr == (pCurrRedline = pSh->SelNextRedline()))
                 pCurrRedline = pSh->SelPrevRedline();
-            pSh->SwCursorShell::Pop( false );
+            pSh->SwCursorShell::Pop(SwCursorShell::PopMode::DeleteCurrent);
         }
     }
     else
diff --git a/sw/source/uibase/ribbar/inputwin.cxx 
b/sw/source/uibase/ribbar/inputwin.cxx
index 14f11a31b8c9..3a037220b255 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -336,7 +336,7 @@ void  SwInputWindow::ApplyFormula()
     pView->GetViewFrame()->GetDispatcher()->Lock(false);
     pView->GetEditWin().LockKeyInput(false);
     CleanupUglyHackWithUndo();
-    pWrtShell->Pop( false );
+    pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
 
     // Formular should always begin with "=", so remove it here again
     OUString sEdit(comphelper::string::strip(aEdit->GetText(), ' '));
@@ -359,7 +359,7 @@ void  SwInputWindow::CancelFormula()
         pView->GetViewFrame()->GetDispatcher()->Lock( false );
         pView->GetEditWin().LockKeyInput(false);
         CleanupUglyHackWithUndo();
-        pWrtShell->Pop( false );
+        pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
 
         if( bDelSel )
             pWrtShell->EnterStdMode();
@@ -449,7 +449,7 @@ void SwInputWindow::DelBoxContent()
     {
         pWrtShell->StartAllAction();
         pWrtShell->ClearMark();
-        pWrtShell->Pop( false );
+        pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
         pWrtShell->Push();
         pWrtShell->MoveSection( GoCurrSection, fnSectionStart );
         pWrtShell->SetMark();
diff --git a/sw/source/uibase/shells/langhelper.cxx 
b/sw/source/uibase/shells/langhelper.cxx
index 453a4adba303..398105f7df71 100644
--- a/sw/source/uibase/shells/langhelper.cxx
+++ b/sw/source/uibase/shells/langhelper.cxx
@@ -210,7 +210,7 @@ namespace SwLangHelper
                 if (!bForSelection)
                 {
                     // need to release view and restore selection...
-                    rSh.Pop( false );
+                    rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
                     rSh.LockView( false );
                     rSh.EndAction();
                 }
diff --git a/sw/source/uibase/shells/listsh.cxx 
b/sw/source/uibase/shells/listsh.cxx
index 115fda2976c9..9e8d2ca10e5b 100644
--- a/sw/source/uibase/shells/listsh.cxx
+++ b/sw/source/uibase/shells/listsh.cxx
@@ -125,7 +125,7 @@ static void lcl_OutlineUpDownWithSubPoints( SwWrtShell& 
rSh, bool bMove, bool bU
         }
 
         rSh.ClearMark();
-        rSh.Pop( false );
+        rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
     }
 }
 
diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index 86f278f1b3d4..6327ef785d55 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -217,7 +217,7 @@ static SwTableRep*  lcl_TableParamToItemSet( SfxItemSet& 
rSet, SwWrtShell &rSh )
     if(!bTableSel)
     {
         rSh.ClearMark();
-        rSh.Pop(false);
+        rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
         rSh.EndAllAction();
     }
 
@@ -351,7 +351,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet,
             {
                 rSh.ClearMark();
             }
-            rSh.Pop(false);
+            rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
         }
 
         rSh.EndAllAction();
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index 0c4b7c75a9b4..ca6d848d9b1c 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -451,7 +451,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     rSh.Push();
                     rSh.SwCursorShell::Left(1, CRSR_SKIP_CHARS);
                     pPostIt = 
static_cast<SwPostItField*>(aFieldMgr.GetCurField());
-                    rSh.Pop(false); // Restore cursor position
+                    rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore 
cursor position
                 }
 
                 // Client has disabled annotations rendering, no need to
@@ -569,7 +569,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     }
 
                     bool bPrev = pActRed != nullptr;
-                    rSh.Pop(false);
+                    rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
                     rSh.EndAction();
 
                     rSh.ClearMark();
@@ -579,7 +579,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     rSh.Push();
                     pActRed = rSh.SelNextRedline();
                     bool bNext = pActRed != nullptr;
-                    rSh.Pop(false); // Restore cursor position
+                    rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore 
cursor position
 
                     if( rSh.IsCursorPtAtEnd() )
                         rSh.SwapPam();
@@ -961,7 +961,7 @@ IMPL_LINK( SwTextShell, RedlineNextHdl, 
AbstractSvxPostItDialog&, rDlg, void )
 
         pSh->Push();
         const SwRangeRedline *pActRed = pSh->SelNextRedline();
-        pSh->Pop(pActRed != nullptr);
+        pSh->Pop((pActRed != nullptr) ? SwCursorShell::PopMode::DeleteStack : 
SwCursorShell::PopMode::DeleteCurrent);
 
         bool bEnable = false;
 
@@ -970,7 +970,7 @@ IMPL_LINK( SwTextShell, RedlineNextHdl, 
AbstractSvxPostItDialog&, rDlg, void )
             pSh->StartAction();
             pSh->Push();
             bEnable = pSh->SelNextRedline() != nullptr;
-            pSh->Pop(false);
+            pSh->Pop(SwCursorShell::PopMode::DeleteCurrent);
             pSh->EndAction();
         }
 
@@ -1005,7 +1005,7 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, 
AbstractSvxPostItDialog&, rDlg, void )
         // Traveling only if more than one field.
         pSh->Push();
         const SwRangeRedline *pActRed = pSh->SelPrevRedline();
-        pSh->Pop(pActRed != nullptr);
+        pSh->Pop((pActRed != nullptr) ? SwCursorShell::PopMode::DeleteStack : 
SwCursorShell::PopMode::DeleteCurrent);
 
         bool bEnable = false;
 
@@ -1014,7 +1014,7 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, 
AbstractSvxPostItDialog&, rDlg, void )
             pSh->StartAction();
             pSh->Push();
             bEnable = pSh->SelPrevRedline() != nullptr;
-            pSh->Pop(false);
+            pSh->Pop(SwCursorShell::PopMode::DeleteCurrent);
             pSh->EndAction();
         }
 
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 4627172c4728..1cbbff3dcf25 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -152,7 +152,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, 
sal_uInt16 nSlot,const
         bSelectionPut = true;
         if(!bSel)
         {
-            rWrtSh.Pop(false);
+            rWrtSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
             rWrtSh.EndAction();
         }
     }
@@ -413,7 +413,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
 
                     if (bForParagraph || !bForSelection)
                     {
-                        rWrtSh.Pop(false); // restore selection...
+                        rWrtSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // 
restore selection...
                     }
                 }
 
@@ -836,7 +836,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
             rWrtSh.ResetAttr( aAttribs );
             if(!bSel)
             {
-                rWrtSh.Pop(false);
+                rWrtSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
                 rWrtSh.EndAction();
             }
         }
@@ -863,7 +863,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
             rWrtSh.Push();          //save current cursor
             SwLangHelper::SelectCurrentPara( rWrtSh );
             sw_CharDialog( rWrtSh, bUseDialog, nSlot, pArgs, &rReq );
-            rWrtSh.Pop( false );    //restore old cursor
+            rWrtSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // restore old 
cursor
         }
         break;
         case SID_ATTR_LRSPACE :
diff --git a/sw/source/uibase/uiview/formatclipboard.cxx 
b/sw/source/uibase/uiview/formatclipboard.cxx
index 0d41ba96e037..ec7cccef746d 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -415,7 +415,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, 
SfxItemPool& rPool, bool bP
             m_aParaStyle = pFormat->GetName();
     }
 
-    rWrtShell.Pop(false);
+    rWrtShell.Pop(SwCursorShell::PopMode::DeleteCurrent);
     rWrtShell.EndAction();
 }
 
diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 4d3a3e56335e..447b6b134c22 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -181,7 +181,7 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell 
&rWrtSh, sal_uInt16 nWhi
         aAttribs.insert( nWhichId );
         rWrtSh.ResetAttr( aAttribs );
 
-        rWrtSh.Pop( false );
+        rWrtSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
         rWrtSh.LockView( false );
         rWrtSh.EndAction();
     }
diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index 3accf548d0da..69a4c5e6252f 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -770,7 +770,7 @@ bool SwView::ExecSpellPopup(const Point& rPt)
                 }
             }
 
-            m_pWrtShell->Pop( false );
+            m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
             m_pWrtShell->LockView( bOldViewLock );
         }
     }
@@ -817,7 +817,7 @@ void SwView::ExecSmartTagPopup( const Point& rPt )
             xComponent->dispose();
     }
 
-    m_pWrtShell->Pop( false );
+    m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
     m_pWrtShell->LockView( bOldViewLock );
 }
 
diff --git a/sw/source/uibase/uiview/viewsrch.cxx 
b/sw/source/uibase/uiview/viewsrch.cxx
index 2b50e82e6925..f2f0277d77be 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -381,7 +381,7 @@ void SwView::ExecSearch(SfxRequest& rReq)
                             // create it just to overwrite it with stack cursor
                             m_pWrtShell->CreateCursor();
                             // i#8288 restore the original cursor position
-                            m_pWrtShell->Pop(false);
+                            
m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
                         }
                         m_pWrtShell->EndAllAction();
                     }
@@ -601,7 +601,7 @@ bool SwView::SearchAndWrap(bool bApi)
         // Try again with WrapAround?
 
     m_pWrtShell->StartAllAction();
-    m_pWrtShell->Pop(false);
+    m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
     pWait.reset(new SwWait( *GetDocShell(), true ));
 
     bool bSrchBkwrd = SwDocPositions::Start == aOpts.eEnd;
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 796bfb10ebf7..38bbb54996de 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2451,7 +2451,7 @@ void SwContentTree::ExecCommand(const OUString& rCmd, 
bool bOutlineWithChildren)
         }
 
         pShell->ClearMark();
-        pShell->Pop(false); // Cursor is now back at the current heading.
+        pShell->Pop(SwCursorShell::PopMode::DeleteCurrent); // Cursor is now 
back at the current heading.
     }
 
     if (bStartedAction)
diff --git a/sw/source/uibase/wrtsh/delete.cxx 
b/sw/source/uibase/wrtsh/delete.cxx
index 6e020bbd4cfa..d49fb8d299ec 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -94,7 +94,7 @@ void SwWrtShell::DelLine()
     SwCursorShell::RightMargin();
 
     long nRet = Delete();
-    Pop(false);
+    Pop(PopMode::DeleteCurrent);
     if( nRet )
         UpdateAttr();
 }
@@ -293,7 +293,7 @@ long SwWrtShell::DelRight()
             }
 
             // restore cursor
-            SwCursorShell::Pop( false );
+            SwCursorShell::Pop(PopMode::DeleteCurrent);
 
             if( bDelFull )
             {
@@ -338,7 +338,7 @@ long SwWrtShell::DelRight()
                 }
 
                 // restore cursor
-                SwCursorShell::Pop( false );
+                SwCursorShell::Pop(PopMode::DeleteCurrent);
             }
 
             // If we are just ahead of a fieldmark, then remove it completely
@@ -417,11 +417,11 @@ void SwWrtShell::DelToEndOfPara()
     SetMark();
     if( !MovePara(GoCurrPara,fnParaEnd))
     {
-        Pop(false);
+        Pop(PopMode::DeleteCurrent);
         return;
     }
     long nRet = Delete();
-    Pop(false);
+    Pop(PopMode::DeleteCurrent);
     if( nRet )
         UpdateAttr();
 }
@@ -434,11 +434,11 @@ void SwWrtShell::DelToStartOfPara()
     SetMark();
     if( !MovePara(GoCurrPara,fnParaStart))
     {
-        Pop(false);
+        Pop(PopMode::DeleteCurrent);
         return;
     }
     long nRet = Delete();
-    Pop(false);
+    Pop(PopMode::DeleteCurrent);
     if( nRet )
         UpdateAttr();
 }
@@ -480,7 +480,7 @@ long SwWrtShell::DelToEndOfSentence()
                 nRet = DelFullPara() ? 1 : 0;
             }
         }
-        Pop(false);
+        Pop(PopMode::DeleteCurrent);
     }
     else
     {
diff --git a/sw/source/uibase/wrtsh/select.cxx 
b/sw/source/uibase/wrtsh/select.cxx
index cf06aa055749..277a9ba770a3 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -150,7 +150,7 @@ long SwWrtShell::SelAll()
             bool bIsFullSel = !MoveSection( GoCurrSection, fnSectionStart);
             SwapPam();
             bIsFullSel &= !MoveSection( GoCurrSection, fnSectionEnd);
-            Pop(false);
+            Pop(PopMode::DeleteCurrent);
             GoStart(true, &bMoveTable, false, !bIsFullSel);
         }
         else
@@ -445,7 +445,7 @@ long SwWrtShell::ExtSelWrd(const Point *pPt, bool )
     default:    bMoveCursor = false;  break;
     }
 
-    SwCursorShell::Pop( false );              // restore the saved cursor
+    SwCursorShell::Pop(PopMode::DeleteCurrent); // restore the saved cursor
 
     if( bMoveCursor )
     {
@@ -464,7 +464,7 @@ long SwWrtShell::ExtSelWrd(const Point *pPt, bool )
         }
         else
         {
-            SwCursorShell::Pop( false );
+            SwCursorShell::Pop(PopMode::DeleteCurrent);
             if( bToTop )
                 SwapPam();
         }
@@ -889,7 +889,7 @@ int SwWrtShell::IntelligentCut(SelectionType nSelection, 
bool bCut)
             SetMark();
             SwCursorShell::Left(1,CRSR_SKIP_CHARS);
             SwFEShell::Delete();
-            Pop( false );
+            Pop(PopMode::DeleteCurrent);
         }
     }
     else if(cWord == WORD_NO_SPACE && cNext == ' ')
@@ -903,7 +903,7 @@ int SwWrtShell::IntelligentCut(SelectionType nSelection, 
bool bCut)
             SetMark();
             SwCursorShell::Right(1,CRSR_SKIP_CHARS);
             SwFEShell::Delete();
-            Pop( false );
+            Pop(PopMode::DeleteCurrent);
         }
     }
     return cWord;
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 617fc2cecf20..eaff182e80f7 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1669,9 +1669,9 @@ SwWrtShell::~SwWrtShell()
     SwTransferable::ClearSelection( *this );
 }
 
-bool SwWrtShell::Pop( bool bOldCursor )
+bool SwWrtShell::Pop(SwCursorShell::PopMode const eDelete)
 {
-    bool bRet = SwCursorShell::Pop( bOldCursor );
+    bool bRet = SwCursorShell::Pop(eDelete);
     if( bRet && IsSelection() )
     {
         m_fnSetCursor = &SwWrtShell::SetCursorKillSel;
diff --git a/sw/source/uibase/wrtsh/wrtsh4.cxx 
b/sw/source/uibase/wrtsh/wrtsh4.cxx
index 5d16fd869a69..38d623f9190c 100644
--- a/sw/source/uibase/wrtsh/wrtsh4.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh4.cxx
@@ -71,7 +71,7 @@ bool SwWrtShell::NxtWrd_()
     {
         if(!SwCursorShell::Right(1,CRSR_SKIP_CHARS))  // Document - end ??
         {
-            Pop( false );
+            Pop(PopMode::DeleteCurrent);
             return bRet;
         }
         bRet = IsStartWord();
@@ -102,7 +102,7 @@ bool SwWrtShell::PrvWrd_()
     {                            // if already at the beginning, then the 
next???
         if(!SwCursorShell::Left(1,CRSR_SKIP_CHARS))
         {                        // Document - beginning ??
-            Pop( false );
+            Pop(PopMode::DeleteCurrent);
             return bRet;
         }
         bRet = IsStartWord() || IsEndPara();
@@ -134,7 +134,7 @@ bool SwWrtShell::NxtWrdForDelete()
     {
         if ( !SwCursorShell::Right(1,CRSR_SKIP_CHARS) )
         {
-            Pop( false );
+            Pop(PopMode::DeleteCurrent);
             return false;
         }
         return true;
@@ -157,7 +157,7 @@ bool SwWrtShell::PrvWrdForDelete()
     {
         if ( !SwCursorShell::Left(1,CRSR_SKIP_CHARS) )
         {
-            Pop( false );
+            Pop(PopMode::DeleteCurrent);
             return false;
         }
         return true;
@@ -179,7 +179,7 @@ bool SwWrtShell::FwdSentence_()
     ClearMark();
     if(!SwCursorShell::Right(1,CRSR_SKIP_CHARS))
     {
-        Pop(false);
+        Pop(PopMode::DeleteCurrent);
         return false;
     }
     if( !GoNextSentence() && !IsEndPara() )
@@ -196,7 +196,7 @@ bool SwWrtShell::BwdSentence_()
     ClearMark();
     if(!SwCursorShell::Left(1,CRSR_SKIP_CHARS))
     {
-        Pop(false);
+        Pop(PopMode::DeleteCurrent);
         return false;
     }
     if( !GoStartSentence()  && !IsSttPara() )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to