Blame SOURCES/0172-LOK-add-CALLBACK_SEARCH_RESULT_COUNT-and-implement-i.patch

135360
From 72ed4d0614165dc6e70a266f54119e1d62d8ebef Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Mon, 5 Oct 2015 11:29:28 +0200
135360
Subject: [PATCH 172/398] LOK: add CALLBACK_SEARCH_RESULT_COUNT and implement
135360
 in sw
135360
135360
Change-Id: I616b3f6d2881aaa479f6498d3121540980256c15
135360
(cherry picked from commit 6c040ad18bd7b5a2d1d11130f4dbfd1c9d90055d)
135360
---
135360
 include/LibreOfficeKit/LibreOfficeKitEnums.h | 4 +++-
135360
 sw/source/uibase/uiview/viewsrch.cxx         | 8 +++++++-
135360
 2 files changed, 10 insertions(+), 2 deletions(-)
135360
135360
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
135360
index 7038e5fc8cc2..dc3e0f94f3dc 100644
135360
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
135360
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
135360
@@ -155,7 +155,9 @@ typedef enum
135360
      *
135360
      * Payload is a single 0-based integer.
135360
      */
135360
-    LOK_CALLBACK_SET_PART
135360
+    LOK_CALLBACK_SET_PART,
135360
+    /// Number of search results, in case something is found.
135360
+    LOK_CALLBACK_SEARCH_RESULT_COUNT
135360
 }
135360
 LibreOfficeKitCallbackType;
135360
 
135360
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
135360
index 28fc2c920ac3..11764126e165 100644
135360
--- a/sw/source/uibase/uiview/viewsrch.cxx
135360
+++ b/sw/source/uibase/uiview/viewsrch.cxx
135360
@@ -209,7 +209,8 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
135360
             break;
135360
             case SvxSearchCmd::FIND_ALL:
135360
             {
135360
-                bool bRet = SearchAll();
135360
+                sal_uInt16 nFound = 0;
135360
+                bool bRet = SearchAll(&nFound);
135360
                 if( !bRet )
135360
                 {
135360
 #if HAVE_FEATURE_DESKTOP
135360
@@ -222,6 +223,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
135360
 #endif
135360
                     m_bFound = false;
135360
                 }
135360
+                else
135360
+                {
135360
+                    OString aPayload = OString::number(nFound);
135360
+                    m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_COUNT, aPayload.getStr());
135360
+                }
135360
                 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
135360
 #if HAVE_FEATURE_DESKTOP
135360
                 {
135360
-- 
135360
2.12.0
135360