Commit ce00e0e5 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

re-enable the use of sheet_style_get_extent.


2000-08-16  Jody Goldberg <jgoldberg@home.com>

	* src/sheet.c (sheet_get_extent) : re-enable the use of
	  sheet_style_get_extent.

	* src/sheet-style.c (sheet_style_get_extent) : rework to use
	  'visible in blank cell' rather than non-infinite.

	* src/mstyle.c (mstyle_visible_in_blank) : new function.
	* src/border.c (style_border_visible_in_blank) : new function.

	* src/xml-io.c (xml_write_style) : Save font info even if it only
	  specifies underline or strikethrough.
parent 5545f74b
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_get_extent) : re-enable the use of
sheet_style_get_extent.
* src/sheet-style.c (sheet_style_get_extent) : rework to use
'visible in blank cell' rather than non-infinite.
* src/mstyle.c (mstyle_visible_in_blank) : new function.
* src/border.c (style_border_visible_in_blank) : new function.
* src/xml-io.c (xml_write_style) : Save font info even if it only
specifies underline or strikethrough.
2000-08-15 Morten Welinder <terra@diku.dk>
* src/gutils.c (gnumeric_get_le_int16, gnumeric_get_le_uint16,
......
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_get_extent) : re-enable the use of
sheet_style_get_extent.
* src/sheet-style.c (sheet_style_get_extent) : rework to use
'visible in blank cell' rather than non-infinite.
* src/mstyle.c (mstyle_visible_in_blank) : new function.
* src/border.c (style_border_visible_in_blank) : new function.
* src/xml-io.c (xml_write_style) : Save font info even if it only
specifies underline or strikethrough.
2000-08-15 Morten Welinder <terra@diku.dk>
* src/gutils.c (gnumeric_get_le_int16, gnumeric_get_le_uint16,
......
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_get_extent) : re-enable the use of
sheet_style_get_extent.
* src/sheet-style.c (sheet_style_get_extent) : rework to use
'visible in blank cell' rather than non-infinite.
* src/mstyle.c (mstyle_visible_in_blank) : new function.
* src/border.c (style_border_visible_in_blank) : new function.
* src/xml-io.c (xml_write_style) : Save font info even if it only
specifies underline or strikethrough.
2000-08-15 Morten Welinder <terra@diku.dk>
* src/gutils.c (gnumeric_get_le_int16, gnumeric_get_le_uint16,
......
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_get_extent) : re-enable the use of
sheet_style_get_extent.
* src/sheet-style.c (sheet_style_get_extent) : rework to use
'visible in blank cell' rather than non-infinite.
* src/mstyle.c (mstyle_visible_in_blank) : new function.
* src/border.c (style_border_visible_in_blank) : new function.
* src/xml-io.c (xml_write_style) : Save font info even if it only
specifies underline or strikethrough.
2000-08-15 Morten Welinder <terra@diku.dk>
* src/gutils.c (gnumeric_get_le_int16, gnumeric_get_le_uint16,
......
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_get_extent) : re-enable the use of
sheet_style_get_extent.
* src/sheet-style.c (sheet_style_get_extent) : rework to use
'visible in blank cell' rather than non-infinite.
* src/mstyle.c (mstyle_visible_in_blank) : new function.
* src/border.c (style_border_visible_in_blank) : new function.
* src/xml-io.c (xml_write_style) : Save font info even if it only
specifies underline or strikethrough.
2000-08-15 Morten Welinder <terra@diku.dk>
* src/gutils.c (gnumeric_get_le_int16, gnumeric_get_le_uint16,
......
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_get_extent) : re-enable the use of
sheet_style_get_extent.
* src/sheet-style.c (sheet_style_get_extent) : rework to use
'visible in blank cell' rather than non-infinite.
* src/mstyle.c (mstyle_visible_in_blank) : new function.
* src/border.c (style_border_visible_in_blank) : new function.
* src/xml-io.c (xml_write_style) : Save font info even if it only
specifies underline or strikethrough.
2000-08-15 Morten Welinder <terra@diku.dk>
* src/gutils.c (gnumeric_get_le_int16, gnumeric_get_le_uint16,
......
2000-08-16 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_get_extent) : re-enable the use of
sheet_style_get_extent.
* src/sheet-style.c (sheet_style_get_extent) : rework to use
'visible in blank cell' rather than non-infinite.
* src/mstyle.c (mstyle_visible_in_blank) : new function.
* src/border.c (style_border_visible_in_blank) : new function.
* src/xml-io.c (xml_write_style) : Save font info even if it only
specifies underline or strikethrough.
2000-08-15 Morten Welinder <terra@diku.dk>
* src/gutils.c (gnumeric_get_le_int16, gnumeric_get_le_uint16,
......
......@@ -159,6 +159,14 @@ style_border_fetch (StyleBorderType const line_type,
return border;
}
gboolean
style_border_visible_in_blank (MStyleBorder const *border)
{
g_return_val_if_fail (border != NULL, FALSE);
return border->line_type != STYLE_BORDER_NONE;
}
gint
style_border_get_width (StyleBorderType const line_type)
{
......
......@@ -49,6 +49,7 @@ MStyleBorder *style_border_none (void);
MStyleBorder *style_border_fetch (StyleBorderType const line_type,
StyleColor *color,
StyleBorderOrientation orientation);
gboolean style_border_visible_in_blank (MStyleBorder const *border);
StyleBorderOrientation style_border_get_orientation (MStyleElementType type);
......
......@@ -1138,3 +1138,20 @@ mstyle_get_fit_in_cell (const MStyle *style)
return style->elements [MSTYLE_FIT_IN_CELL].u.fit_in_cell;
}
gboolean
mstyle_visible_in_blank (const MStyle *st)
{
MStyleElementType i;
if (mstyle_is_element_set (st, MSTYLE_PATTERN) &&
mstyle_get_pattern (st) > 0)
return TRUE;
for (i = MSTYLE_BORDER_TOP ; i <= MSTYLE_BORDER_REV_DIAGONAL ; ++i)
if (mstyle_is_element_set (st, i) &&
style_border_visible_in_blank (mstyle_get_border (st, i)))
return TRUE;
return FALSE;
}
......@@ -101,6 +101,8 @@ StyleOrientation mstyle_get_orientation (const MStyle *st);
void mstyle_set_fit_in_cell (MStyle *st, gboolean f);
gboolean mstyle_get_fit_in_cell (const MStyle *st);
gboolean mstyle_visible_in_blank(const MStyle *st);
MStyle *mstyle_merge (MStyle *master, MStyle *slave);
char *mstyle_to_string (const MStyle *st); /* Debug only ! leaks like a sieve */
void mstyle_dump (const MStyle *st);
......
......@@ -1830,23 +1830,22 @@ sheet_selection_get_unique_style (Sheet *sheet, MStyleBorder **borders)
/**
* sheet_style_get_extent:
* @r: input / output range
* @sheet: for this sheet.
* @sheet: the sheet whose styles are being examined.
*
* This enlarges r by a union with each non infinite style
* range.
**/
* The union of @r and all stylesregions that are visible in blank cells.
*/
void
sheet_style_get_extent (Range *r, const Sheet *sheet)
{
GList *l;
SheetStyleData *sd;
sd = sheet->style_data;
SheetStyleData const *sd = sheet->style_data;
GList *l;
Range res = *r;
for (l = sd->style_list; l && l->next; l = g_list_next (l)) {
Range *sr = (Range *)l->data;
for (l = sd->style_list; l != NULL ; l = g_list_next (l)) {
StyleRegion const *sr = (StyleRegion const *)l->data;
if (!range_is_infinite (sr))
*r = range_union (r, sr);
if (mstyle_visible_in_blank (sr->style))
res = range_union (&res, &sr->range);
}
*r = res;
}
......@@ -880,16 +880,8 @@ sheet_get_extent (Sheet const *sheet)
if (r.end.row < 0)
r.end.row = 0;
#if 0
/*
* Disable until this is more intelligent.
* if a style is applied to rows 0->10 the default
* style gets split and a style that ranges from 11->MAX
* This screws printing and several of the export
* routines.
*/
/* Extend region to include styles that are visible in blank cells */
sheet_style_get_extent (&r, sheet);
#endif
/*
* Print can't handle stuff outside these walls.
......
......@@ -159,6 +159,14 @@ style_border_fetch (StyleBorderType const line_type,
return border;
}
gboolean
style_border_visible_in_blank (MStyleBorder const *border)
{
g_return_val_if_fail (border != NULL, FALSE);
return border->line_type != STYLE_BORDER_NONE;
}
gint
style_border_get_width (StyleBorderType const line_type)
{
......
......@@ -49,6 +49,7 @@ MStyleBorder *style_border_none (void);
MStyleBorder *style_border_fetch (StyleBorderType const line_type,
StyleColor *color,
StyleBorderOrientation orientation);
gboolean style_border_visible_in_blank (MStyleBorder const *border);
StyleBorderOrientation style_border_get_orientation (MStyleElementType type);
......
......@@ -885,9 +885,11 @@ xml_write_style (XmlParseContext *ctxt,
xml_set_value (cur, "Format", mstyle_get_format (style)->format);
if (mstyle_is_element_set (style, MSTYLE_FONT_NAME) ||
mstyle_is_element_set (style, MSTYLE_FONT_SIZE) ||
mstyle_is_element_set (style, MSTYLE_FONT_BOLD) ||
mstyle_is_element_set (style, MSTYLE_FONT_ITALIC) ||
mstyle_is_element_set (style, MSTYLE_FONT_SIZE)) {
mstyle_is_element_set (style, MSTYLE_FONT_UNDERLINE) ||
mstyle_is_element_set (style, MSTYLE_FONT_STRIKETHROUGH)) {
const char *fontname;
if (mstyle_is_element_set (style, MSTYLE_FONT_NAME))
......
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