changeset 556:50dfb7d4585d

more fixes
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Tue, 11 Nov 2008 21:14:56 +0100
parents 44741a089224
children 13f4613df461
files src/cssparser.cc src/cssparser.hh
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/cssparser.cc	Tue Nov 11 20:51:44 2008 +0100
+++ b/src/cssparser.cc	Tue Nov 11 21:14:56 2008 +0100
@@ -9,6 +9,7 @@
 #include "cssparser.hh"
 
 using namespace dw::core::style;
+
 #define DEBUG_MSG(A, B, ...) MSG(B, __VA_ARGS__)
 #define MSG_CSS(A, ...) MSG(A, __VA_ARGS__)
 #define DEBUG_TOKEN_LEVEL   0
@@ -728,10 +729,10 @@
 
    if (parser->ttype == CSS_TK_SYMBOL) {
       pi.symbol = parser->tval;
-      pip = bsearch(&pi, Css_property_info, CSS_NUM_PARSED_PROPERTIES,
+      pip = (CssPropertyInfo*) bsearch(&pi, Css_property_info, CSS_NUM_PARSED_PROPERTIES,
                     sizeof (CssPropertyInfo), Css_property_info_cmp);
       if (pip) {
-         prop = pip - Css_property_info;
+         prop = (CssProperty::Name) (pip - Css_property_info);
          Css_next_token (parser);
          if (parser->ttype == CSS_TK_CHAR && parser->tval[0] == ':') {
             Css_next_token (parser);
@@ -746,7 +747,7 @@
       } else  {
          /* Try shorthands. */
          si.symbol = parser->tval;
-         sip = bsearch(&pi, Css_shorthand_info, CSS_SHORTHAND_NUM,
+         sip = (CssShorthandInfo*) bsearch(&pi, Css_shorthand_info, CSS_SHORTHAND_NUM,
                        sizeof (CssShorthandInfo), Css_shorthand_info_cmp);
          if (sip) {
             sh_index = sip - Css_shorthand_info;
@@ -755,7 +756,7 @@
                Css_next_token (parser);
 
                switch (Css_shorthand_info[sh_index].type) {
-               case CSS_SHORTHAND_MULTIPLE:
+               case CssShorthandInfo::CSS_SHORTHAND_MULTIPLE:
                   do {
                      for (found = false, i = 0;
                           !found &&
@@ -786,7 +787,7 @@
                   } while (found);
                   break;
                               
-               case CSS_SHORTHAND_DIRECTIONS:
+               case CssShorthandInfo::CSS_SHORTHAND_DIRECTIONS:
                   n = 0;
                   while (n < 4) {
                      if (Css_token_matches_property (
@@ -820,11 +821,11 @@
                   
                   break;
                   
-               case CSS_SHORTHAND_BORDER:
+               case CssShorthandInfo::CSS_SHORTHAND_BORDER:
                   /* todo: Not yet implemented. */
                   break;
                   
-               case CSS_SHORTHAND_FONT:
+               case CssShorthandInfo::CSS_SHORTHAND_FONT:
                   /* todo: Not yet implemented. */
                   break;
                }
--- a/src/cssparser.hh	Tue Nov 11 20:51:44 2008 +0100
+++ b/src/cssparser.hh	Tue Nov 11 21:14:56 2008 +0100
@@ -4,7 +4,7 @@
 /* The last three ones are never parsed. */
 #define CSS_NUM_INTERNAL_PROPERTIES 3
 #define CSS_NUM_PARSED_PROPERTIES \
-   (CSS_PROPERTY_LAST - CSS_NUM_INTERNAL_PROPERTIES)
+   (CssProperty::CSS_PROPERTY_LAST - CSS_NUM_INTERNAL_PROPERTIES)
 
 
 typedef enum {