[Libreoffice-commits] core.git: include/LibreOfficeKit sc/source sd/source sw/source
Jan Holesovsky
kendy at collabora.com
Sat Feb 6 11:35:47 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 0d65937eefd8fbd8f8d08571266f1dcd5c10c6c4
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 5ce8610..901bf6b 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 8037a54..b264886 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1860,6 +1860,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 c413cf9..0ad60d1 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -655,6 +655,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)
@@ -803,6 +804,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 8918ff1..f3f216f 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -107,7 +107,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->GetCursor())
@@ -133,6 +133,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;
@@ -252,7 +253,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
@@ -290,7 +291,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