summaryrefslogtreecommitdiff
path: root/sw/source/uibase/wrtsh/navmgr.cxx
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/source/uibase/wrtsh/navmgr.cxx
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/source/uibase/wrtsh/navmgr.cxx')
-rw-r--r--sw/source/uibase/wrtsh/navmgr.cxx8
1 files changed, 8 insertions, 0 deletions
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();