[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - offapi/com sw/qa
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Thu Aug 19 13:01:02 UTC 2021
offapi/com/sun/star/text/TextTableRow.idl | 2 -
sw/qa/extras/uiwriter/uiwriter2.cxx | 41 +++++++++++++++++++++++++++++-
2 files changed, 41 insertions(+), 2 deletions(-)
New commits:
commit 53de12575492e4e5da983e2780090c8bbb9cfc06
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Sat May 22 13:36:26 2021 +0200
Commit: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Thu Aug 19 15:00:27 2021 +0200
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 at numbertext.org>
(cherry picked from commit c1bf2a3751b6a602f2571f8642b36504b04ca3fd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120650
Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
diff --git a/offapi/com/sun/star/text/TextTableRow.idl b/offapi/com/sun/star/text/TextTableRow.idl
index 77191c9f57d1..e418fbbf9366 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 a171c14c591c..e643df300576 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -3394,6 +3394,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
@@ -3402,7 +3403,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);
@@ -3420,6 +3420,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", {});
More information about the Libreoffice-commits
mailing list