Kaydet (Commit) ffac19f7 authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Jan Holesovsky

CppunitTest_sw_tiledrendering: add TextFrame search testcase

Fails without commit 2d17cd6b (sw:
LOK_CALLBACK_TEXT_SELECTION should be the union of all selections,
2015-06-02).

Change-Id: I1d45eabf53dadd24051ff46acbf4bbfb85fb60a9
(cherry picked from commit 3f3ea9fa)
üst 53f40741
......@@ -34,6 +34,7 @@ public:
void testResetSelection();
void testSearch();
void testSearchViewArea();
void testSearchTextFrame();
void testDocumentSizeChanged();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
......@@ -45,6 +46,7 @@ public:
CPPUNIT_TEST(testResetSelection);
CPPUNIT_TEST(testSearch);
CPPUNIT_TEST(testSearchViewArea);
CPPUNIT_TEST(testSearchTextFrame);
CPPUNIT_TEST(testDocumentSizeChanged);
CPPUNIT_TEST_SUITE_END();
......@@ -54,6 +56,7 @@ private:
void callbackImpl(int nType, const char* pPayload);
Rectangle m_aInvalidation;
Size m_aDocumentSize;
OString m_aTextSelection;
};
SwXTextDocument* SwTiledRenderingTest::createDoc(const char* pName)
......@@ -98,6 +101,11 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
m_aDocumentSize.setHeight(aSeq[1].toInt32());
}
break;
case LOK_CALLBACK_TEXT_SELECTION:
{
m_aTextSelection = pPayload;
}
break;
}
}
......@@ -318,6 +326,22 @@ void SwTiledRenderingTest::testSearchViewArea()
#endif
}
void SwTiledRenderingTest::testSearchTextFrame()
{
#if !defined(WNT) && !defined(MACOSX)
SwXTextDocument* pXTextDocument = createDoc("search.odt");
pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
{
{"SearchItem.SearchString", uno::makeAny(OUString("TextFrame"))},
{"SearchItem.Backward", uno::makeAny(false)},
}));
comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
// This was empty: nothing was highlighted after searching for 'TextFrame'.
CPPUNIT_ASSERT(!m_aTextSelection.isEmpty());
#endif
}
void SwTiledRenderingTest::testDocumentSizeChanged()
{
#if !defined(WNT) && !defined(MACOSX)
......
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