tdf#60382 sw track changes: add test for Undo of IsNotTracked
TextTableRow property. Remove also maybevoid from
com::sun::star::text::TextTableRow::IsNotTracked.
(It's possible to add it later, if needed.)
Follow-up to commit 05366b8e6683363688de8708a3d88cf144c7a2bf
"itdf#60382 sw offapi: add change tracking of table/row deletion".
Change-Id: I4854dcda827cc8d5b1d0ec8bba381458b3ab17b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115988
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
diff --git a/offapi/com/sun/star/text/TextTableRow.idl b/offapi/com/sun/star/text/TextTableRow.idl
index 77191c9..e418fbb 100644
--- a/offapi/com/sun/star/text/TextTableRow.idl
+++ b/offapi/com/sun/star/text/TextTableRow.idl
@@ -111,7 +111,7 @@ published service TextTableRow
@since LibreOffice 7.2
*/
[optional, property, maybevoid] boolean IsNotTracked;
[optional, property] boolean IsNotTracked;
};
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index d1323c8..3da57c9 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -3690,6 +3690,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineTableRowDeletion)
assertXPath(pXmlDoc, "//page[1]//body/tab");
// delete table row with enabled change tracking
// (IsNotTracked property of the row will be false)
dispatchCommand(mxComponent, ".uno:DeleteRows", {});
// This was deleted without change tracking
@@ -3698,7 +3699,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineTableRowDeletion)
assertXPath(pXmlDoc, "//page[1]//body/tab");
// accept the deletion of the content of the first cell
SwEditShell* const pEditShell(pDoc->GetEditShell());
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(2), pEditShell->GetRedlineCount());
pEditShell->AcceptRedline(0);
@@ -3716,6 +3716,45 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineTableRowDeletion)
pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc, "//page[1]//body/tab", 0);
// Undo, and repeat the previous test, but only with deletion of the text content of the cells
// (IsNotTracked property will be removed by Undo)
dispatchCommand(mxComponent, ".uno:Undo", {});
dispatchCommand(mxComponent, ".uno:Undo", {});
dispatchCommand(mxComponent, ".uno:Undo", {});
// table exists again
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc, "//page[1]//body/tab");
// delete table row with enabled change tracking
dispatchCommand(mxComponent, ".uno:SelectRow", {});
dispatchCommand(mxComponent, ".uno:Delete", {});
// Table row still exists
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc, "//page[1]//body/tab");
// accept the deletion of the content of the first cell
CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(2), pEditShell->GetRedlineCount());
pEditShell->AcceptRedline(0);
// table row was still not deleted
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc, "//page[1]//body/tab");
// accept last redline
pEditShell->AcceptRedline(0);
// table row (and the 1-row table) still exists
// (IsNotTracked property wasn't set for table row deletion)
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc, "//page[1]//body/tab");
// Undo, and delete the row without change tracking
dispatchCommand(mxComponent, ".uno:Undo", {});