diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2012-11-21 16:24:49 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-24 14:55:30 +0100 |
commit | cf1e315e285b9a645231538bcbacf9e541c970c3 (patch) | |
tree | 33aef9f3d2d8aa5a37ff8347f03f69b0359bfc5e /src/corelib/kernel/qvariant.cpp | |
parent | 0bfc5b898d0e6cbe210cf1f71ff556f7dd3be6a2 (diff) |
Fix QVariant streaming in Qt3 compatibility mode.
Task-number: QTBUG-27700
Change-Id: I0408293e43c3330dbc4746198a19709e795f552a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 96f2ff682d..9ff9d10bf0 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1736,7 +1736,7 @@ static const ushort mapIdFromQt3ToCurrent[MapFromThreeCount] = QVariant::UInt, QVariant::Bool, QVariant::Double, - QVariant::ByteArray, + 0, // Buggy ByteArray, QByteArray never had id == 20 QVariant::Polygon, QVariant::Region, QVariant::Bitmap, @@ -1829,13 +1829,13 @@ void QVariant::save(QDataStream &s) const quint32 typeId = type(); if (s.version() < QDataStream::Qt_4_0) { int i; - for (i = MapFromThreeCount - 1; i >= 0; i--) { + for (i = 0; i <= MapFromThreeCount - 1; ++i) { if (mapIdFromQt3ToCurrent[i] == typeId) { typeId = i; break; } } - if (i == -1) { + if (i >= MapFromThreeCount) { s << QVariant(); return; } |