[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 11 18:36:12 UTC 2020
sw/qa/extras/uiwriter/data3/tdf132725.odt |binary
sw/qa/extras/uiwriter/uiwriter3.cxx | 42 ++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
New commits:
commit cd47dba9aa4b91bb0edf0744561d29e2eef61cc9
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jun 11 14:56:19 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Jun 11 20:35:35 2020 +0200
tdf#132725: sw: Add unittest
Change-Id: I3d4405dbe77d9f4d9bece8023cc01a7fa0ac463c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96122
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/qa/extras/uiwriter/data3/tdf132725.odt b/sw/qa/extras/uiwriter/data3/tdf132725.odt
new file mode 100644
index 000000000000..b14fc20486ea
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf132725.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 8668749f134d..2dbc522a59a3 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -234,6 +234,48 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf76636_2)
CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xTextTable->getColumns()->getCount());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132725)
+{
+ load(DATA_DIRECTORY, "tdf132725.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(OUString("AA"), getParagraph(1)->getString());
+
+ dispatchCommand(mxComponent, ".uno:GoToEndOfPara", {});
+ Scheduler::ProcessEventsToIdle();
+
+ dispatchCommand(mxComponent, ".uno:SwBackspace", {});
+ dispatchCommand(mxComponent, ".uno:SwBackspace", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(0, getShapes());
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString());
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(OUString("AA"), getParagraph(1)->getString());
+
+ dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(0, getShapes());
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString());
+
+ //Without the fix in place, it would crash here
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(OUString("A"), getParagraph(1)->getString());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126340)
{
load(DATA_DIRECTORY, "tdf126340.odt");
More information about the Libreoffice-commits
mailing list