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

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