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

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
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) Approve
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.
Revision history for this message
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

Revision history for this message
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
=== modified file 'plugins/westernsupport/westernlanguagefeatures.cpp'
--- plugins/westernsupport/westernlanguagefeatures.cpp 2014-09-08 15:09:32 +0000
+++ plugins/westernsupport/westernlanguagefeatures.cpp 2014-12-09 18:44:58 +0000
@@ -60,7 +60,7 @@
60 return false;60 return false;
61 }61 }
6262
63 if (sentenceBreak.contains(preedit.right(1))) {63 if (sentenceBreak.contains(preedit.mid(preedit.length() - 2, 1)) && preedit.right(1) == " ") {
64 return true;64 return true;
65 }65 }
6666
6767
=== modified file 'src/view/abstracttexteditor.cpp'
--- src/view/abstracttexteditor.cpp 2014-11-04 20:17:35 +0000
+++ src/view/abstracttexteditor.cpp 2014-12-09 18:44:58 +0000
@@ -465,10 +465,6 @@
465 // this means we should commit the candidate, add the separator and whitespace465 // this means we should commit the candidate, add the separator and whitespace
466 d->text->setPreedit(d->text->primaryCandidate());466 d->text->setPreedit(d->text->primaryCandidate());
467 d->text->appendToPreedit(text);467 d->text->appendToPreedit(text);
468 if (d->keyboardState == "CHARACTERS" && !email_detected) {
469 d->appendix_for_previous_preedit = d->word_engine->languageFeature()->appendixForReplacedPreedit(d->text->preedit());
470 d->text->appendToPreedit(d->appendix_for_previous_preedit);
471 }
472 commitPreedit();468 commitPreedit();
473 if (!email_detected) {469 if (!email_detected) {
474 auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(d->text->surroundingLeft() + d->text->preedit() + text);470 auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(d->text->surroundingLeft() + d->text->preedit() + text);
@@ -484,9 +480,6 @@
484 d->text->appendToPreedit(text);480 d->text->appendToPreedit(text);
485 if (!email_detected) {481 if (!email_detected) {
486 auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(d->text->surroundingLeft() + d->text->preedit());482 auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(d->text->surroundingLeft() + d->text->preedit());
487 if(isSeparator && d->keyboardState == "CHARACTERS") {
488 d->text->appendToPreedit(d->word_engine->languageFeature()->appendixForReplacedPreedit(d->text->preedit()));
489 }
490 }483 }
491 commitPreedit();484 commitPreedit();
492 alreadyAppended = true;485 alreadyAppended = true;
493486
=== modified file 'tests/unittests/ut_editor/ut_editor.cpp'
--- tests/unittests/ut_editor/ut_editor.cpp 2014-07-22 14:02:39 +0000
+++ tests/unittests/ut_editor/ut_editor.cpp 2014-12-09 18:44:58 +0000
@@ -114,9 +114,9 @@
114 // FIXME: In the current testing infra, we cannot really test this properly, as we are using the 'backspace' character114 // FIXME: In the current testing infra, we cannot really test this properly, as we are using the 'backspace' character
115 // a lot during auto-correction, which is currently not handled too well here.115 // a lot during auto-correction, which is currently not handled too well here.
116 QTest::newRow("auto-correct enabled, commit with space, check separators")116 QTest::newRow("auto-correct enabled, commit with space, check separators")
117 << true << "Hel ,Wor ." << "Hello , World . ";117 << true << "Hel , Wor ." << "Hello , World .";
118 QTest::newRow("auto-correct enabled, commit with separators, check separators")118 QTest::newRow("auto-correct enabled, commit with separators, check separators")
119 << true << "Hel.Wor." << "Hello. World. ";119 << true << "Hel. Wor." << "Hello. World.";
120 QTest::newRow("auto-correct enabled, check if two spaces are full-stop")120 QTest::newRow("auto-correct enabled, check if two spaces are full-stop")
121 << true << "Hel " << "Hello . "; 121 << true << "Hel " << "Hello . ";
122 //QTest::newRow("auto-correct enabled, check removal of unnecessary whitespaces")122 //QTest::newRow("auto-correct enabled, check removal of unnecessary whitespaces")
@@ -183,25 +183,16 @@
183 QTest::newRow("auto-correct disabled, multiple sentences with mixed punctation")183 QTest::newRow("auto-correct disabled, multiple sentences with mixed punctation")
184 << false << "This is a \"first sentence\". And a second, one! "184 << false << "This is a \"first sentence\". And a second, one! "
185 << "This is a \"first sentence\". And a second, one! " << 2;185 << "This is a \"first sentence\". And a second, one! " << 2;
186 QTest::newRow("auto-correct enabled, multiple sentences with mixed punctation")
187 << true << "This is a \"first sentence\".And a second,one!"
188 << "This is a \"first sentence\". And a second, one! " << 2;
189 QTest::newRow("auto-correct disabled, multiple sentences with dots")186 QTest::newRow("auto-correct disabled, multiple sentences with dots")
190 << false << "First sentence. Second one. And Third. "187 << false << "First sentence. Second one. And Third. "
191 << "First sentence. Second one. And Third. " << 3;188 << "First sentence. Second one. And Third. " << 3;
192 QTest::newRow("auto-correct enabled, multiple sentences with dots")
193 << true << "First sentence.Second one.And Third."
194 << "First sentence. Second one. And Third. " << 3;
195189
196 // Tests for the auto-correct and autocaps separator functionality190 // Tests for the auto-correct and autocaps separator functionality
197 // FIXME: In the current testing infra, we cannot really test this properly, as we are using the 'backspace' character191 // FIXME: In the current testing infra, we cannot really test this properly, as we are using the 'backspace' character
198 // a lot during auto-correction, which is currently not handled too well here.192 // a lot during auto-correction, which is currently not handled too well here.
199 QTest::newRow("auto-correct enabled, autocaps after separator auto-correction")193 QTest::newRow("auto-correct enabled, autocaps after separator auto-correction")
200 << true << "Hello Wor .This should be autocapsed "194 << true << "Hello Wor . This should be autocapsed "
201 << "Hello World . This should be autocapsed " << 1;195 << "Hello World . This should be autocapsed " << 2;
202 QTest::newRow("auto-correct enabled, autocaps after separator auto-correction #2")
203 << true << "Hello Wor .This should be autocapsed "
204 << "Hello World . This should be autocapsed " << 1;
205 }196 }
206197
207 Q_SLOT void testAutoCaps()198 Q_SLOT void testAutoCaps()

Subscribers

People subscribed via source and target branches