diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-09-11 17:50:44 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-09-12 11:18:14 +0000 |
commit | 4ea419f9423ec43c98521fb824f7f9a24d9ef4a5 (patch) | |
tree | 547352f34987925ad9d0a68c08b87bfcf8e77c3b /sw/qa/extras/uiwriter/uiwriter.cxx | |
parent | a07333a3f88ab39db554751146687fa6351d2ea0 (diff) |
Revert "Fix single node CopyRange"
This reverts commit 9099e21b89184bd4e39def497e483cac4a77ec5a.
It causes the problem that frames anchored to the same node where
redlines start or end get duplicated during Hide.
Jan-Marek said that the original mail-merge related problem this change
was fixing is now most likely fixed differently, and the test in
testMultiPageAnchoredDraws() still passes.
(equivalent master commit e84f0a9b3223f49b0829f2f55dacbf11ae201c1e)
sw: add unit test for the redline frame duplication regression
(cherry picked from commit d5ffcba07acb4dd5bd68373d40f07af825f07fba)
Change-Id: I4c2b425b0dc8d2706cc74ad93a485a501d44c072
Reviewed-on: https://gerrit.libreoffice.org/18510
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index e78dc8876e40..05088660c95a 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -42,6 +42,7 @@ public: //Regression test of fdo#70143 //EDITING: undo search&replace corrupt text when searching backward void testReplaceBackward(); + void testRedlineFrame(); void testFdo69893(); void testFdo70807(); void testImportRTF(); @@ -69,6 +70,7 @@ public: CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); CPPUNIT_TEST(testReplaceBackward); + CPPUNIT_TEST(testRedlineFrame); CPPUNIT_TEST(testFdo69893); CPPUNIT_TEST(testFdo70807); CPPUNIT_TEST(testImportRTF); @@ -144,6 +146,31 @@ void SwUiWriterTest::testReplaceForward() CPPUNIT_ASSERT_EQUAL(ORIGINAL_REPLACE_CONTENT, pTxtNode->GetTxt()); } +void SwUiWriterTest::testRedlineFrame() +{ + SwDoc * pDoc(createDoc("redlineFrame.fodt")); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); + // there is exactly one frame + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); + + sal_uInt16 nMode = pWrtShell->GetRedlineMode(); + CPPUNIT_ASSERT(nMode & nsRedlineMode_t::REDLINE_SHOW_DELETE); + + // hide delete redlines + pWrtShell->SetRedlineMode(nMode & ~nsRedlineMode_t::REDLINE_SHOW_DELETE); + + // there is still exactly one frame + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); + + pWrtShell->SetRedlineMode(nMode); // show again + + // there is still exactly one frame + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); +} + void SwUiWriterTest::testFdo75110() { SwDoc* pDoc = createDoc("fdo75110.odt"); |