Commit 352a76dc authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Fix Chema's style bug.

2000-05-18  Jody Goldberg <jgoldberg@home.com>

	* src/sheet-style.c (sheet_style_optimize) : We can not merge (in any
	  dimension) if there is an intervening style that partially overlaps.

	* src/ranges.c (range_adjacent) : Tweak to increase readability,
	  and delete dead code.
parent 9d426142
......@@ -5,7 +5,6 @@ and longer term bugs.
Release Critical
----------------
- FALSE is written in a locale specific format. Apparently so are number formats.
- Chema's style bug
Long term breakage
------------------
......
2000-05-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_optimize) : We can not merge (in any
dimension) if there is an intervening style that partially overlaps.
* src/ranges.c (range_adjacent) : Tweak to increase readability,
and delete dead code.
* src/sheet-object.c (sheet_button_press) : Minor patch so that
objects begin with a non zero size. This needs to be reworked into
a more general technique so that a 0 sized object is not possible in
......
2000-05-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_optimize) : We can not merge (in any
dimension) if there is an intervening style that partially overlaps.
* src/ranges.c (range_adjacent) : Tweak to increase readability,
and delete dead code.
* src/sheet-object.c (sheet_button_press) : Minor patch so that
objects begin with a non zero size. This needs to be reworked into
a more general technique so that a 0 sized object is not possible in
......
2000-05-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_optimize) : We can not merge (in any
dimension) if there is an intervening style that partially overlaps.
* src/ranges.c (range_adjacent) : Tweak to increase readability,
and delete dead code.
* src/sheet-object.c (sheet_button_press) : Minor patch so that
objects begin with a non zero size. This needs to be reworked into
a more general technique so that a 0 sized object is not possible in
......
2000-05-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_optimize) : We can not merge (in any
dimension) if there is an intervening style that partially overlaps.
* src/ranges.c (range_adjacent) : Tweak to increase readability,
and delete dead code.
* src/sheet-object.c (sheet_button_press) : Minor patch so that
objects begin with a non zero size. This needs to be reworked into
a more general technique so that a 0 sized object is not possible in
......
2000-05-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_optimize) : We can not merge (in any
dimension) if there is an intervening style that partially overlaps.
* src/ranges.c (range_adjacent) : Tweak to increase readability,
and delete dead code.
* src/sheet-object.c (sheet_button_press) : Minor patch so that
objects begin with a non zero size. This needs to be reworked into
a more general technique so that a 0 sized object is not possible in
......
2000-05-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_optimize) : We can not merge (in any
dimension) if there is an intervening style that partially overlaps.
* src/ranges.c (range_adjacent) : Tweak to increase readability,
and delete dead code.
* src/sheet-object.c (sheet_button_press) : Minor patch so that
objects begin with a non zero size. This needs to be reworked into
a more general technique so that a 0 sized object is not possible in
......
2000-05-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet-style.c (sheet_style_optimize) : We can not merge (in any
dimension) if there is an intervening style that partially overlaps.
* src/ranges.c (range_adjacent) : Tweak to increase readability,
and delete dead code.
* src/sheet-object.c (sheet_button_press) : Minor patch so that
objects begin with a non zero size. This needs to be reworked into
a more general technique so that a 0 sized object is not possible in
......
......@@ -293,31 +293,19 @@ range_list_foreach_area (Sheet *sheet, GSList *ranges,
gboolean
range_adjacent (Range const *a, Range const *b)
{
int adx, bdx, ady, bdy;
g_return_val_if_fail (a != NULL, FALSE);
g_return_val_if_fail (b != NULL, FALSE);
adx = a->end.col - a->start.col;
bdx = b->end.col - b->start.col;
ady = a->end.row - a->start.row;
bdy = b->end.row - b->start.row;
if ((a->start.col == b->start.col) &&
(a->end.col == b->end.col)) {
if (a->end.row + 1 == b->start.row ||
b->end.row + 1 == a->start.row)
return TRUE;
else
return FALSE;
} else if ((a->start.row == b->start.row) &&
(a->end.row == b->end.row)) {
if (a->end.col + 1 == b->start.col ||
b->end.col + 1 == a->start.col)
return TRUE;
else
return FALSE;
}
(a->end.col == b->end.col))
return (a->end.row + 1 == b->start.row ||
b->end.row + 1 == a->start.row);
if ((a->start.row == b->start.row) &&
(a->end.row == b->end.row))
return (a->end.col + 1 == b->start.col ||
b->end.col + 1 == a->start.col);
return FALSE;
}
......
......@@ -407,7 +407,8 @@ sheet_style_optimize (Sheet *sheet, Range range)
slave->style = mstyle_merge (master->style, slave->style);
if (mstyle_empty (slave->style))
sheet_style_region_unlink (sd, slave);
}
} else if (range_overlap(&sra->range, &srb->range))
break;
}
}
......@@ -439,6 +440,15 @@ sheet_style_optimize (Sheet *sheet, Range range)
printf ("\n");
}
/*
* As soon as there is a range that overlaps
* the original we need to be more careful.
* If we later find a range that is adjacent
* we will break the ordering when we merge.
*/
if (range_overlap(&sra->range, &srb->range))
break;
if (range_adjacent (&sra->range, &srb->range)) {
if (mstyle_equal ( sra->style, srb->style)) {
StyleRegion *master, *slave;
......
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