diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-10-08 16:51:41 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-13 03:17:28 +0200 |
commit | 539ef45689e0d038b6cd83d772597a5be886d8ff (patch) | |
tree | 18c40fc182f3508374da3a25591fe0a651edb3a6 /src/plugins/platforms/windows/qwindowsinputcontext.cpp | |
parent | a895359c1997b5830e429bc13c661549d89f099a (diff) |
Update/fix QTextBoundaryFinder simple usage cases in qtbase
Change-Id: I4d3000558bce86e2de3c32247915868ba18fc8b7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsinputcontext.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsinputcontext.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index 8b3d6749a0..11fd740009 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -560,12 +560,8 @@ int QWindowsInputContext::reconvertString(RECONVERTSTRING *reconv) // Find the word in the surrounding text. QTextBoundaryFinder bounds(QTextBoundaryFinder::Word, surroundingText); bounds.setPosition(pos); - if (bounds.isAtBoundary()) { - if (QTextBoundaryFinder::EndWord == bounds.boundaryReasons()) - bounds.toPreviousBoundary(); - } else { + if (bounds.position() > 0 && !(bounds.boundaryReasons() & QTextBoundaryFinder::StartOfItem)) bounds.toPreviousBoundary(); - } const int startPos = bounds.position(); bounds.toNextBoundary(); const int endPos = bounds.position(); |