summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-12-11 14:24:24 +0100
committerLászló Németh <nemeth@numbertext.org>2021-12-13 21:37:50 +0100
commitdaf0526ee637a46eec34cc9d086d5c53a1368d51 (patch)
tree8776d3402c38d2809f31d6c6ead012ce217aa93e /sw/qa/extras/uiwriter
parent22403c7cca1df40915ecc61f273c4c7bbb276048 (diff)
tdf#146208 sw DOCX: fix crash at Redo of tracked table changes
Importing DOCX tables with tracked row deletion and insertion, accepting them, Undo, and accepting them again (or Redo) crashed LibreOffice, related to the missing Undo support of deletions in SwExtraRedlineTable. SwTableRowRedline is not used for DOCX export since commit dbc2bdffbec9b3f7eba485652cdd43634458b5a6 "tdf#145091 DOCX: don't export obsolete table row change data", so it's possible to switch off deletion of row changes in SwExtraRedlineTable to fix crashing, keeping SwTableRowRedline only to fix the round-trip of the original row change Date temporarily. Change-Id: I6ac571656e45c4299a07a63646bb28d6d1fcd081 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126662 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 6a9cf64ea7509aac258f290cc1f204fd1ce1f974) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126748
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r--sw/qa/extras/uiwriter/data/TC-table-del-add.docxbin0 -> 13681 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter4.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/TC-table-del-add.docx b/sw/qa/extras/uiwriter/data/TC-table-del-add.docx
new file mode 100644
index 000000000000..841e63f0d12b
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/TC-table-del-add.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx
index 29bb1dd6c02f..ddeb659f361d 100644
--- a/sw/qa/extras/uiwriter/uiwriter4.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter4.cxx
@@ -198,6 +198,7 @@ public:
void testTdf104440();
void testTdf104425();
void testTdf104814();
+ void testTableRedlineRedoCrash();
void testTdf66405();
void testTdf35021_tabOverMarginDemo();
void testTdf106701_tabOverMarginAutotab();
@@ -319,6 +320,7 @@ public:
CPPUNIT_TEST(testTdf104440);
CPPUNIT_TEST(testTdf104425);
CPPUNIT_TEST(testTdf104814);
+ CPPUNIT_TEST(testTableRedlineRedoCrash);
CPPUNIT_TEST(testTdf66405);
CPPUNIT_TEST(testTdf35021_tabOverMarginDemo);
CPPUNIT_TEST(testTdf106701_tabOverMarginAutotab);
@@ -1496,6 +1498,23 @@ void SwUiWriterTest4::testTdf104814()
pEditShell->AcceptRedline(0);
}
+// crash at redo of accepting table change tracking imported from DOCX
+void SwUiWriterTest4::testTableRedlineRedoCrash()
+{
+ SwDoc* const pDoc(createSwDoc(DATA_DIRECTORY, "TC-table-del-add.docx"));
+ sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
+
+ // accept all redlines, Undo and accept all redlines again
+
+ IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess());
+ rIDRA.AcceptAllRedline(/*bAccept=*/true);
+
+ rUndoManager.Undo();
+
+ // without the fix, it crashes
+ rIDRA.AcceptAllRedline(true);
+}
+
void SwUiWriterTest4::testTdf66405()
{
// Imported formula should have zero margins