summaryrefslogtreecommitdiff
path: root/editeng/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-19 15:02:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-06-19 16:27:16 +0100
commit3212a2419416359f11e60c62cadeeaa8078c33a7 (patch)
treea2119927c02c00a515b6a45c0cab277302e46eba /editeng/qa
parent9d221db01337957ec161a76b5dd7db9d6b384c89 (diff)
consider field marks as text for auto quotes
Change-Id: I511a13f7785a0de6efaa8439d3f0bff20a1644ed
Diffstat (limited to 'editeng/qa')
-rw-r--r--editeng/qa/unit/core-test.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index f620a72d8843..b71c90c72dfc 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -375,6 +375,7 @@ void Test::testAutocorrect()
CPPUNIT_ASSERT_EQUAL_MESSAGE("autocorrect", sExpected, aFoo.getResult());
}
+ // don't autocapitalize after a field mark
{
OUString sInput("Test. \x01 test");
sal_Unicode cNextChar(' ');
@@ -385,6 +386,22 @@ void Test::testAutocorrect()
CPPUNIT_ASSERT_EQUAL_MESSAGE("autocorrect", sExpected, aFoo.getResult());
}
+
+ // consider field contents as text for auto quotes
+ {
+ OUString sInput("T\x01");
+ sal_Unicode cNextChar('"');
+ const sal_Unicode EXPECTED[] = { 'T', 0x01, 0x0201d };
+ OUString sExpected(EXPECTED, SAL_N_ELEMENTS(EXPECTED));
+
+ TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US);
+ aAutoCorrect.SetAutoCorrFlag(ChgQuotes, true);
+ aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true);
+ fprintf(stderr, "text is %x\n", aFoo.getResult()[aFoo.getResult().getLength() - 1]);
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("autocorrect", sExpected, aFoo.getResult());
+ }
+
}
void Test::testHyperlinkCopyPaste()