summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-04-04 18:46:17 +0200
committerLászló Németh <nemeth@numbertext.org>2022-04-05 07:48:18 +0200
commitd4e2ed9324bd736275f07577ba81c974a0a70eb1 (patch)
tree5ddb2364bf91b0306da0562cb4e6976ce30a8cd6 /sw/qa
parent684ec4b870ad13b2eff3e10ef429f4e19bb57441 (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>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx53
1 files changed, 53 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 839106e5d41c..654e08ace527 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -2416,6 +2416,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();