Commit 34d9ed4b authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

off by one error. Ditto. (xml_read_style_border) : ditto.


2001-02-15  Jody Goldberg <jgoldberg@home.com>

	* src/mstyle.c (mstyle_visible_in_blank) : off by one error.
	* src/xml-io.c (xml_write_style_border) : Ditto.
	(xml_read_style_border) : ditto.

	* src/rendered-value.c (rendered_value_calc_size_ext) : calculate the
	  indent offsets.
parent 28a4fc20
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/mstyle.c (mstyle_visible_in_blank) : off by one error.
* src/xml-io.c (xml_write_style_border) : Ditto.
(xml_read_style_border) : ditto.
* src/rendered-value.c (rendered_value_calc_size_ext) : calculate the
indent offsets.
* src/sheet-merge.c (sheet_merge_add) : redraw the entire region.
2001-02-14 Jody Goldberg <jgoldberg@home.com>
......
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/mstyle.c (mstyle_visible_in_blank) : off by one error.
* src/xml-io.c (xml_write_style_border) : Ditto.
(xml_read_style_border) : ditto.
* src/rendered-value.c (rendered_value_calc_size_ext) : calculate the
indent offsets.
* src/sheet-merge.c (sheet_merge_add) : redraw the entire region.
2001-02-14 Jody Goldberg <jgoldberg@home.com>
......
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/mstyle.c (mstyle_visible_in_blank) : off by one error.
* src/xml-io.c (xml_write_style_border) : Ditto.
(xml_read_style_border) : ditto.
* src/rendered-value.c (rendered_value_calc_size_ext) : calculate the
indent offsets.
* src/sheet-merge.c (sheet_merge_add) : redraw the entire region.
2001-02-14 Jody Goldberg <jgoldberg@home.com>
......
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/mstyle.c (mstyle_visible_in_blank) : off by one error.
* src/xml-io.c (xml_write_style_border) : Ditto.
(xml_read_style_border) : ditto.
* src/rendered-value.c (rendered_value_calc_size_ext) : calculate the
indent offsets.
* src/sheet-merge.c (sheet_merge_add) : redraw the entire region.
2001-02-14 Jody Goldberg <jgoldberg@home.com>
......
2001-02-15 Jody Goldberg <jgoldberg@home.com>
* src/mstyle.c (mstyle_visible_in_blank) : off by one error.
* src/xml-io.c (xml_write_style_border) : Ditto.
(xml_read_style_border) : ditto.
* src/rendered-value.c (rendered_value_calc_size_ext) : calculate the
indent offsets.
* src/sheet-merge.c (sheet_merge_add) : redraw the entire region.
2001-02-14 Jody Goldberg <jgoldberg@home.com>
......
......@@ -1174,7 +1174,7 @@ mstyle_visible_in_blank (const MStyle *st)
mstyle_get_pattern (st) > 0)
return TRUE;
for (i = MSTYLE_BORDER_TOP ; i <= MSTYLE_BORDER_REV_DIAGONAL ; ++i)
for (i = MSTYLE_BORDER_TOP ; i <= MSTYLE_BORDER_DIAGONAL ; ++i)
if (mstyle_is_element_set (st, i) &&
style_border_visible_in_blank (mstyle_get_border (st, i)))
return TRUE;
......
......@@ -35,6 +35,8 @@
#include "sheet-control-gui.h"
#include "application.h"
#include <math.h>
/**
* rendered_value_new:
* @cell: The cell
......@@ -111,7 +113,7 @@ rendered_value_new (Cell *cell, MStyle const *mstyle, gboolean dynamic_width)
res = g_new (RenderedValue, 1);
res->rendered_text = string_get (str);
res->render_color = color;
res->width_pixel = res->height_pixel = 0;
res->width_pixel = res->height_pixel = res->offset = 0;
res->dynamic_width = dynamic_width;
g_free (str);
......@@ -169,6 +171,7 @@ rendered_value_calc_size_ext (Cell const *cell, MStyle *mstyle)
GdkFont *gdk_font = style_font_gdk_font (style_font);
int font_height = style_font_get_height (style_font);
int const cell_w = COL_INTERNAL_WIDTH (cell->col_info);
StyleHAlignFlags const halign = mstyle_get_align_h (mstyle);
int text_width;
char *text;
......@@ -183,7 +186,7 @@ rendered_value_calc_size_ext (Cell const *cell, MStyle *mstyle)
sheet != NULL && !sheet->display_formulas)) {
rv->width_pixel = text_width;
rv->height_pixel = font_height;
} else if (mstyle_get_align_h (mstyle) == HALIGN_JUSTIFY ||
} else if (halign == HALIGN_JUSTIFY ||
mstyle_get_align_v (mstyle) == VALIGN_JUSTIFY ||
mstyle_get_fit_in_cell (mstyle)) {
char const *p, *line_begin;
......@@ -246,6 +249,10 @@ rendered_value_calc_size_ext (Cell const *cell, MStyle *mstyle)
rv->width_pixel = text_width;
rv->height_pixel = font_height;
}
if (halign == HALIGN_LEFT || halign == HALIGN_RIGHT)
rv->offset = rint (mstyle_get_indent (mstyle) *
style_font->approx_width);
style_font_unref (style_font);
}
......
......@@ -24,7 +24,7 @@ struct _RenderedValue {
* Computed sizes of rendered text.
* In pixels EXCLUSIVE of margins and grid lines
*/
short width_pixel, height_pixel;
short width_pixel, height_pixel, offset;
gboolean dynamic_width;
};
......
......@@ -658,19 +658,19 @@ xml_write_style_border (XmlParseContext *ctxt,
xmlNodePtr side;
int i;
for (i = MSTYLE_BORDER_TOP; i <= MSTYLE_BORDER_REV_DIAGONAL; i++) {
for (i = MSTYLE_BORDER_TOP; i <= MSTYLE_BORDER_DIAGONAL; i++) {
StyleBorder const *border;
if (mstyle_is_element_set (style, i) &&
NULL != (border = mstyle_get_border (style, i))) {
break;
}
}
if (i > MSTYLE_BORDER_REV_DIAGONAL)
if (i > MSTYLE_BORDER_DIAGONAL)
return NULL;
cur = xmlNewDocNode (ctxt->doc, ctxt->ns, "StyleBorder", NULL);
for (i = MSTYLE_BORDER_TOP; i <= MSTYLE_BORDER_REV_DIAGONAL; i++) {
for (i = MSTYLE_BORDER_TOP; i <= MSTYLE_BORDER_DIAGONAL; i++) {
StyleBorder const *border;
if (mstyle_is_element_set (style, i) &&
NULL != (border = mstyle_get_border (style, i))) {
......@@ -702,7 +702,7 @@ xml_read_style_border (XmlParseContext *ctxt, xmlNodePtr tree, MStyle *mstyle)
tree->name);
}
for (i = MSTYLE_BORDER_TOP; i <= MSTYLE_BORDER_REV_DIAGONAL; i++) {
for (i = MSTYLE_BORDER_TOP; i <= MSTYLE_BORDER_DIAGONAL; i++) {
if ((side = e_xml_get_child_by_name (tree,
StyleSideNames [i - MSTYLE_BORDER_TOP])) != NULL) {
int t;
......
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