diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-10 14:02:52 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-10 12:45:00 +0000 |
commit | 52696e31e740d4076092f89531e58d11538f478f (patch) | |
tree | 575285ca565901320c2a1a80e4e548ec68654b7d /sw | |
parent | 8f04f1a1093f0cab56b9cd3872f7667011f9fcf4 (diff) |
sw: implement per-view LOK_CALLBACK_SEARCH_RESULT_SELECTION
This way searching in one view does not affect the search state of an
other view.
Change-Id: I6d873b1609a8f6cb3cfe07e1f2fa92024c3545d9
Reviewed-on: https://gerrit.libreoffice.org/26161
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uiview/viewsrch.cxx | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index a15c1ade2871..2e069c65fcc1 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -134,7 +134,10 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, SwWrtShell boost::property_tree::write_json(aStream, aTree); OString aPayload = aStream.str().c_str(); - pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr()); + if (comphelper::LibreOfficeKit::isViewCallback()) + pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr()); + else + pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr()); } } @@ -275,8 +278,10 @@ void SwView::ExecSearch(SfxRequest& rReq) #if HAVE_FEATURE_DESKTOP if( !bQuiet ) { - m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, - m_pSrchItem->GetSearchString().toUtf8().getStr()); + if (comphelper::LibreOfficeKit::isViewCallback()) + m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr()); + else + m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr()); SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); } #endif @@ -397,8 +402,10 @@ void SwView::ExecSearch(SfxRequest& rReq) #if HAVE_FEATURE_DESKTOP if( !bQuiet ) { - m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, - m_pSrchItem->GetSearchString().toUtf8().getStr()); + if (comphelper::LibreOfficeKit::isViewCallback()) + m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr()); + else + m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr()); SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); } #endif @@ -594,8 +601,10 @@ bool SwView::SearchAndWrap(bool bApi) if( !bApi ) { #if HAVE_FEATURE_DESKTOP - m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, - m_pSrchItem->GetSearchString().toUtf8().getStr()); + if (comphelper::LibreOfficeKit::isViewCallback()) + m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr()); + else + m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr()); SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); #endif } @@ -648,8 +657,10 @@ bool SwView::SearchAndWrap(bool bApi) } else if(!bApi) { - m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, - m_pSrchItem->GetSearchString().toUtf8().getStr()); + if (comphelper::LibreOfficeKit::isViewCallback()) + m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr()); + else + m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr()); SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound); } #endif |