[Libreoffice-commits] core.git: sw/source

Jim Raykowski raykowj at gmail.com
Mon May 21 13:48:31 UTC 2018


 sw/source/core/crsr/trvlfnfl.cxx |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

New commits:
commit b3b169ddd99be71afe0da19afefcb9a6173a2e79
Author: Jim Raykowski <raykowj at gmail.com>
Date:   Fri May 18 13:02:29 2018 -0800

    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 at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

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 )
     {


More information about the Libreoffice-commits mailing list