version 1.352, 2006/03/27 13:48:25
|
version 1.353, 2006/03/30 15:56:11
|
Line 4280 static char *ParseCSSContent (Element el
|
Line 4280 static char *ParseCSSContent (Element el
|
CSSInfoPtr css, ThotBool isHTML) |
CSSInfoPtr css, ThotBool isHTML) |
{ |
{ |
PresentationValue value; |
PresentationValue value; |
char *p, *last, *start, quoteChar, savedChar; |
char *last, *start, quoteChar, savedChar; |
|
int length, val; |
|
unsigned char *buffer, *p; |
ThotBool repeat; |
ThotBool repeat; |
|
|
value.typed_data.unit = UNIT_REL; |
value.typed_data.unit = UNIT_REL; |
Line 4292 static char *ParseCSSContent (Element el
|
Line 4294 static char *ParseCSSContent (Element el
|
repeat = TRUE; |
repeat = TRUE; |
while (repeat) |
while (repeat) |
{ |
{ |
p = cssRule; |
p = (unsigned char*) cssRule; |
if (!strncasecmp (cssRule, "normal", 6)) |
if (!strncasecmp (cssRule, "normal", 6)) |
/* The pseudo-element is not generated */ |
/* The pseudo-element is not generated */ |
{ |
{ |
Line 4311 static char *ParseCSSContent (Element el
|
Line 4313 static char *ParseCSSContent (Element el
|
/* It's a string */ |
/* It's a string */ |
{ |
{ |
quoteChar = *cssRule; |
quoteChar = *cssRule; |
|
/* how long is the string? */ |
|
last = cssRule; |
|
last = SkipString (last); |
|
length = last - cssRule; |
|
/* get a buffer to store the string */ |
|
buffer = (unsigned char*) TtaGetMemory (length); |
|
p = buffer; /* beginning of the string */ |
cssRule++; |
cssRule++; |
p = cssRule; |
|
/**** escape characters are not handled. |
|
See function SkipQuotedString ******/ |
|
while (*cssRule != EOS && *cssRule != quoteChar) |
while (*cssRule != EOS && *cssRule != quoteChar) |
cssRule++; |
{ |
|
if (*cssRule == '\\') |
|
{ |
|
cssRule++; /* skip the backslash */ |
|
if ((*cssRule >= '0' && *cssRule <= '9') || |
|
(*cssRule >= 'A' && *cssRule <= 'F') || |
|
(*cssRule >= 'a' && *cssRule <= 'f')) |
|
{ |
|
start = cssRule; /* first hex digit after the backslash*/ |
|
cssRule++; |
|
while ((*cssRule >= '0' && *cssRule <= '9') || |
|
(*cssRule >= 'A' && *cssRule <= 'F') || |
|
(*cssRule >= 'a' && *cssRule <= 'f')) |
|
cssRule++; |
|
savedChar = *cssRule; |
|
*cssRule = EOS; |
|
sscanf (start, "%x", &val); |
|
TtaWCToMBstring ((wchar_t) val, &p); |
|
*cssRule = savedChar; |
|
} |
|
else |
|
{ |
|
*p = *cssRule; |
|
p++; cssRule++; |
|
} |
|
} |
|
else |
|
{ |
|
*p = *cssRule; |
|
p++; cssRule++; |
|
} |
|
} |
|
*p = EOS; |
if (*cssRule != quoteChar) |
if (*cssRule != quoteChar) |
cssRule = SkipProperty (cssRule, FALSE); |
cssRule = SkipProperty (cssRule, FALSE); |
else |
else |
Line 4324 static char *ParseCSSContent (Element el
|
Line 4362 static char *ParseCSSContent (Element el
|
*cssRule = EOS; |
*cssRule = EOS; |
value.typed_data.unit = UNIT_REL; |
value.typed_data.unit = UNIT_REL; |
value.typed_data.real = FALSE; |
value.typed_data.real = FALSE; |
value.pointer = p; |
value.pointer = buffer; |
if (DoApply) |
if (DoApply) |
TtaSetStylePresentation (PRContentString, element, tsch, ctxt, |
TtaSetStylePresentation (PRContentString, element, tsch, ctxt, |
value); |
value); |
*cssRule = quoteChar; |
*cssRule = quoteChar; |
cssRule++; |
cssRule++; |
} |
} |
|
TtaFreeMemory (buffer); |
} |
} |
else if (!strncasecmp (cssRule, "url", 3)) |
else if (!strncasecmp (cssRule, "url", 3)) |
{ |
{ |
Line 4388 static char *ParseCSSContent (Element el
|
Line 4427 static char *ParseCSSContent (Element el
|
} |
} |
if (value.pointer == NULL) |
if (value.pointer == NULL) |
{ |
{ |
CSSParseError ("Invalid content value", p, cssRule); |
CSSParseError ("Invalid content value", (char*) p, cssRule); |
cssRule = SkipProperty (cssRule, FALSE); |
cssRule = SkipProperty (cssRule, FALSE); |
} |
} |
cssRule++; |
cssRule++; |
Line 4421 static char *ParseCSSContent (Element el
|
Line 4460 static char *ParseCSSContent (Element el
|
} |
} |
else |
else |
{ |
{ |
CSSParseError ("Invalid content value", p, cssRule); |
CSSParseError ("Invalid content value", (char*) p, cssRule); |
cssRule = SkipProperty (cssRule, FALSE); |
cssRule = SkipProperty (cssRule, FALSE); |
} |
} |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |