summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-11-09 11:36:57 +0100
committerLászló Németh <nemeth@numbertext.org>2020-11-09 15:59:00 +0100
commit2951c96bcb673a260a09e2c6eb92ca0f99bf0c18 (patch)
treea1df067c1d17f3058ef1ad0e92c094930860216b /sw/qa/extras/uiwriter/uiwriter.cxx
parente1e662065c911e55aeb85a67664dea9d5ed12313 (diff)
tdf#83419 sw change tracking: clean-up autocorrect
fix of commit ac84cf7dda4a5150ff23e112ee16f00b8de8ec7c (tdf#83419 sw change tracking: fix bad autocorrect). Now automatic sentence capitalization and correction of two initial capitals are allowed again, if there is a tracked deletion in the same paragraph before the modified word. Change-Id: I8c583df2f14468b47079019009e7937f559b652b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105477 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 2acfc17b7082..f1bb78af34cb 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -7652,11 +7652,18 @@ void SwUiWriterTest::testRedlineAutoCorrect()
nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+ // Including capitalization
+ pWrtShell->Insert("end. word");
+ pWrtShell->AutoCorrect(corr, ' ');
+ sReplaced = "tset test end. Word ";
+ nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+ CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
+
// tracked deletions after the correction point doesn't affect autocorrect
dispatchCommand(mxComponent, ".uno:GoToStartOfDoc", {});
pWrtShell->Insert("a");
pWrtShell->AutoCorrect(corr, ' ');
- sReplaced = "A tset test ";
+ sReplaced = "A tset test end. Word ";
nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
}