[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - include/LibreOfficeKit sc/source sd/source sw/source

Jan Holesovsky kendy at collabora.com
Fri Feb 5 15:55:45 UTC 2016


 include/LibreOfficeKit/LibreOfficeKitEnums.h |    1 +
 sc/source/ui/view/viewfun2.cxx               |    1 +
 sd/source/ui/view/Outliner.cxx               |    2 ++
 sw/source/uibase/uiview/viewsrch.cxx         |    7 ++++---
 4 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit e54f49d65888e180118992c33f7348d6e08b3e20
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Feb 5 16:54:31 2016 +0100

    lok: Search result should contain info if it is a 'search all' result.
    
    Change-Id: Ia3ee81ced4f74c0d029a478bd59eff44d72ef327

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 3f2a6ea..343d169 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -197,6 +197,7 @@ typedef enum
      *
      * {
      *     "searchString": "...",
+     *     "highlightAll": true|false, // this is a result of 'search all'
      *     "searchResultSelection": [
      *         {
      *             "part": "...",
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index b0f73bc..86f3c89 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1870,6 +1870,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
 
                 boost::property_tree::ptree aTree;
                 aTree.put("searchString", pSearchItem->GetSearchString().toUtf8().getStr());
+                aTree.put("highlightAll", nCommand == SvxSearchCmd::FIND_ALL);
 
                 boost::property_tree::ptree aSelections;
                 for (const Rectangle& rLogicRect : aLogicRects)
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index ed3f479..b4b0d24 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -669,6 +669,7 @@ bool Outliner::SearchAndReplaceAll()
         {
             boost::property_tree::ptree aTree;
             aTree.put("searchString", mpSearchItem->GetSearchString().toUtf8().getStr());
+            aTree.put("highlightAll", true);
 
             boost::property_tree::ptree aChildren;
             for (const SearchSelection& rSelection : aSelections)
@@ -817,6 +818,7 @@ bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections)
             // also about search result selections
             boost::property_tree::ptree aTree;
             aTree.put("searchString", mpSearchItem->GetSearchString().toUtf8().getStr());
+            aTree.put("highlightAll", false);
 
             boost::property_tree::ptree aChildren;
             boost::property_tree::ptree aChild;
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index f3f30ce..6fc549b 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -113,7 +113,7 @@ static void lcl_addContainerToJson(boost::property_tree::ptree& rTree, const OSt
 }
 
 /// Emits LOK callbacks (count, selection) for search results.
-static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, SwWrtShell* pWrtShell)
+static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, SwWrtShell* pWrtShell, bool bHighlightAll)
 {
     // Emit a callback also about the selection rectangles, grouped by matches.
     if (SwPaM* pPaM = pWrtShell->GetCrsr())
@@ -139,6 +139,7 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, SwWrtShell
         }
         boost::property_tree::ptree aTree;
         aTree.put("searchString", pSearchItem->GetSearchString().toUtf8().getStr());
+        aTree.put("highlightAll", bHighlightAll);
         lcl_addContainerToJson(aTree, "searchResultSelection", aMatches);
 
         std::stringstream aStream;
@@ -258,7 +259,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
                 {
                     Scroll(m_pWrtShell->GetCharRect().SVRect());
                     if (comphelper::LibreOfficeKit::isActive())
-                        lcl_emitSearchResultCallbacks(m_pSrchItem, m_pWrtShell);
+                        lcl_emitSearchResultCallbacks(m_pSrchItem, m_pWrtShell, /* bHighlightAll = */ false);
                 }
                 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
 #if HAVE_FEATURE_DESKTOP
@@ -298,7 +299,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
                     m_bFound = false;
                 }
                 else if (comphelper::LibreOfficeKit::isActive())
-                    lcl_emitSearchResultCallbacks(m_pSrchItem, m_pWrtShell);
+                    lcl_emitSearchResultCallbacks(m_pSrchItem, m_pWrtShell, /* bHighlightAll = */ true);
                 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
 #if HAVE_FEATURE_DESKTOP
                 {


More information about the Libreoffice-commits mailing list