sw/inc/crsrsh.hxx | 2 ++ sw/source/core/crsr/crsrsh.cxx | 26 ++++++++++++++------------ sw/source/uibase/uiview/viewmdi.cxx | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-)
New commits: commit f1e36c1581d1198c566872c29a0ff12c94a2a18f Author: Jim Raykowski <rayk...@gmail..com> AuthorDate: Wed Jul 10 15:06:37 2019 -0800 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jul 11 09:26:24 2019 +0200 Rework tdf#115600 Display not found message for Navigate by Selection Fixes not found message being displayed in find bar when a header or footer is deleted and other uses of SwCursorShell::GoNextCursor and SwCursorShell::GoPrevCursor when SwCursorShell::m_pCurrentCursor is not multi selection. Change-Id: Ie71d39e51b05363ad33ba2f912ac36273c38b8b4 Reviewed-on: https://gerrit.libreoffice.org/75386 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index fb105b00e524..23897af085d8 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -546,6 +546,8 @@ public: bool GoPrevCursor(); + bool GoNextPrevCursorSetSearchLabel(const bool bNext); + // at CurrentCursor.SPoint ::sw::mark::IMark* SetBookmark( const vcl::KeyCode&, diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 22a84c6b4f75..33992f06f86f 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1344,14 +1344,8 @@ 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 @@ -1369,14 +1363,8 @@ 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 @@ -1391,6 +1379,20 @@ bool SwCursorShell::GoPrevCursor() return true; } +bool SwCursorShell::GoNextPrevCursorSetSearchLabel(const bool bNext) +{ + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty ); + + if( !m_pCurrentCursor->IsMultiSelection() ) + { + if( !m_pCurrentCursor->HasMark() ) + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); + return false; + } + + return bNext ? GoNextCursor() : GoPrevCursor(); +} + void SwCursorShell::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle &rRect) { comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll()); diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index d6178fcad40c..4fd706e84667 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -439,7 +439,7 @@ IMPL_LINK( SwView, MoveNavigationHdl, void*, p, void ) bNext ? rSh.GotoNextOutline() : rSh.GotoPrevOutline(); break; case NID_SEL : - bNext ? rSh.GoNextCursor() : rSh.GoPrevCursor(); + rSh.GoNextPrevCursorSetSearchLabel(bNext); break; case NID_FTN: { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits