Revert "make QChar::Unicode_Unassigned a constantly big value"

This reverts commit ebfd24a20b.

Breaks QChar and QString autotests

Change-Id: If1e915520ea491262c5f7753368be98c02ddac5e
Reviewed-by: Ritt Konstantin
Reviewed-on: http://codereview.qt.nokia.com/1672
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
bb10
Olivier Goffart 2011-07-14 16:21:21 +02:00 committed by Qt by Nokia
parent 4bb5167177
commit 639943ddea
3 changed files with 4 additions and 5 deletions

2
dist/changes-5.0.0 vendored
View File

@ -40,8 +40,6 @@ QtCore
------
* drop a bogus QChar::NoCategory enum value; the proper QChar::Other_NotAssigned
value is returned for an unassigned codepoints now.
* QChar::Unicode_Unassigned value was moved to the end of enum in order to make
the version based checks more convenient and less error-prone in use.
QtGui
-----

View File

@ -2973,7 +2973,8 @@ void qt_nameprep(QString *source, int from)
}
}
if (!isUnassignedAllowed) {
if (QChar::unicodeVersion(uc) > QChar::Unicode_3_2) {
QChar::UnicodeVersion version = QChar::unicodeVersion(uc);
if (version == QChar::Unicode_Unassigned || version > QChar::Unicode_3_2) {
source->resize(from); // not allowed, clear the label
return;
}

View File

@ -190,6 +190,7 @@ public:
};
enum UnicodeVersion {
Unicode_Unassigned, // ### Qt 5: assign with some constantly big value
Unicode_1_1,
Unicode_2_0,
Unicode_2_1_2,
@ -198,8 +199,7 @@ public:
Unicode_3_2,
Unicode_4_0,
Unicode_4_1,
Unicode_5_0,
Unicode_Unassigned = 0xff
Unicode_5_0
};
// ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO