diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-09 08:08:48 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-09 08:09:16 +0200 |
commit | f0e3fe840b6f103c589f044bbde18b2faa345279 (patch) | |
tree | d8049ca5c6695ab1d20b1d21b4985bae1a749780 /sw/source/uibase | |
parent | 854af5a574a9d0d3e8e56f83c4853cfad872f456 (diff) |
LOK: CALLBACK_SEARCH_RESULT_COUNT is redundant
1) The size of the searchResultSelection array in
LOK_CALLBACK_SEARCH_RESULT_SELECTION provides the same information.
2) None of the clients except lokdocview used it.
3) Only sw provided this callback, not sc/sd.
Change-Id: I9da639b6693f24634f298f9bc4773f705e944359
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/uiview/viewsrch.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 9667fdc6aab2..e2b73f2c8cd3 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -104,11 +104,8 @@ static void lcl_addContainerToJson(boost::property_tree::ptree& rTree, const OSt } /// Emits LOK callbacks (count, selection) for search results. -static void lcl_emitSearchResultCallbacks(sal_uInt16 nFound, SvxSearchItem* pSearchItem, SwWrtShell* pWrtShell) +static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, SwWrtShell* pWrtShell) { - OString aPayload = OString::number(nFound) + ";" + pSearchItem->GetSearchString().toUtf8(); - pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_COUNT, aPayload.getStr()); - // Emit a callback also about the selection rectangles, grouped by matches. if (SwPaM* pPaM = pWrtShell->GetCrsr()) { @@ -137,7 +134,7 @@ static void lcl_emitSearchResultCallbacks(sal_uInt16 nFound, SvxSearchItem* pSea std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); - aPayload = aStream.str().c_str(); + OString aPayload = aStream.str().c_str(); pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr()); } @@ -252,7 +249,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) { Scroll(m_pWrtShell->GetCharRect().SVRect()); if (comphelper::LibreOfficeKit::isActive()) - lcl_emitSearchResultCallbacks(1, m_pSrchItem, m_pWrtShell); + lcl_emitSearchResultCallbacks(m_pSrchItem, m_pWrtShell); } rReq.SetReturnValue(SfxBoolItem(nSlot, bRet)); #if HAVE_FEATURE_DESKTOP @@ -271,8 +268,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) break; case SvxSearchCmd::FIND_ALL: { - sal_uInt16 nFound = 0; - bool bRet = SearchAll(&nFound); + bool bRet = SearchAll(); if( !bRet ) { #if HAVE_FEATURE_DESKTOP @@ -286,7 +282,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) m_bFound = false; } else if (comphelper::LibreOfficeKit::isActive()) - lcl_emitSearchResultCallbacks(nFound, m_pSrchItem, m_pWrtShell); + lcl_emitSearchResultCallbacks(m_pSrchItem, m_pWrtShell); rReq.SetReturnValue(SfxBoolItem(nSlot, bRet)); #if HAVE_FEATURE_DESKTOP { |