Changeset 846 for trunk/src/gui/text/qtextformat.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/text/qtextformat.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 266 266 }; 267 267 268 // this is only safe ifsizeof(int) == sizeof(float)268 // this is only safe because sizeof(int) == sizeof(float) 269 269 static inline uint hash(float d) 270 270 { 271 #ifdef Q_CC_GNU 272 // this is a GCC extension and isn't guaranteed to work in other compilers 273 // the reinterpret_cast below generates a strict-aliasing warning with GCC 274 union { float f; uint u; } cvt; 275 cvt.f = d; 276 return cvt.u; 277 #else 271 278 return reinterpret_cast<uint&>(d); 279 #endif 272 280 } 273 281 … … 901 909 int QTextFormat::intProperty(int propertyId) const 902 910 { 911 // required, since the default layout direction has to be LayoutDirectionAuto, which is not integer 0 912 int def = (propertyId == QTextFormat::LayoutDirection) ? int(Qt::LayoutDirectionAuto) : 0; 913 903 914 if (!d) 904 return 0;915 return def; 905 916 const QVariant prop = d->property(propertyId); 906 917 if (prop.userType() != QVariant::Int) 907 return 0;918 return def; 908 919 return prop.toInt(); 909 920 }
Note:
See TracChangeset
for help on using the changeset viewer.