Merge lp:~michael-sheldon/ubuntu-keyboard/fix-1398503-rtm into lp:ubuntu-keyboard/rtm-14.09

Proposed by Michael Sheldon on 2014-12-09
Status: Merged
Approved by: Bill Filler on 2014-12-09
Approved revision: 237
Merged at revision: 240
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1398503-rtm
Merge into: lp:ubuntu-keyboard/rtm-14.09
Diff against target: 81 lines (+5/-21)
3 files modified
plugins/westernsupport/westernlanguagefeatures.cpp (+1/-1)
src/view/abstracttexteditor.cpp (+0/-7)
tests/unittests/ut_editor/ut_editor.cpp (+4/-13)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1398503-rtm
Reviewer Review Type Date Requested Status
Bill Filler (community) 2014-12-09 Approve on 2014-12-09
Review via email: mp+244198@code.launchpad.net

Commit message

Disables automatic insertion of space characters after punctuation except when punctuation has been added by double space.

Description of the change

Disables automatic insertion of space characters after punctuation except when punctuation has been added by double space.

To post a comment you must log in.
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes, in sync with rtm branch

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-keyboard) on device or emulator?

 * Yes (except for features not implemented in RTM)

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Bill Filler (bfiller) wrote :

tested, works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/westernsupport/westernlanguagefeatures.cpp'
2--- plugins/westernsupport/westernlanguagefeatures.cpp 2014-09-08 15:09:32 +0000
3+++ plugins/westernsupport/westernlanguagefeatures.cpp 2014-12-09 18:44:58 +0000
4@@ -60,7 +60,7 @@
5 return false;
6 }
7
8- if (sentenceBreak.contains(preedit.right(1))) {
9+ if (sentenceBreak.contains(preedit.mid(preedit.length() - 2, 1)) && preedit.right(1) == " ") {
10 return true;
11 }
12
13
14=== modified file 'src/view/abstracttexteditor.cpp'
15--- src/view/abstracttexteditor.cpp 2014-11-04 20:17:35 +0000
16+++ src/view/abstracttexteditor.cpp 2014-12-09 18:44:58 +0000
17@@ -465,10 +465,6 @@
18 // this means we should commit the candidate, add the separator and whitespace
19 d->text->setPreedit(d->text->primaryCandidate());
20 d->text->appendToPreedit(text);
21- if (d->keyboardState == "CHARACTERS" && !email_detected) {
22- d->appendix_for_previous_preedit = d->word_engine->languageFeature()->appendixForReplacedPreedit(d->text->preedit());
23- d->text->appendToPreedit(d->appendix_for_previous_preedit);
24- }
25 commitPreedit();
26 if (!email_detected) {
27 auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(d->text->surroundingLeft() + d->text->preedit() + text);
28@@ -484,9 +480,6 @@
29 d->text->appendToPreedit(text);
30 if (!email_detected) {
31 auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(d->text->surroundingLeft() + d->text->preedit());
32- if(isSeparator && d->keyboardState == "CHARACTERS") {
33- d->text->appendToPreedit(d->word_engine->languageFeature()->appendixForReplacedPreedit(d->text->preedit()));
34- }
35 }
36 commitPreedit();
37 alreadyAppended = true;
38
39=== modified file 'tests/unittests/ut_editor/ut_editor.cpp'
40--- tests/unittests/ut_editor/ut_editor.cpp 2014-07-22 14:02:39 +0000
41+++ tests/unittests/ut_editor/ut_editor.cpp 2014-12-09 18:44:58 +0000
42@@ -114,9 +114,9 @@
43 // FIXME: In the current testing infra, we cannot really test this properly, as we are using the 'backspace' character
44 // a lot during auto-correction, which is currently not handled too well here.
45 QTest::newRow("auto-correct enabled, commit with space, check separators")
46- << true << "Hel ,Wor ." << "Hello , World . ";
47+ << true << "Hel , Wor ." << "Hello , World .";
48 QTest::newRow("auto-correct enabled, commit with separators, check separators")
49- << true << "Hel.Wor." << "Hello. World. ";
50+ << true << "Hel. Wor." << "Hello. World.";
51 QTest::newRow("auto-correct enabled, check if two spaces are full-stop")
52 << true << "Hel " << "Hello . ";
53 //QTest::newRow("auto-correct enabled, check removal of unnecessary whitespaces")
54@@ -183,25 +183,16 @@
55 QTest::newRow("auto-correct disabled, multiple sentences with mixed punctation")
56 << false << "This is a \"first sentence\". And a second, one! "
57 << "This is a \"first sentence\". And a second, one! " << 2;
58- QTest::newRow("auto-correct enabled, multiple sentences with mixed punctation")
59- << true << "This is a \"first sentence\".And a second,one!"
60- << "This is a \"first sentence\". And a second, one! " << 2;
61 QTest::newRow("auto-correct disabled, multiple sentences with dots")
62 << false << "First sentence. Second one. And Third. "
63 << "First sentence. Second one. And Third. " << 3;
64- QTest::newRow("auto-correct enabled, multiple sentences with dots")
65- << true << "First sentence.Second one.And Third."
66- << "First sentence. Second one. And Third. " << 3;
67
68 // Tests for the auto-correct and autocaps separator functionality
69 // FIXME: In the current testing infra, we cannot really test this properly, as we are using the 'backspace' character
70 // a lot during auto-correction, which is currently not handled too well here.
71 QTest::newRow("auto-correct enabled, autocaps after separator auto-correction")
72- << true << "Hello Wor .This should be autocapsed "
73- << "Hello World . This should be autocapsed " << 1;
74- QTest::newRow("auto-correct enabled, autocaps after separator auto-correction #2")
75- << true << "Hello Wor .This should be autocapsed "
76- << "Hello World . This should be autocapsed " << 1;
77+ << true << "Hello Wor . This should be autocapsed "
78+ << "Hello World . This should be autocapsed " << 2;
79 }
80
81 Q_SLOT void testAutoCaps()

Subscribers

People subscribed via source and target branches