Merge lp:~michael-sheldon/ubuntu-keyboard/fix-non-breaking-spaces into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 477
Merged at revision: 479
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-non-breaking-spaces
Merge into: lp:ubuntu-keyboard
Diff against target: 93 lines (+51/-3)
3 files modified
plugins/westernsupport/westernlanguagefeatures.cpp (+1/-1)
src/view/abstracttexteditor.cpp (+2/-2)
tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py (+48/-0)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-non-breaking-spaces
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Approve
PS Jenkins bot continuous-integration Pending
Ubuntu Phablet Team Pending
Review via email: mp+297048@code.launchpad.net

Commit message

Support all types of space character when checking for autocaps and double space full-stop insertion

Description of the change

Support all types of space character when checking for autocaps and double space full-stop insertion

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:476
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/8/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/540/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/540
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/529
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial/529
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/525/console
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/525/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/525
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/525/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/525
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/525/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/525
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/525/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/525
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/525/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/525
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/525/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/8/rebuild

review: Needs Fixing (continuous-integration)
477. By Michael Sheldon

Test double space full-stop insert in oxide when non-breaking spaces are present

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:477
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/19/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/599
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/73
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/599
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/569
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial/569
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/563
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/563/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/563
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/563/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/563
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/563/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/563
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/563/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/563
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/563/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/563
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/563/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/19/rebuild

review: Approve (continuous-integration)

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 2015-01-28 13:56:23 +0000
+++ plugins/westernsupport/westernlanguagefeatures.cpp 2016-06-14 15:58:18 +0000
@@ -60,7 +60,7 @@
60 return false;60 return false;
61 }61 }
6262
63 if (sentenceBreak.contains(preedit.mid(preedit.length() - 2, 1)) && preedit.right(1) == " ") {63 if (sentenceBreak.contains(preedit.mid(preedit.length() - 2, 1)) && preedit.at(preedit.count() - 1).isSpace()) {
64 return true;64 return true;
65 }65 }
6666
6767
=== modified file 'src/view/abstracttexteditor.cpp'
--- src/view/abstracttexteditor.cpp 2016-04-27 23:37:27 +0000
+++ src/view/abstracttexteditor.cpp 2016-06-14 15:58:18 +0000
@@ -512,7 +512,7 @@
512 d->previous_preedit_position -= 1;512 d->previous_preedit_position -= 1;
513 }513 }
514 }514 }
515 else if (look_for_a_double_space && not stopSequence.isEmpty() && textOnLeft.right(1) == " ") {515 else if (look_for_a_double_space && not stopSequence.isEmpty() && textOnLeft.at(textOnLeft.count() - 1).isSpace()) {
516 removeTrailingWhitespaces();516 removeTrailingWhitespaces();
517 if (!d->word_engine->languageFeature()->commitOnSpace()) {517 if (!d->word_engine->languageFeature()->commitOnSpace()) {
518 // Commit when inserting a fullstop if we don't insert on spaces518 // Commit when inserting a fullstop if we don't insert on spaces
@@ -870,7 +870,7 @@
870 QString::const_iterator i = textOnLeft.cend();870 QString::const_iterator i = textOnLeft.cend();
871 while (i != begin) {871 while (i != begin) {
872 --i;872 --i;
873 if (*i != ' ') break;873 if (!i->isSpace()) break;
874 singleBackspace();874 singleBackspace();
875 }875 }
876}876}
877877
=== modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py'
--- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2016-04-28 00:42:26 +0000
+++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2016-06-14 15:58:18 +0000
@@ -1301,6 +1301,54 @@
1301 Eventually(Equals(expected))1301 Eventually(Equals(expected))
1302 )1302 )
13031303
1304 def test_double_space(self):
1305 """Test that double space still inserts a full-stop and replaces all
1306 white spaces characters, even if they're non breaking spaces.
1307
1308 """
1309 qml = dedent("""
1310 import QtQuick 2.4
1311 import Ubuntu.Components 1.3
1312 import Ubuntu.Web 0.2
1313
1314 Rectangle {
1315 id: window
1316 objectName: "windowRectangle"
1317 color: "lightgrey"
1318
1319 WebView {
1320 anchors.fill: parent
1321 objectName: "webview"
1322 Component.onCompleted: {
1323 loadHtml("
1324 <html><body><textarea id='textarea'
1325 onkeyup=\\\"document.title=
1326 document.getElementById('textarea').value;\\\"
1327 style='width: 100%; height: 100%;'>&nbsp;</textarea>
1328 </body></html>"
1329 );
1330 }
1331 }
1332 }
1333
1334 """)
1335 app = self._start_qml_script(qml)
1336 webview = app.select_single(objectName='webview')
1337
1338 self.ensure_focus_on_input(webview)
1339 keyboard = Keyboard()
1340 self.addCleanup(keyboard.dismiss)
1341
1342 keyboard.type(' ')
1343
1344 # The page title trims white space, so we just look for the
1345 # full-stop, rather than '. '
1346 expected = "."
1347 self.assertThat(
1348 webview.title,
1349 Eventually(Equals(expected))
1350 )
1351
1304 def test_hiding(self):1352 def test_hiding(self):
1305 """Verify that the keyboard remains hidden after being dismissed from1353 """Verify that the keyboard remains hidden after being dismissed from
1306 a field that is no longer enabled.1354 a field that is no longer enabled.

Subscribers

People subscribed via source and target branches