From aebf19251cef417b387c7830535542ff11d54cea Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 11 Apr 2019 23:42:25 -0800 Subject: tdf#115600 Display not found message for Navigate by Selection ...if there is no selection found Change-Id: Ie4857e8d1bb98e41565aef47d3a794dcbe9bbd66 Reviewed-on: https://gerrit.libreoffice.org/70645 Tested-by: Jenkins Reviewed-by: Jim Raykowski --- sw/source/core/crsr/crsrsh.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sw/source/core/crsr/crsrsh.cxx') diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index f04c7a06e1f8..22a84c6b4f75 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -1343,8 +1344,14 @@ void SwCursorShell::NotifyCursor(SfxViewShell* pOtherShell) const /// go to the next SSelection bool SwCursorShell::GoNextCursor() { + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty ); + if( !m_pCurrentCursor->IsMultiSelection() ) + { + if( !m_pCurrentCursor->HasMark() ) + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); return false; + } SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed @@ -1362,8 +1369,14 @@ bool SwCursorShell::GoNextCursor() /// go to the previous SSelection bool SwCursorShell::GoPrevCursor() { + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty ); + if( !m_pCurrentCursor->IsMultiSelection() ) + { + if( !m_pCurrentCursor->HasMark() ) + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); return false; + } SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed -- cgit v1.2.3