From 601d68584921a47d83d833228f5ec698e13b624c Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 23 Jan 2012 12:02:36 +0000 Subject: Make mid() and midRef() properly return empty, non-null objects If we request a substring starting at the very end of the string, QString::mid should return an empty string, not a null string. For instance, QString("abc").mid(3, 0) used to return a null one, while this patch makes it return an empty one. The same thing applies to QString::midRef() and QByteArray::mid(). Change-Id: Ie9efd7a0622d429efd0fb682c19856c19e9469af Reviewed-by: Lars Knoll --- dist/changes-5.0.0 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dist') diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index 1b67f878be..bbd1c2300d 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -221,6 +221,11 @@ QtCore altering the watchlist in both the singular and QStringList overloads of addPath and removePath. +* QString::mid, QString::midRef and QByteArray::mid, if the position passed + is equal to the length (that is, right after the last character/byte), + now return an empty QString, QStringRef or QByteArray respectively. + in Qt 4 they returned a null QString or a null QStringRef. + QtGui ----- * Accessibility has been refactored. The hierachy of accessible objects is implemented via -- cgit v1.2.3