diff options
author | László Németh <nemeth@numbertext.org> | 2022-04-04 18:46:17 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-04-06 14:00:16 +0200 |
commit | d835afa4b7f0b5398c3ec4e0ad20bb4d3bba018f (patch) | |
tree | cda54fb3c3bc9fd59f42abb62d5f432059f406e5 /sw/qa/extras/uiwriter | |
parent | a020766b90d84723f3d8d1c85af19ae19359155d (diff) |
tdf#148345 sw: reject all tracked row deletion in Hide Changes
In Hide Changes mode, undeleted rows didn't reappear at applying
Reject All for tracked row deletions.
See also commit a74c51025fa4519caaf461492e4ed8e68bd34885
"tdf#146962 sw: hide deleted row at deletion in Hide Changes".
Change-Id: I55d76fb0165fefc330934c5a2a6b018904d3a1a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132527
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit d4e2ed9324bd736275f07577ba81c974a0a70eb1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132391
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 559d47641a99..13d62a49ef58 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -2050,6 +2050,59 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147347) assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148345) +{ + // load a 2-row table, set Hide Changes mode and delete the first row with change tracking + SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116789.fodt"); + CPPUNIT_ASSERT(pDoc); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + CPPUNIT_ASSERT(pWrtShell); + + // enable redlining + dispatchCommand(mxComponent, ".uno:TrackChanges", {}); + CPPUNIT_ASSERT_MESSAGE("redlining should be on", + pDoc->getIDocumentRedlineAccess().IsRedlineOn()); + // hide changes + dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); + CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines()); + + dispatchCommand(mxComponent, ".uno:DeleteRows", {}); + + // Without the fix in place, the deleted row would be visible + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // This was 2 + assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1); + + // check it in Show Changes mode + + dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); + CPPUNIT_ASSERT(!pWrtShell->GetLayout()->IsHideRedlines()); + + discardDumpedLayout(); + pXmlDoc = parseLayoutDump(); + // 2 rows are visible now + assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2); + + // check it in Hide Changes mode again + + dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); + CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines()); + + discardDumpedLayout(); + pXmlDoc = parseLayoutDump(); + // only a single row is visible again + assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1); + + // tdf#148227 check Reject All of tracked table row deletion + + dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {}); + discardDumpedLayout(); + pXmlDoc = parseLayoutDump(); + // This was 1 + assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135014) { createSwDoc(); |