changeset 916:6ab291295a2d

set type in CssPropertyList::set()
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Fri, 06 Feb 2009 21:17:42 +0100
parents b9709589263f
children f1f95cb69505
files src/css.cc src/cssparser.cc
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/css.cc	Fri Feb 06 20:59:46 2009 +0100
+++ b/src/css.cc	Fri Feb 06 21:17:42 2009 +0100
@@ -32,13 +32,17 @@
 
 void CssPropertyList::set (CssPropertyName name, CssValueType type,
                            CssPropertyValue value) {
-   for (int i = 0; i < size (); i++)
-      if (getRef (i)->name == name) {
+   for (int i = 0; i < size (); i++) {
+      CssProperty *prop = getRef (i);
+
+      if (prop->name == name) {
          if (ownerOfStrings)
-            getRef (i)->free ();
-         getRef (i)->value = value;
+            prop->free ();
+         prop->type = type;
+         prop->value = value;
          return;
       }
+   }
 
    increase ();
    getRef (size () - 1)->name = name;
--- a/src/cssparser.cc	Fri Feb 06 20:59:46 2009 +0100
+++ b/src/cssparser.cc	Fri Feb 06 21:17:42 2009 +0100
@@ -625,6 +625,7 @@
       }
    }
 
+   *type = CSS_TYPE_UNUSED;
    return false;
 }