version 1.436, 2010/01/21 16:13:12
|
version 1.437, 2010/07/07 16:15:01
|
Line 1
|
Line 1
|
/* |
/* |
* |
* |
* (c) COPYRIGHT INRIA and W3C, 1996-2009 |
* (c) COPYRIGHT INRIA and W3C, 1996-2010 |
* Please first read the full copyright statement in file COPYRIGHT. |
* Please first read the full copyright statement in file COPYRIGHT. |
* |
* |
*/ |
*/ |
Line 76 static char *ImportantPos = NULL
|
Line 76 static char *ImportantPos = NULL
|
static ThotBool RedisplayBGImage = FALSE; /* TRUE when a BG image is inserted */ |
static ThotBool RedisplayBGImage = FALSE; /* TRUE when a BG image is inserted */ |
static ThotBool DoApply = TRUE; |
static ThotBool DoApply = TRUE; |
static ThotBool All_sides = FALSE; // TRUE when "boder valus must be displayed |
static ThotBool All_sides = FALSE; // TRUE when "boder valus must be displayed |
|
static char CSSbuffer[MAX_CSS_LENGTH + 1]; |
|
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
Line 5183 static char *ParseCSSContent (Element el
|
Line 5184 static char *ParseCSSContent (Element el
|
{ |
{ |
PresentationValue value, pval; |
PresentationValue value, pval; |
char *last, *start, quoteChar, savedChar; |
char *last, *start, quoteChar, savedChar; |
int length, val; |
int length, val, l; |
char *buffer, *p; |
char *buffer, *p; |
char *start_value; |
char *start_value; |
wchar_t wc; |
wchar_t wc; |
Line 5219 static char *ParseCSSContent (Element el
|
Line 5220 static char *ParseCSSContent (Element el
|
{ |
{ |
quoteChar = *cssRule; |
quoteChar = *cssRule; |
/* how long is the string? */ |
/* how long is the string? */ |
last = cssRule; |
last = SkipString (cssRule); |
last = SkipString (last); |
|
length = last - cssRule; |
length = last - cssRule; |
/* get a buffer to store the string */ |
/* get a buffer to store the string */ |
buffer = (char *)TtaGetMemory (3 * length); |
buffer = (char *)TtaGetMemory (3 * length); |
p = buffer; /* beginning of the string */ |
p = buffer; /* beginning of the string */ |
cssRule++; |
cssRule++; |
while (*cssRule != EOS && *cssRule != quoteChar) |
|
|
l = TtaGetNextWCFromString (&wc, (unsigned char **) &cssRule, UTF_8); |
|
while (wc != EOS && wc != quoteChar && l > 0) |
{ |
{ |
done = FALSE; |
done = FALSE; |
if (*cssRule == '\\') |
if (wc == '\\') |
{ |
{ |
cssRule++; /* skip the backslash */ |
cssRule++; /* skip the backslash */ |
if ((*cssRule >= '0' && *cssRule <= '9') || |
if ((*cssRule >= '0' && *cssRule <= '9') || |
Line 5247 static char *ParseCSSContent (Element el
|
Line 5249 static char *ParseCSSContent (Element el
|
sscanf (start, "%x", &val); |
sscanf (start, "%x", &val); |
TtaWCToMBstring ((wchar_t) val, (unsigned char **) &p); |
TtaWCToMBstring ((wchar_t) val, (unsigned char **) &p); |
*cssRule = savedChar; |
*cssRule = savedChar; |
|
wc = savedChar; |
done = TRUE; |
done = TRUE; |
} |
} |
} |
} |
if (!done) |
if (!done) |
{ |
{ |
/* The default encoding of CSS style sheets is ISO-8859-1, |
|
but we should use the real encoding fo the file instead |
|
of this default value @@@@@ */ |
|
wc = TtaGetWCFromChar ((unsigned char) cssRule[0], ISO_8859_1); |
|
TtaWCToMBstring (wc, (unsigned char **) &p); |
TtaWCToMBstring (wc, (unsigned char **) &p); |
cssRule++; |
cssRule+= l; |
|
l = TtaGetNextWCFromString (&wc, (unsigned char **) &cssRule, |
|
UTF_8); |
} |
} |
} |
} |
*p = EOS; |
*p = EOS; |