Kaydet (Commit) 158614a2 authored tarafından Mihai Varga's avatar Mihai Varga Kaydeden (comit) Miklos Vajna

LOKit callback for search not found

Needed for signaling the user when no match was found for
the searched input

Change-Id: I171ee956d94d6fd83036ae34102c2f1bdd5661de
Reviewed-on: https://gerrit.libreoffice.org/15798Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst d6c80f23
......@@ -138,7 +138,12 @@ typedef enum
*
* Not necessarily ever emitted.
*/
LOK_CALLBACK_STATUS_INDICATOR_FINISH
LOK_CALLBACK_STATUS_INDICATOR_FINISH,
/**
* No match was found for the search input
*/
LOK_CALLBACK_SEARCH_NOT_FOUND
}
LibreOfficeKitCallbackType;
......
......@@ -914,6 +914,8 @@ const char* LOKDocView_Impl::callbackTypeToString(int nType)
return "LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE";
case LOK_CALLBACK_STATUS_INDICATOR_FINISH:
return "LOK_CALLBACK_STATUS_INDICATOR_FINISH";
case LOK_CALLBACK_SEARCH_NOT_FOUND:
return "LOK_CALLBACK_SEARCH_NOT_FOUND";
}
return 0;
}
......@@ -1006,6 +1008,8 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
commandChanged(pCallback->m_aPayload);
}
break;
case LOK_CALLBACK_SEARCH_NOT_FOUND:
break;
default:
g_assert(false);
break;
......
......@@ -57,6 +57,7 @@
#include <docsh.hxx>
#include <doc.hxx>
#include <unocrsr.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <view.hrc>
#include <SwRewriter.hxx>
......@@ -213,7 +214,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
{
#if HAVE_FEATURE_DESKTOP
if( !bApi )
{
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND,
m_pSrchItem->GetSearchString().toUtf8().getStr());
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
}
#endif
m_bFound = false;
}
......@@ -335,7 +340,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
{
#if HAVE_FEATURE_DESKTOP
if( !bApi )
{
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND,
m_pSrchItem->GetSearchString().toUtf8().getStr());
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
}
#endif
m_bFound = false;
return;
......@@ -511,6 +520,8 @@ bool SwView::SearchAndWrap(bool bApi)
if( !bApi )
{
#if HAVE_FEATURE_DESKTOP
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND,
m_pSrchItem->GetSearchString().toUtf8().getStr());
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
#endif
}
......@@ -551,7 +562,11 @@ bool SwView::SearchAndWrap(bool bApi)
SvxSearchDialogWrapper::SetSearchLabel(SL_Start);
}
else if(!bApi)
{
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND,
m_pSrchItem->GetSearchString().toUtf8().getStr());
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
}
#endif
return m_bFound;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment