[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jan 20 08:02:37 UTC 2021
sw/qa/extras/uiwriter/data3/tdf123285.odt |binary
sw/qa/extras/uiwriter/uiwriter3.cxx | 25 +++++++++++++++++++++++++
2 files changed, 25 insertions(+)
New commits:
commit 35a564864e6ce08abfa4924e1ea9314982e7957c
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Jan 19 19:26:24 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Jan 20 09:02:02 2021 +0100
tdf#123285: sw_uiwriter3: Add unittest
Change-Id: I32c20543f648e42b603ae5b5ace5fbfd6463a9d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109654
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/qa/extras/uiwriter/data3/tdf123285.odt b/sw/qa/extras/uiwriter/data3/tdf123285.odt
new file mode 100644
index 000000000000..1f92e1511a8b
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf123285.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 8250b01ef5dc..95503190218d 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1082,6 +1082,31 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134021)
CPPUNIT_ASSERT_EQUAL(12, getPages());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf123285)
+{
+ load(DATA_DIRECTORY, "tdf123285.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ CPPUNIT_ASSERT_EQUAL(true,
+ getParagraph(1)->getString().endsWith(
+ ". Here is a short sentence demonstrating this very peculiar bug"
+ ". Here is a short sentence demonstrating this very peculiar bug."));
+
+ dispatchCommand(mxComponent, ".uno:GoToEndOfPage", {});
+ Scheduler::ProcessEventsToIdle();
+
+ pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, the last "sentence" would have been changed to " entence"
+ CPPUNIT_ASSERT_EQUAL(true,
+ getParagraph(1)->getString().endsWith(
+ ". Here is a short sentence demonstrating this very peculiar bug"
+ ". Here is a short sentence demonstrating this very peculiar bug."));
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130746)
{
load(DATA_DIRECTORY, "tdf130746.odt");
More information about the Libreoffice-commits
mailing list