summaryrefslogtreecommitdiff
path: root/sw/qa/extras
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 19:34:33 +0100
commit6a9cf64ea7509aac258f290cc1f204fd1ce1f974 (patch)
treef1792c4c83ebfaf4193db6ae4335e433f69a9427 /sw/qa/extras
parent6a7daa7ece8442e70351eea071bddbe0d24803de (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>
Diffstat (limited to 'sw/qa/extras')
-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 40db48e65e92..bddc76755920 100644
--- a/sw/qa/extras/uiwriter/uiwriter4.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter4.cxx
@@ -200,6 +200,7 @@ public:
void testTdf104440();
void testTdf104425();
void testTdf104814();
+ void testTableRedlineRedoCrash();
void testTdf66405();
void testTdf35021_tabOverMarginDemo();
void testTdf106701_tabOverMarginAutotab();
@@ -322,6 +323,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);
@@ -1659,6 +1661,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