Added explicit functions for resetting the font sizes and font families.
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2007 14:31:59 +0000 (14:31 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2007 14:31:59 +0000 (14:31 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27561 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

index c30e04ca84fb3f1c6ddcc83369afbc90a3f5d685..dfc54ac60c3228a76f8e83cae4fd5e289466282c 100644 (file)
@@ -177,10 +177,7 @@ QWebSettings::~QWebSettings()
 
 void QWebSettings::setFontSize(FontSize type, int size)
 {
-    if (size < 0)
-        d->fontSizes.remove(type);
-    else
-        d->fontSizes.insert(type, size);
+    d->fontSizes.insert(type, size);
     d->apply();
 }
 
@@ -189,6 +186,12 @@ int QWebSettings::fontSize(FontSize type) const
     return d->fontSizes.value(type);
 }
 
+void QWebSettings::resetFontSize(FontSize type)
+{
+    d->fontSizes.remove(type);
+    d->apply();
+}
+
 void QWebSettings::setUserStyleSheetLocation(const QString &location)
 {
     d->userStyleSheetLocation = location;
@@ -235,10 +238,7 @@ QPixmap QWebSettings::webGraphic(WebGraphic type)
 
 void QWebSettings::setFontFamily(FontType type, const QString &family)
 {
-    if (family.isEmpty())
-        d->fontFamilies.remove(type);
-    else
-        d->fontFamilies.insert(type, family);
+    d->fontFamilies.insert(type, family);
     d->apply();
 }
 
@@ -247,6 +247,12 @@ QString QWebSettings::fontFamily(FontType type) const
     return d->fontFamilies.value(type);
 }
 
+void QWebSettings::resetFontFamily(FontType type)
+{
+    d->fontFamilies.remove(type);
+    d->apply();
+}
+
 void QWebSettings::setAttribute(WebAttribute attr, bool on)
 {
     d->attributes.insert(attr, on);
index d0a7924bad57238ff97c42cebcb45f7afd1334fa..2f9dae8b405d6c60cd5b44eadddd93bc59d146ef 100644 (file)
@@ -73,9 +73,11 @@ public:
 
     void setFontFamily(FontType type, const QString &family);
     QString fontFamily(FontType type) const;
+    void resetFontFamily(FontType type);
 
     void setFontSize(FontSize type, int size);
     int fontSize(FontSize type) const;
+    void resetFontSize(FontSize type);
 
     void setAttribute(WebAttribute attr, bool on = true);
     bool testAttribute(WebAttribute attr) const;
index 60e67f1d62364a0aece5d73dc326fe597189572e..a3196ecd61f40c36d565f3aaf35a2b7e44482681 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-07  Simon Hausmann  <hausmann@kde.org>
+
+        Reviewed by Lars.
+
+        Added explicit functions for resetting the font sizes and font families.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::resetFontSize):
+        (QWebSettings::resetFontFamily):
+        * Api/qwebsettings.h:
+
 2007-11-07  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Lars.