summaryrefslogtreecommitdiff
path: root/sw/qa/extras/tiledrendering
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-05 15:34:28 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-05 15:53:17 +0200
commitb4e75e8f52c17d02a65022303fb6a0e4f1d97592 (patch)
treede7d9672ad698454ad9164d2db75c5c1ba807356 /sw/qa/extras/tiledrendering
parentdce533e06d641d15c3171cd543875cb9fe835cd2 (diff)
CppunitTest_sw_tiledrendering: testcase for LOK_CALLBACK_SEARCH_RESULT_COUNT
Change-Id: I9f517bc2f3dfca9a2dc17a229f54c47b7790a355
Diffstat (limited to 'sw/qa/extras/tiledrendering')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx32
1 files changed, 31 insertions, 1 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index e7ab14942f79..c836f4bc5eab 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -18,6 +18,7 @@
#include <vcl/svapp.hxx>
#include <editeng/editview.hxx>
#include <editeng/outliner.hxx>
+#include <svl/srchitem.hxx>
#include <crsskip.hxx>
#include <drawdoc.hxx>
#include <ndtxt.hxx>
@@ -42,6 +43,7 @@ public:
void testSearchTextFrame();
void testSearchTextFrameWrapAround();
void testDocumentSizeChanged();
+ void testSearchAll();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -56,6 +58,7 @@ public:
CPPUNIT_TEST(testSearchTextFrame);
CPPUNIT_TEST(testSearchTextFrameWrapAround);
CPPUNIT_TEST(testDocumentSizeChanged);
+ CPPUNIT_TEST(testSearchAll);
CPPUNIT_TEST_SUITE_END();
private:
@@ -66,10 +69,12 @@ private:
Size m_aDocumentSize;
OString m_aTextSelection;
bool m_bFound;
+ sal_Int32 m_nSearchResultCount;
};
SwTiledRenderingTest::SwTiledRenderingTest()
- : m_bFound(true)
+ : m_bFound(true),
+ m_nSearchResultCount(0)
{
}
@@ -125,6 +130,11 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
m_bFound = false;
}
break;
+ case LOK_CALLBACK_SEARCH_RESULT_COUNT:
+ {
+ m_nSearchResultCount = OString(pPayload).toInt32();
+ }
+ break;
}
}
@@ -438,6 +448,26 @@ void SwTiledRenderingTest::testDocumentSizeChanged()
#endif
}
+void SwTiledRenderingTest::testSearchAll()
+{
+#if !defined(WNT) && !defined(MACOSX)
+ comphelper::LibreOfficeKit::setActive();
+
+ SwXTextDocument* pXTextDocument = createDoc("search.odt");
+ pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
+ uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
+ {
+ {"SearchItem.SearchString", uno::makeAny(OUString("shape"))},
+ {"SearchItem.Backward", uno::makeAny(false)},
+ {"SearchItem.Command", uno::makeAny(static_cast<sal_uInt16>(SvxSearchCmd::FIND_ALL))},
+ }));
+ comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+ // This was 0; should be 2 results in the body text.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), m_nSearchResultCount);
+
+ comphelper::LibreOfficeKit::setActive(false);
+#endif
+}
CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
CPPUNIT_PLUGIN_IMPLEMENT();