summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-01-25 21:49:31 +0100
committerAndras Timar <andras.timar@collabora.com>2016-06-12 21:00:39 +0200
commiteeec4fd4cef2927ab75909e040e137941634b565 (patch)
tree60cfe79db1afbc9a4e5a132d707e559a3725b5f4 /sd/qa
parente150ed84be3dc676484631ff05d926fa19c78698 (diff)
sd lok: Fix normal 'search' performed after a 'search all'.
The DBG_ASSERT followed by the same test actually returning immediately prevents the actual 'search' after a 'search all' being performed. I hope this does not have any negative consequences; but if it does, we should fix the root cause, instead of having this kind of defensive programming here. (cherry picked from commit 1a83c2259498b070c8d38beb44017f319cbdbee4) Change-Id: I909533f301dda9c20cab1968de45e5fa7975e852
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 01c9bc5d8136..a2fa0e708e1c 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -60,6 +60,7 @@ public:
void testResizeTable();
void testResizeTableColumn();
void testSearchAllNotifications();
+ void testSearchAllFollowedBySearch();
#endif
CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
@@ -77,6 +78,7 @@ public:
CPPUNIT_TEST(testResizeTable);
CPPUNIT_TEST(testResizeTableColumn);
CPPUNIT_TEST(testSearchAllNotifications);
+ CPPUNIT_TEST(testSearchAllFollowedBySearch);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -613,6 +615,21 @@ void SdTiledRenderingTest::testSearchAllNotifications()
comphelper::LibreOfficeKit::setActive(false);
}
+void SdTiledRenderingTest::testSearchAllFollowedBySearch()
+{
+ comphelper::LibreOfficeKit::setActive();
+ SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
+ pXImpressDocument->registerCallback(&SdTiledRenderingTest::callback, this);
+
+ lcl_search("third", /*bFindAll=*/true);
+ lcl_search("match", /*bFindAll=*/false);
+
+ OString aUsedFormat;
+ // This used to give wrong result: 'search' after 'search all' still
+ // returned 'third'
+ CPPUNIT_ASSERT_EQUAL(OString("match"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
+}
+
#endif
CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);