Changed the getter functions in QWebSettings to transparently resolve against the...
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2007 14:32:05 +0000 (14:32 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2007 14:32:05 +0000 (14:32 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27562 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/qt/Api/qwebsettings.cpp
WebKit/qt/ChangeLog

index dfc54ac60c3228a76f8e83cae4fd5e289466282c..ddb4b25c11560fac76e121c40ceca4c6ddd60c18 100644 (file)
@@ -183,7 +183,12 @@ void QWebSettings::setFontSize(FontSize type, int size)
 
 int QWebSettings::fontSize(FontSize type) const
 {
-    return d->fontSizes.value(type);
+    int defaultValue = 0;
+    if (d->settings) {
+        QWebSettingsPrivate *global = QWebSettings::defaultSettings()->d;
+        defaultValue = global->fontSizes.value(type);
+    }
+    return d->fontSizes.value(type, defaultValue);
 }
 
 void QWebSettings::resetFontSize(FontSize type)
@@ -244,7 +249,12 @@ void QWebSettings::setFontFamily(FontType type, const QString &family)
 
 QString QWebSettings::fontFamily(FontType type) const
 {
-    return d->fontFamilies.value(type);
+    QString defaultValue;
+    if (d->settings) {
+        QWebSettingsPrivate *global = QWebSettings::defaultSettings()->d;
+        defaultValue = global->fontFamilies.value(type);
+    }
+    return d->fontFamilies.value(type, defaultValue);
 }
 
 void QWebSettings::resetFontFamily(FontType type)
@@ -261,7 +271,12 @@ void QWebSettings::setAttribute(WebAttribute attr, bool on)
 
 bool QWebSettings::testAttribute(WebAttribute attr) const
 {
-    return d->attributes.value(attr);
+    bool defaultValue = false;
+    if (d->settings) {
+        QWebSettingsPrivate *global = QWebSettings::defaultSettings()->d;
+        defaultValue = global->attributes.value(attr);
+    }
+    return d->attributes.value(attr, defaultValue);
 }
 
 void QWebSettings::clearAttribute(WebAttribute attr)
index a3196ecd61f40c36d565f3aaf35a2b7e44482681..01b2f43008570d00450cc350677a25eea53de4d9 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-07  Simon Hausmann  <hausmann@kde.org>
+
+        Reviewed by Lars.
+
+        Changed the getter functions in QWebSettings to transparently resolve against the default settings.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::fontSize):
+        (QWebSettings::fontFamily):
+        (QWebSettings::testAttribute):
+
 2007-11-07  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Lars.