diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-29 08:10:27 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-29 08:10:41 (GMT) |
commit | df37b2e9023bc2cebe00c77be6040019cfdc24b6 (patch) | |
tree | 06739d09b63dd673b510a5af31de7c30407bed6e /src/corelib/tools | |
parent | f32abd2b9febdeadeb5536d0318f77be4180f142 (diff) | |
parent | cabfa68f3e37e79a18775a9970f6d166e75ece07 (diff) | |
download | Qt-df37b2e9023bc2cebe00c77be6040019cfdc24b6.zip Qt-df37b2e9023bc2cebe00c77be6040019cfdc24b6.tar.gz Qt-df37b2e9023bc2cebe00c77be6040019cfdc24b6.tar.bz2 |
Merge commit origin/4.6 into team-widgets/4.6
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index a996f30..55ad28d 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1590,12 +1590,12 @@ QString &QString::append(QChar ch) */ QString &QString::remove(int pos, int len) { - if (pos < 0) + if (pos < 0) // count from end of string pos += d->size; if (pos < 0 || pos >= d->size) { // range problems - } else if (pos + len >= d->size) { // pos ok - resize(pos); + } else if (len >= d->size - pos) { + resize(pos); // truncate } else if (len > 0) { detach(); memmove(d->data + pos, d->data + pos + len, |