summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2020-12-26 17:32:31 -0900
committerJim Raykowski <raykowj@gmail.com>2021-01-17 07:10:41 +0100
commit50678a771daa6cd5d3414c25930761c65aab4244 (patch)
treeece73ba419f5be8346124abdd55af383d8df69da /sw
parent07d9819378192231322bb19a61f2cbd469f4611a (diff)
tdf#115817 add places that add current position to navigation manager
Change-Id: If011b51fac6587b4f551a498866aa71f62ba0fcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108529 Reviewed-by: V, Stuart Foote <vstuart.foote@utsa.edu> Reviewed-by: Jim Raykowski <raykowj@gmail.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx1
-rw-r--r--sw/source/uibase/shells/txtcrsr.cxx5
-rw-r--r--sw/source/uibase/uiview/viewmdi.cxx2
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx2
-rw-r--r--sw/source/uibase/wrtsh/move.cxx1
-rw-r--r--sw/source/uibase/wrtsh/navmgr.cxx8
6 files changed, 19 insertions, 0 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 2bb328138d6e..143a3259a991 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2831,6 +2831,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
m_rView.GetPostItMgr()->SetActiveSidebarWin(nullptr);
GrabFocus();
+ rSh.addCurrentPosition();
//ignore key modifiers for format paintbrush
{
diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx
index 4ca50d6dab4e..1290c2070679 100644
--- a/sw/source/uibase/shells/txtcrsr.cxx
+++ b/sw/source/uibase/shells/txtcrsr.cxx
@@ -117,6 +117,7 @@ void SwTextShell::ExecBasicMove(SfxRequest &rReq)
void SwTextShell::ExecMove(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
+ rSh.addCurrentPosition();
SwEditWin& rTmpEditWin = GetView().GetEditWin();
rTmpEditWin.FlushInBuffer();
@@ -175,6 +176,7 @@ void SwTextShell::ExecMove(SfxRequest &rReq)
void SwTextShell::ExecMovePage(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
+ rSh.addCurrentPosition();
GetView().GetEditWin().FlushInBuffer();
switch( rReq.GetSlot() )
@@ -225,6 +227,7 @@ void SwTextShell::ExecMovePage(SfxRequest &rReq)
void SwTextShell::ExecMoveCol(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
+ rSh.addCurrentPosition();
switch ( rReq.GetSlot() )
{
case FN_START_OF_COLUMN:
@@ -255,6 +258,7 @@ void SwTextShell::ExecMoveCol(SfxRequest &rReq)
void SwTextShell::ExecMoveLingu(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
+ rSh.addCurrentPosition();
GetView().GetEditWin().FlushInBuffer();
switch ( rReq.GetSlot() )
@@ -311,6 +315,7 @@ void SwTextShell::ExecMoveLingu(SfxRequest &rReq)
void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
+ rSh.addCurrentPosition();
const sal_uInt16 nSlot = rReq.GetSlot();
bool bSetRetVal = true, bRet = true;
switch ( nSlot )
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx
index 348a9a0d3621..541a0ba210c3 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -340,6 +340,8 @@ IMPL_LINK( SwView, MoveNavigationHdl, void*, p, void )
if (pActiveSidebarWin)
pActiveSidebarWin->SwitchToFieldPos();
}
+ if (NID_RECENCY != m_nMoveType && NID_PGE != m_nMoveType && NID_SRCH_REP != m_nMoveType)
+ rSh.addCurrentPosition();
switch( m_nMoveType )
{
case NID_PGE:
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 66d8dfd60a3f..3b4b4375a966 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -124,6 +124,8 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem const * pSearchItem, SwW
void SwView::ExecSearch(SfxRequest& rReq)
{
+ GetWrtShell().addCurrentPosition();
+
const SfxItemSet* pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = nullptr;
bool bQuiet = false;
diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx
index c1873967fcb6..933bdba0f57b 100644
--- a/sw/source/uibase/wrtsh/move.cxx
+++ b/sw/source/uibase/wrtsh/move.cxx
@@ -572,6 +572,7 @@ bool SwWrtShell::PageCursor(SwTwips lOffset, bool bSelect)
bool SwWrtShell::GotoPage(sal_uInt16 nPage, bool bRecord)
{
+ addCurrentPosition();
ShellMoveCursor aTmp( this, false);
if( SwCursorShell::GotoPage(nPage) && bRecord)
{
diff --git a/sw/source/uibase/wrtsh/navmgr.cxx b/sw/source/uibase/wrtsh/navmgr.cxx
index b8c1f32582d1..10130fbe4b4f 100644
--- a/sw/source/uibase/wrtsh/navmgr.cxx
+++ b/sw/source/uibase/wrtsh/navmgr.cxx
@@ -20,9 +20,12 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <edtwin.hxx>
+
// This method positions the cursor to the position rPos.
void SwNavigationMgr::GotoSwPosition(const SwPosition &rPos) {
+ m_rMyShell.GetView().GetEditWin().GrabFocus();
// EnterStdMode() prevents the cursor to 'block' the current
// shell when it should move from the image back to the normal shell
m_rMyShell.EnterStdMode();
@@ -168,6 +171,11 @@ void SwNavigationMgr::goForward() {
// rPos is usually the current position of the cursor in the document
bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
+
+ // For additions other than to the end, check here if the cursor position has changed
+ if (m_nCurrent < m_entries.size() && (rPos == *m_entries[m_nCurrent]->GetPoint()))
+ return false;
+
// Flags that will be used for refreshing the buttons
bool bBackWasDisabled = !backEnabled();
bool bForwardWasEnabled = forwardEnabled();