Commit 4f9a547f authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow
Browse files

http://bugzilla.gnome.org/show_bug.cgi?id=84396 be more careful

2002-06-25  Andreas J. Guelzow <aguelzow@taliesin.ca>

	http://bugzilla.gnome.org/show_bug.cgi?id=84396
	* html.c (html_get_text_color) : be more careful
	(write_cell) : write the background colour if and only if the cell has a
	  background pattern
	* latex.c (latex2e_write_multicolumn_cell) : be more casreful with font colours.
parent 7a75db78
......@@ -7,7 +7,7 @@ Andreas:
even if the user did not want it cleared.
* Create ui to set protection of indiviual sheets.
* Make various edit actions check for locks first.
* Fix 85383.
* Fix 85383, 84396.
Jody:
* Have the stf dialog use the default font.
......
2002-06-25 Andreas J. Guelzow <aguelzow@taliesin.ca>
http://bugzilla.gnome.org/show_bug.cgi?id=84396
* html.c (html_get_text_color) : be more careful
(write_cell) : write the background colour if and only if the cell has a
background pattern
* latex.c (latex2e_write_multicolumn_cell) : be more casreful with font colours.
2002-06-13 Andreas J. Guelzow <aguelzow@taliesin.ca>
* html_read.c (html_read_content) : also save src prop of <img>
......
......@@ -124,12 +124,15 @@ html_get_text_color (Cell *cell, MStyle *mstyle, guint *r, guint *g, guint *b)
StyleColor *textColor;
textColor = cell_get_render_color (cell);
if (textColor == NULL)
if (textColor == NULL && mstyle_is_element_set (mstyle, MSTYLE_COLOR_FORE))
textColor = mstyle_get_color (mstyle, MSTYLE_COLOR_FORE);
*r = textColor->color.red >> 8;
*g = textColor->color.green >> 8;
*b = textColor->color.blue >> 8;
if (textColor == NULL)
*r = *g = *b = 0;
else {
*r = textColor->color.red >> 8;
*g = textColor->color.green >> 8;
*b = textColor->color.blue >> 8;
}
}
static void
html_get_color (MStyle *mstyle, MStyleElementType t, guint *r, guint *g, guint *b)
......@@ -322,11 +325,11 @@ write_cell (FILE *fp, Sheet *sheet, gint row, gint col, html_version_t version)
guint r, g, b;
mstyle = sheet_style_get (sheet, col, row);
if (mstyle != NULL && version != HTML32 && version != HTML40) {
if (mstyle != NULL && version != HTML32 && version != HTML40 &&
mstyle_get_pattern (mstyle) != 0 &&
mstyle_is_element_set (mstyle, MSTYLE_COLOR_BACK)) {
html_get_color (mstyle, MSTYLE_COLOR_BACK, &r, &g, &b);
if (r < 255 || g < 255 || b < 255) {
fprintf (fp, " bgcolor=\"#%02X%02X%02X\"", r, g, b);
}
fprintf (fp, " bgcolor=\"#%02X%02X%02X\"", r, g, b);
}
cell = sheet_cell_get (sheet, col, row);
......@@ -370,8 +373,9 @@ write_cell (FILE *fp, Sheet *sheet, gint row, gint col, html_version_t version)
if (version == HTML40) {
if (mstyle != NULL) {
fprintf (fp, " style=\"");
html_get_color (mstyle, MSTYLE_COLOR_BACK, &r, &g, &b);
if (r < 255 || g < 255 || b < 255) {
if (mstyle_get_pattern (mstyle) != 0 &&
mstyle_is_element_set (mstyle, MSTYLE_COLOR_BACK)) {
html_get_color (mstyle, MSTYLE_COLOR_BACK, &r, &g, &b);
fprintf (fp, "background:#%02X%02X%02X;", r, g, b);
}
if (cell != NULL) {
......
......@@ -630,11 +630,15 @@ latex2e_write_multicolumn_cell (FILE *fp, Cell const *cell, int num_merged_cols,
if (!cell_is_blank (cell)) {
/* Check the foreground (text) colour. */
textColor = cell_get_render_color (cell);
if (textColor == NULL)
if (textColor == NULL && mstyle_is_element_set (mstyle, MSTYLE_COLOR_FORE))
textColor = mstyle_get_color (mstyle, MSTYLE_COLOR_FORE);
r = textColor->red;
g = textColor->green;
b = textColor->blue;
if (textColor == NULL)
r = g = b = 0;
else {
r = textColor->red;
g = textColor->green;
b = textColor->blue;
}
if (r != 0 || g != 0 || b != 0)
fprintf (fp, "{\\color[rgb]{%.2f,%.2f,%.2f} ",
(double)r/65535, (double)g/65535, (double)b/65535);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment