Diff for /Amaya/amaya/styleparser.c between versions 1.404 and 1.405

version 1.404, 2008/04/28 08:35:33 version 1.405, 2008/05/07 13:49:05
Line 61  typedef char *(*PropertyParser) (Element Line 61  typedef char *(*PropertyParser) (Element
 /* Description of the set of CSS properties supported */  /* Description of the set of CSS properties supported */
 typedef struct CSSProperty  typedef struct CSSProperty
 {  {
   char                *name;    const char          *name;
   PropertyParser       parsing_function;    PropertyParser       parsing_function;
 }  }
 CSSProperty;  CSSProperty;
Line 269  static char *SkipString (char *ptr) Line 269  static char *SkipString (char *ptr)
   CSSCheckEndValue    CSSCheckEndValue
   print an error message if another character is found    print an error message if another character is found
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 static char *CSSCheckEndValue (char *cssRule, char *endvalue, char *msg)  static char *CSSCheckEndValue (char *cssRule, char *endvalue, const char *msg)
 {  {
   char        c = EOS;    char        c = EOS;
   if (*endvalue != EOS && *endvalue != SPACE && *endvalue != '/' &&    if (*endvalue != EOS && *endvalue != SPACE && *endvalue != '/' &&
Line 373  static char *SkipProperty (char *ptr, Th Line 373  static char *SkipProperty (char *ptr, Th
   SkipValue    SkipValue
   skips the value and display an error message if msg is not NULL    skips the value and display an error message if msg is not NULL
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 static char *SkipValue (char *msg, char *ptr)  static char *SkipValue (const char *msg, char *ptr)
 {  {
   char       *deb;    char       *deb;
   char        c;    char        c;
Line 1501  static char *ParseCSSBorderTop (Element Line 1501  static char *ParseCSSBorderTop (Element
     }      }
   
   if (!width)    if (!width)
     ParseCSSBorderTopWidth (element, tsch, context, "medium", css, isHTML);      ParseCSSBorderTopWidth (element, tsch, context, (char*)"medium", css, isHTML);
   if (!style)    if (!style)
     ParseCSSBorderStyleTop (element, tsch, context, "none", css, isHTML);      ParseCSSBorderStyleTop (element, tsch, context, (char*)"none", css, isHTML);
   if (!color && DoApply)    if (!color && DoApply)
     {      {
       /* get the box color */        /* get the box color */
Line 1561  static char *ParseCSSBorderLeft (Element Line 1561  static char *ParseCSSBorderLeft (Element
     }      }
   
   if (!width)    if (!width)
     ParseCSSBorderLeftWidth (element, tsch, context, "medium", css, isHTML);      ParseCSSBorderLeftWidth (element, tsch, context, (char*)"medium", css, isHTML);
   if (!style)    if (!style)
     ParseCSSBorderStyleLeft (element, tsch, context, "none", css, isHTML);      ParseCSSBorderStyleLeft (element, tsch, context, (char*)"none", css, isHTML);
   if (!color && DoApply)    if (!color && DoApply)
     {      {
       /* get the box color */        /* get the box color */
Line 1621  static char *ParseCSSBorderBottom (Eleme Line 1621  static char *ParseCSSBorderBottom (Eleme
     }      }
   
   if (!width)    if (!width)
     ParseCSSBorderBottomWidth (element, tsch, context, "medium", css, isHTML);      ParseCSSBorderBottomWidth (element, tsch, context, (char*)"medium", css, isHTML);
   if (!style)    if (!style)
     ParseCSSBorderStyleBottom (element, tsch, context, "none", css, isHTML);      ParseCSSBorderStyleBottom (element, tsch, context, (char*)"none", css, isHTML);
   if (!color && DoApply)    if (!color && DoApply)
     {      {
       /* get the box color */        /* get the box color */
Line 1681  static char *ParseCSSBorderRight (Elemen Line 1681  static char *ParseCSSBorderRight (Elemen
     }      }
   
   if (!width)    if (!width)
     ParseCSSBorderRightWidth (element, tsch, context, "medium", css, isHTML);      ParseCSSBorderRightWidth (element, tsch, context, (char*)"medium", css, isHTML);
   if (!style)    if (!style)
     ParseCSSBorderStyleRight (element, tsch, context, "none", css, isHTML);      ParseCSSBorderStyleRight (element, tsch, context, (char*)"none", css, isHTML);
   if (!color && DoApply)    if (!color && DoApply)
     {      {
       /* get the box color */        /* get the box color */
Line 3793  static char *ParseCSSFont (Element eleme Line 3793  static char *ParseCSSFont (Element eleme
       ptr = cssRule;        ptr = cssRule;
       /* set default variant, style, weight */        /* set default variant, style, weight */
       if (!variant)        if (!variant)
         ParseACSSFontVariant (element, tsch, context, "normal", css, isHTML);          ParseACSSFontVariant (element, tsch, context, (char*)"normal", css, isHTML);
       if (!style)        if (!style)
         ParseACSSFontStyle (element, tsch, context, "normal", css, isHTML);          ParseACSSFontStyle (element, tsch, context, (char*)"normal", css, isHTML);
       if (!weight)        if (!weight)
         ParseACSSFontWeight (element, tsch, context, "normal", css, isHTML);          ParseACSSFontWeight (element, tsch, context, (char*)"normal", css, isHTML);
       /* now parse the font size and the font family */        /* now parse the font size and the font family */
       if (*cssRule != ';' && *cssRule != '}' && *cssRule != EOS)        if (*cssRule != ';' && *cssRule != '}' && *cssRule != EOS)
         cssRule = ParseACSSFontSize (element, tsch, context, cssRule, css, isHTML, FALSE);          cssRule = ParseACSSFontSize (element, tsch, context, cssRule, css, isHTML, FALSE);
Line 5500  static char *ParseCSSBackground (Element Line 5500  static char *ParseCSSBackground (Element
     }      }
   
   if (color && !img)    if (color && !img)
     ParseCSSBackgroundImage (element, tsch, ctxt, "none", css, isHTML);      ParseCSSBackgroundImage (element, tsch, ctxt, (char*)
           "none", css, isHTML);
       
   if (img && !repeat)    if (img && !repeat)
     ParseACSSBackgroundRepeat (element, tsch, ctxt,      ParseACSSBackgroundRepeat (element, tsch, ctxt,
                                "repeat", css, isHTML);          (char*)"repeat", css, isHTML);
   if (img && !position)    if (img && !position)
     ParseACSSBackgroundPosition (element, tsch, ctxt,      ParseACSSBackgroundPosition (element, tsch, ctxt,
                                  "0% 0%", css, isHTML, &across);          (char*)"0% 0%", css, isHTML, &across);
   if (img && !attach)    if (img && !attach)
     ParseACSSBackgroundAttachment (element, tsch, ctxt,      ParseACSSBackgroundAttachment (element, tsch, ctxt,
                                    "scroll", css, isHTML);                                     (char*)"scroll", css, isHTML);
   return (cssRule);    return (cssRule);
 }  }
   
Line 8008  char ReadCSSRules (Document docRef, CSSI Line 8009  char ReadCSSRules (Document docRef, CSSI
                 {                  {
                   /* import section */                    /* import section */
                   cssRule = &CSSbuffer[import+7];                    cssRule = &CSSbuffer[import+7];
                   cssRule = TtaSkipBlanks (cssRule);                    cssRule = (char*)TtaSkipBlanks (cssRule);
                   /* save the current line number */                    /* save the current line number */
                   newlines += LineNumber;                    newlines += LineNumber;
                   if (!strncasecmp (cssRule, "url", 3))                    if (!strncasecmp (cssRule, "url", 3))
                     {                      {
                       cssRule = &cssRule[3];                        cssRule = &cssRule[3];
                       cssRule = TtaSkipBlanks (cssRule);                        cssRule = (char*)TtaSkipBlanks (cssRule);
                       if (*cssRule == '(')                        if (*cssRule == '(')
                         {                          {
                           cssRule++;                            cssRule++;
                           cssRule = TtaSkipBlanks (cssRule);                            cssRule = (char*)TtaSkipBlanks (cssRule);
                           quoted = (*cssRule == '"' || *cssRule == '\'');                            quoted = (*cssRule == '"' || *cssRule == '\'');
                           if (quoted)                            if (quoted)
                             cssRule++;                              cssRule++;
Line 8053  char ReadCSSRules (Document docRef, CSSI Line 8054  char ReadCSSRules (Document docRef, CSSI
                         Escaped quotes are not handled. See function SkipQuotedString                          Escaped quotes are not handled. See function SkipQuotedString
                       */                        */
                       cssRule++;                        cssRule++;
                       cssRule = TtaSkipBlanks (cssRule);                        cssRule = (char*)TtaSkipBlanks (cssRule);
                       base = cssRule;                        base = cssRule;
                       while (*cssRule != EOS &&                        while (*cssRule != EOS &&
                              (*cssRule != '"' ||                               (*cssRule != '"' ||
Line 8064  char ReadCSSRules (Document docRef, CSSI Line 8065  char ReadCSSRules (Document docRef, CSSI
                     }                      }
                   /* check if a media is defined */                    /* check if a media is defined */
                   cssRule++;                    cssRule++;
                   cssRule = TtaSkipBlanks (cssRule);                    cssRule = (char*)TtaSkipBlanks (cssRule);
                   if (*cssRule != ';')                    if (*cssRule != ';')
                     {                      {
                       css_media = CheckMediaCSS (cssRule);                        css_media = CheckMediaCSS (cssRule);

Removed from v.1.404  
changed lines
  Added in v.1.405


Webmaster