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

Joren De Cuyper jorendc at libreoffice.org
Sun May 10 12:49:38 PDT 2015


 include/svx/dialogs.hrc              |    1 +
 include/svx/srchdlg.hxx              |    1 +
 svx/source/dialog/srchdlg.cxx        |    2 ++
 svx/source/dialog/srchdlg.src        |    4 ++++
 sw/source/uibase/uiview/viewsrch.cxx |    7 ++++++-
 5 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 69b35cb45375c324c1e28fd4547ce874e4894f30
Author: Joren De Cuyper <jorendc at libreoffice.org>
Date:   Sat May 2 17:21:24 2015 +0200

    related tdf#88608: find: add string for reaching start of document
    
    If you searched backwards and reached the start of the document,
    the text "Reached the end of the document" was shown.
    
    Change-Id: Ic35884de2f1ada07e76c9c3e27cf6c81c4a83304
    Reviewed-on: https://gerrit.libreoffice.org/15597
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index e6abab7..709bd3b 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -227,6 +227,7 @@
 #define RID_SVXSTR_CALC_STYLES              (RID_SVX_START +  85)
 #define RID_SVXSTR_SEARCH_NOT_FOUND         (RID_SVX_START +  88)
 #define RID_SVXSTR_QUERY_EXIT_RECOVERY      (RID_SVX_START +  89)
+#define RID_SVXSTR_SEARCH_START             (RID_SVX_START +  90)
 // ResIds for the PageDialog
 
 // Strings of the ToolBox-Controls from tbcontrl.cxx
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 0ad7edb..81728a9 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -82,6 +82,7 @@ enum SearchLabel
 {
     SL_Empty,
     SL_End,
+    SL_Start,
     SL_EndSheet,
     SL_NotFound
 };
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 415c140..33dbbb8 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -2319,6 +2319,8 @@ void SvxSearchDialogWrapper::SetSearchLabel(const SearchLabel& rSL)
     OUString sStr;
     if (rSL == SL_End)
         sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_END);
+    else if (rSL == SL_Start)
+        sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_START);
     else if (rSL == SL_EndSheet)
         sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_END_SHEET);
     else if (rSL == SL_NotFound)
diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src
index c0fd4e5..e50d3d7 100644
--- a/svx/source/dialog/srchdlg.src
+++ b/svx/source/dialog/srchdlg.src
@@ -54,5 +54,9 @@ String RID_SVXSTR_SEARCH_NOT_FOUND
 {
     Text [ en-US ] = "Search key not found" ;
 };
+String RID_SVXSTR_SEARCH_START
+{
+    Text [ en-US ] = "Reached the beginning of the document" ;
+};
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index e23c53c..e1deaba 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -544,7 +544,12 @@ bool SwView::SearchAndWrap(bool bApi)
     pWait.reset();
 #if HAVE_FEATURE_DESKTOP
     if (m_bFound)
-        SvxSearchDialogWrapper::SetSearchLabel(SL_End);
+    {
+        if (!bSrchBkwrd)
+            SvxSearchDialogWrapper::SetSearchLabel(SL_End);
+        else
+            SvxSearchDialogWrapper::SetSearchLabel(SL_Start);
+    }
     else if(!bApi)
         SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
 #endif


More information about the Libreoffice-commits mailing list