Kaydet (Commit) 66f33819 authored tarafından Miklos Vajna's avatar Miklos Vajna

sd tiled rendering: implement CALLBACK_SET_PART for find-all

Change-Id: I607b3719e0f508f9ae24db7482323847aa8e2491
(cherry picked from commit 6a35a75a)
üst d1a3aae4
......@@ -421,12 +421,19 @@ void SdTiledRenderingTest::testSearch()
void SdTiledRenderingTest::testSearchAll()
{
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
pXImpressDocument->registerCallback(&SdTiledRenderingTest::callback, this);
lcl_search("match", /*bFindAll=*/true);
OString aUsedFormat;
// This was empty: find-all did not highlight the first match.
CPPUNIT_ASSERT_EQUAL(OString("match"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
// We're on the first slide, search for something on the second slide and make sure we get a SET_PART.
m_nPart = 0;
lcl_search("second", /*bFindAll=*/true);
// This was 0: no SET_PART was emitted.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), m_nPart);
}
#endif
......
......@@ -673,6 +673,14 @@ bool Outliner::SearchAndReplaceAll()
}
RestoreStartPosition ();
if (mpSearchItem->GetCommand() == SvxSearchCmd::FIND_ALL && pViewShell->GetDoc()->isTiledRendering() && !bRet)
{
// Find-all, tiled rendering and we have at least one match.
OString aPayload = OString::number(mnStartPageIndex);
pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
}
mnStartPageIndex = (sal_uInt16)-1;
return bRet;
......
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