Commit 3da75b05 authored by Morten Johan Sørvig's avatar Morten Johan Sørvig
Browse files

QCoreTextFontDatabase: Remove number type asserts.


On iOS 8, the value 0 is returned as a kCFNumberIntType.
The code still works - CFNumberGetValue converts it
to a 0.0 double.

Change-Id: Ic50900b22e4fa19ad1481e8e0e293559bbfd8cd2
Reviewed-by: default avatarTor Arne Vestbø <tor.arne.vestbo@digia.com>
No related merge requests found
Showing with 0 additions and 2 deletions
...@@ -264,7 +264,6 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd) ...@@ -264,7 +264,6 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
if (styles) { if (styles) {
if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) { if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) {
Q_ASSERT(CFNumberIsFloatType(weightValue));
double normalizedWeight; double normalizedWeight;
if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &normalizedWeight)) { if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &normalizedWeight)) {
if (normalizedWeight >= 0.62) if (normalizedWeight >= 0.62)
...@@ -280,7 +279,6 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd) ...@@ -280,7 +279,6 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
} }
} }
if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) { if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) {
Q_ASSERT(CFNumberIsFloatType(italic));
double d; double d;
if (CFNumberGetValue(italic, kCFNumberDoubleType, &d)) { if (CFNumberGetValue(italic, kCFNumberDoubleType, &d)) {
if (d > 0.0) if (d > 0.0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment