summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-11-16 16:39:26 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-11-16 19:40:51 +0100
commit837bb7370b702399562a3b0b4e444237c66879a8 (patch)
treee678930c295cd8681897737eb163208ad3ed7eae /sw/qa
parent09dfad9565b37353acc0b31054639134f1a85ab9 (diff)
tdf#139922: sw_uiwriter3: Add unittest
Change-Id: I4401ba7d00dae654a6e3c897719e5f1a112a9abb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125318 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index b90e5d18ee56..b2d65f2f7233 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -837,6 +837,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
}
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139922)
+{
+ SwDoc* const pDoc = createSwDoc();
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+
+ pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+ Scheduler::ProcessEventsToIdle();
+
+ SwWrtShell* const pWrtSh = pDoc->GetDocShell()->GetWrtShell();
+ CPPUNIT_ASSERT(pWrtSh);
+
+ pWrtSh->Insert("this _is_ a SEntence. this _is_ a SEntence.");
+
+ CPPUNIT_ASSERT_EQUAL(OUString("this _is_ a SEntence. this _is_ a SEntence."),
+ getParagraph(2)->getString());
+
+ //apply autocorrect StartAutoCorrect
+ dispatchCommand(mxComponent, ".uno:AutoFormatApply", {});
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: This is a Sentence. This is a Sentence.
+ // - Actual : this is a Sentence. This is a Sentence.
+ CPPUNIT_ASSERT_EQUAL(OUString("This is a Sentence. This is a Sentence."),
+ getParagraph(2)->getString());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261)
{
createSwDoc(DATA_DIRECTORY, "tdf125261.odt");