version 1.194, 2003/03/26 15:35:04
|
version 1.195, 2003/03/28 17:12:32
|
Line 383 char *ParseNumber (char *cssRule, Presen
|
Line 383 char *ParseNumber (char *cssRule, Presen
|
} |
} |
return (cssRule); |
return (cssRule); |
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
ParseClampedUnit: |
ParseClampedUnit: |
parse a CSS Unit substring and returns the corresponding |
parse a CSS Unit substring and returns the corresponding |
Line 391 char *ParseNumber (char *cssRule, Presen
|
Line 392 char *ParseNumber (char *cssRule, Presen
|
or |
or |
[0,100] in % |
[0,100] in % |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
char *ParseClampedUnit (char *text, |
char *ParseClampedUnit (char *text, PresentationValue *pval) |
PresentationValue *pval) |
|
{ |
{ |
float clamped_value; |
float clamped_value; |
int int_clamped_value; |
int int_clamped_value; |
|
|
if (*(text + strlen (text) -1) == '%') |
if (*(text + strlen (text) -1) == '%') |
{ |
{ |
int_clamped_value = atoi (text); |
int_clamped_value = atoi (text); |
if (int_clamped_value < 0 || |
if (int_clamped_value < 0 || int_clamped_value > 100) |
int_clamped_value > 100) |
int_clamped_value = 1000; |
int_clamped_value = 1000; |
|
else |
|
int_clamped_value = int_clamped_value * 10; |
|
} |
|
else |
else |
{ |
int_clamped_value = int_clamped_value * 10; |
clamped_value = (float) atof (text); |
} |
if (clamped_value < 0.0 |
else |
|| clamped_value > 1.0) |
{ |
int_clamped_value = 1000; |
clamped_value = (float) atof (text); |
else |
if (clamped_value < 0.0 || clamped_value > 1.0) |
int_clamped_value = (int) (clamped_value * 1000); |
int_clamped_value = 1000; |
} |
else |
pval->typed_data.unit = UNIT_REL; |
int_clamped_value = (int) (clamped_value * 1000.); |
pval->typed_data.value = int_clamped_value; |
} |
pval->typed_data.real = FALSE; |
pval->typed_data.unit = UNIT_REL; |
pval->data = int_clamped_value; |
pval->typed_data.value = int_clamped_value; |
|
pval->typed_data.real = FALSE; |
|
pval->data = int_clamped_value; |
return (SkipWord (text)); |
return (SkipWord (text)); |
} |
} |
|
|
Line 3864 void PToCss (PresentationSetting setting
|
Line 3862 void PToCss (PresentationSetting setting
|
{ |
{ |
real = TRUE; |
real = TRUE; |
fval = (float) settings->value.typed_data.value; |
fval = (float) settings->value.typed_data.value; |
fval /= 1000; |
fval /= 1000.; |
} |
} |
|
|
switch (settings->type) |
switch (settings->type) |
Line 4244 void PToCss (PresentationSetting setting
|
Line 4242 void PToCss (PresentationSetting setting
|
sprintf (buffer, "color: #%02X%02X%02X", red, green, blue); |
sprintf (buffer, "color: #%02X%02X%02X", red, green, blue); |
break; |
break; |
case PRHyphenate: |
case PRHyphenate: |
break; |
|
case PRVertOverflow: |
case PRVertOverflow: |
break; |
|
case PRHorizOverflow: |
case PRHorizOverflow: |
break; |
break; |
|
case PROpacity: |
|
sprintf (buffer, "opacity: %g", fval); |
|
break; |
|
case PRStrokeOpacity: |
|
sprintf (buffer, "stroke-opacity: %g", fval); |
|
break; |
|
case PRFillOpacity: |
|
sprintf (buffer, "fill-opacity: %g", fval); |
|
break; |
case PRBackgroundPicture: |
case PRBackgroundPicture: |
if (settings->value.pointer != NULL) |
if (settings->value.pointer != NULL) |
sprintf (buffer, "background-image: url(%s)", |
sprintf (buffer, "background-image: url(%s)", |