summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-02-05 16:54:31 +0100
committerJan Holesovsky <kendy@collabora.com>2016-02-05 16:55:18 +0100
commite54f49d65888e180118992c33f7348d6e08b3e20 (patch)
treeb0b3a0979df696ed7e1234df9ad80429194ab6a9
parent62045eea2cbab575c92082cf0c724be7849a2db3 (diff)
lok: Search result should contain info if it is a 'search all' result.cp-5.0-22
Change-Id: Ia3ee81ced4f74c0d029a478bd59eff44d72ef327
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h1
-rw-r--r--sc/source/ui/view/viewfun2.cxx1
-rw-r--r--sd/source/ui/view/Outliner.cxx2
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx7
4 files changed, 8 insertions, 3 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 3f2a6ea470a8..343d169b7b07 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 b0f73bc5928e..86f3c89b43c8 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 ed3f4790da21..b4b0d246c4b8 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 f3f30ce7af7f..6fc549bc0871 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
{