Kaydet (Commit) 58c38e7e authored tarafından Miklos Vajna's avatar Miklos Vajna

sw tiled rendering: emit LOK_CALLBACK_SEARCH_RESULT* for normal search

We used to emit these for find-all only, for no good reason.

Change-Id: Id07dc7649f9a8528b9d4ec16d5f7c651fd607111
üst ca8016c3
......@@ -342,7 +342,10 @@ void lcl_search(bool bBackward)
void SwTiledRenderingTest::testSearch()
{
#if !defined(WNT) && !defined(MACOSX)
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("search.odt");
pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
size_t nNode = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex();
......@@ -351,6 +354,8 @@ void SwTiledRenderingTest::testSearch()
CPPUNIT_ASSERT(!pWrtShell->GetDrawView()->GetTextEditObject());
size_t nActual = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex();
CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual);
/// Make sure we get search result selection for normal find as well, not only find all.
CPPUNIT_ASSERT(!m_aSearchResultSelection.empty());
// Next hit, in the shape.
lcl_search(false);
......@@ -375,6 +380,8 @@ void SwTiledRenderingTest::testSearch()
CPPUNIT_ASSERT(!pWrtShell->GetDrawView()->GetTextEditObject());
nActual = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex();
CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual);
comphelper::LibreOfficeKit::setActive(false);
#endif
}
......
......@@ -253,7 +253,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
{
bool bRet = SearchAndWrap(bApi);
if( bRet )
{
Scroll(m_pWrtShell->GetCharRect().SVRect());
if (comphelper::LibreOfficeKit::isActive())
lcl_emitSearchResultCallbacks(1, m_pSrchItem, m_pWrtShell);
}
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
#if HAVE_FEATURE_DESKTOP
{
......
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