diff options
author | Jim Raykowski <raykowj@gmail.com> | 2018-05-18 13:02:29 -0800 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-05-21 15:48:10 +0200 |
commit | b3b169ddd99be71afe0da19afefcb9a6173a2e79 (patch) | |
tree | 15c7b6b99370b4bcf97e99167678103d3a451a12 | |
parent | de9620dd4539397715dab3102d256f9d634fcb23 (diff) |
tdf#115600 Display messages in FindBar for Footnote navigation
...and make Footnote navigation wrap
Change-Id: Ie4ab6a5d34ba75119f900f46a983a031b84ab51a
Reviewed-on: https://gerrit.libreoffice.org/54556
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | sw/source/core/crsr/trvlfnfl.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index a46eb7c367b5..8c2104ff6a20 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -34,6 +34,7 @@ #include <ftnidx.hxx> #include <viscrs.hxx> #include "callnk.hxx" +#include <svx/srchdlg.hxx> bool SwCursorShell::CallCursorFN( FNCursor fnCursor ) { @@ -180,6 +181,12 @@ bool SwCursor::GotoNextFootnoteAnchor() const SwTextFootnote* pTextFootnote = nullptr; size_t nPos = 0; + if( !rFootnoteArr.size() ) + { + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); + return false; + } + if( rFootnoteArr.SeekEntry( GetPoint()->nNode, &nPos )) { // there is a footnote with this index, so search also for the next one @@ -220,6 +227,14 @@ bool SwCursor::GotoNextFootnoteAnchor() else if( nPos < rFootnoteArr.size() ) pTextFootnote = rFootnoteArr[ nPos ]; + if (pTextFootnote == nullptr) + { + pTextFootnote = rFootnoteArr[ 0 ]; + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::EndWrapped ); + } + else + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty ); + bool bRet = nullptr != pTextFootnote; if( bRet ) { @@ -239,6 +254,12 @@ bool SwCursor::GotoPrevFootnoteAnchor() const SwTextFootnote* pTextFootnote = nullptr; size_t nPos = 0; + if( !rFootnoteArr.size() ) + { + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound ); + return false; + } + if( rFootnoteArr.SeekEntry( GetPoint()->nNode, &nPos ) ) { // there is a footnote with this index, so search also for the next one @@ -277,6 +298,14 @@ bool SwCursor::GotoPrevFootnoteAnchor() else if( nPos ) pTextFootnote = rFootnoteArr[ nPos-1 ]; + if( pTextFootnote == nullptr ) + { + pTextFootnote = rFootnoteArr[ rFootnoteArr.size() - 1 ]; + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::StartWrapped ); + } + else + SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty ); + bool bRet = nullptr != pTextFootnote; if( bRet ) { |