diff options
-rw-r--r-- | sw/source/uibase/uiview/viewsrch.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 643b5b58f230..66fb79ac3809 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -34,6 +34,7 @@ #include <svl/srchitem.hxx> #include <sfx2/bindings.hxx> #include <sfx2/request.hxx> +#include <sfx2/lokhelper.hxx> #include <svx/srchdlg.hxx> #include <swmodule.hxx> #include <swwait.hxx> @@ -93,6 +94,7 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem const * pSearchItem, SwW return; std::vector<OString> aMatches; + OString textSelection; for (SwPaM& rPaM : pPaM->GetRingContainer()) { if (SwShellCursor* pShellCursor = dynamic_cast<SwShellCursor*>(&rPaM)) @@ -108,6 +110,7 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem const * pSearchItem, SwW } OString sRect = comphelper::string::join("; ", aRect); aMatches.push_back(sRect); + textSelection = sRect; } } boost::property_tree::ptree aTree; @@ -120,6 +123,12 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem const * pSearchItem, SwW OString aPayload = aStream.str().c_str(); pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr()); + + if(bHighlightAll) + { // FindAll disables this during find, do it once when done. + pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, textSelection.getStr()); + SfxLokHelper::notifyOtherViews(pWrtShell->GetSfxViewShell(), LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", textSelection); + } } void SwView::ExecSearch(SfxRequest& rReq) |