diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-03-07 15:57:09 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-03-22 10:30:03 +0100 |
commit | 38f4824ce05ffa61b219becbef21f0e24c4df2b9 (patch) | |
tree | ac9fb56d3b251be61ac130a4b9149607cf17a289 /sw/qa/extras/uiwriter | |
parent | 02cac18dc419a061a660fab64628816984efb9bd (diff) |
tdf#147310 sw_redlinehide: recreate frames for whole table deleted
SwUndoDelete calls MakeFrames with end being end node of the table, but
it needs to be the following node (with a frame).
(regression from commit 723728cd358693b8f4bc9d913541aa4479f2bd48)
Change-Id: Id0974c8349be5aef9630822738eae9462bbcb4f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131112
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 6f20bcb152948a24dbe40ca2e6c4ecef2bebf853)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131131
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter2.cxx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 4e9080bdc951..d5f6f045da70 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1545,6 +1545,52 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf109376) CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetFlyCount(FLYCNTTYPE_FRM)); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147310) +{ + SwDoc* pDoc = createSwDoc(); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + CPPUNIT_ASSERT(pWrtShell); + + // somehow bug happens only with 2 tables + SwInsertTableOptions tableOpt(SwInsertTableFlags::DefaultBorder, 0); + pWrtShell->InsertTable(tableOpt, 1, 1); + pWrtShell->InsertTable(tableOpt, 1, 1); + + pWrtShell->SttEndDoc(/*bStart=*/true); + + pWrtShell->DeleteRow(false); + pWrtShell->DeleteRow(false); + + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "/root/page/body/tab", 0); + discardDumpedLayout(); + } + pWrtShell->Undo(); + // this did not create frames for the table + pWrtShell->Undo(); + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // there are 2 tables + assertXPath(pXmlDoc, "/root/page/body/tab", 2); + discardDumpedLayout(); + } + pWrtShell->Redo(); + pWrtShell->Redo(); + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "/root/page/body/tab", 0); + discardDumpedLayout(); + } + pWrtShell->Undo(); + pWrtShell->Undo(); + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // there are 2 tables + assertXPath(pXmlDoc, "/root/page/body/tab", 2); + } +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf64242_optimizeTable) { SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf64242_optimizeTable.odt"); |