Commit 7ae12725 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

dump in some old patches

2005-08-21  Jody Goldberg <jody@gnome.org>

	* src/workbook.c (workbook_sheet_attach_at_pos) : don't signal until
	  after the controls have been added. [#314208]

2005-08-21  Jody Goldberg <jody@gnome.org>

	* src/mstyle.c (gnm_style_equal) : MSTYLE_COLOR_BACK == 0 now, there
	  is no longer an invalid entry at 0 with back at 1.
	(gnm_style_equal_XL) : ditto.

	* src/sheet-style.c (cb_style_list_add_node) : improve the debugging.
parent 037edf17
......@@ -11,6 +11,19 @@
* src/dependent.c (dep_hash_destroy): Another case of
don't-muck-with-the-hash-you-are-iterating-over.
2005-08-21 Jody Goldberg <jody@gnome.org>
* src/workbook.c (workbook_sheet_attach_at_pos) : don't signal until
after the controls have been added. [#314208]
2005-08-21 Jody Goldberg <jody@gnome.org>
* src/mstyle.c (gnm_style_equal) : MSTYLE_COLOR_BACK == 0 now, there
is no longer an invalid entry at 0 with back at 1.
(gnm_style_equal_XL) : ditto.
* src/sheet-style.c (cb_style_list_add_node) : improve the debugging.
2005-08-18 Emmanuel Pacaud <emmanuel.pacaud@univ-poitiers.fr>
* src/commands.c (cmd_object_raise_redo): pull_to_front and
......
......@@ -3,6 +3,10 @@ Gnumeric 1.5.4
Jean Brefort:
* Fix crash on close related to graph plugins. [#313463]
Jody:
* Fix lost background colours. [#314207 and others]
* Add some drag handles for graphicly creating frozen panes.
Morten:
* Fix harmless, but ugly, error message on xls save.
* Fix solver crash. [#314025]
......
......@@ -11,6 +11,19 @@
* src/dependent.c (dep_hash_destroy): Another case of
don't-muck-with-the-hash-you-are-iterating-over.
2005-08-21 Jody Goldberg <jody@gnome.org>
* src/workbook.c (workbook_sheet_attach_at_pos) : don't signal until
after the controls have been added. [#314208]
2005-08-21 Jody Goldberg <jody@gnome.org>
* src/mstyle.c (gnm_style_equal) : MSTYLE_COLOR_BACK == 0 now, there
is no longer an invalid entry at 0 with back at 1.
(gnm_style_equal_XL) : ditto.
* src/sheet-style.c (cb_style_list_add_node) : improve the debugging.
2005-08-18 Emmanuel Pacaud <emmanuel.pacaud@univ-poitiers.fr>
* src/commands.c (cmd_object_raise_redo): pull_to_front and
......
2005-08-24 Jody Goldberg <jody@gnome.org>
* ms-excel-write.c (excel_font_new) : typo. [#314206]
2005-08-17 Jean Brefort <jean.brefort@normalesup.org>
* ms-chart.c: (ms_excel_chart_write): fix a compilation warning
......
......@@ -1442,24 +1442,24 @@ excel_palette_get (GnmXLImporter *importer, gint idx)
g_return_val_if_fail (importer != NULL, style_color_black ());
if (NULL == (pal = importer->palette)) {
int entries = EXCEL_DEF_PAL_LEN;
ExcelPaletteEntry const *defaults = (importer->ver >= MS_BIFF_V8)
? excel_default_palette_v8 : excel_default_palette_v7;
pal = importer->palette = g_new (ExcelPalette, 1);
pal->length = entries;
pal->red = g_new (int, entries);
pal->green = g_new (int, entries);
pal->blue = g_new (int, entries);
pal->gnm_colors = g_new (GnmColor *, entries);
while (--entries >= 0) {
pal->red[entries] = defaults[entries].r;
pal->green[entries] = defaults[entries].g;
pal->blue[entries] = defaults[entries].b;
pal->gnm_colors[entries] = NULL;
int entries = EXCEL_DEF_PAL_LEN;
ExcelPaletteEntry const *defaults = (importer->ver >= MS_BIFF_V8)
? excel_default_palette_v8 : excel_default_palette_v7;
pal = importer->palette = g_new (ExcelPalette, 1);
pal->length = entries;
pal->red = g_new (int, entries);
pal->green = g_new (int, entries);
pal->blue = g_new (int, entries);
pal->gnm_colors = g_new (GnmColor *, entries);
while (--entries >= 0) {
pal->red[entries] = defaults[entries].r;
pal->green[entries] = defaults[entries].g;
pal->blue[entries] = defaults[entries].b;
pal->gnm_colors[entries] = NULL;
}
}
}
/* NOTE: not documented but seems close
* If you find a normative reference please forward it.
......@@ -1516,7 +1516,7 @@ excel_palette_get (GnmXLImporter *importer, gint idx)
(guint8) pal->blue[idx]);
g_return_val_if_fail (pal->gnm_colors[idx],
style_color_black ());
d (1, {
d (5, {
GnmColor *c = pal->gnm_colors[idx];
fprintf (stderr,"New color in slot %d: RGB= %x,%x,%x\n",
idx, c->gdk_color.red, c->gdk_color.green, c->gdk_color.blue);
......@@ -1734,8 +1734,7 @@ excel_get_style_from_xf (ExcelReadSheet *esheet, BiffXFData const *xf)
switch (back_index) {
case 64:
back_color = sheet_style_get_auto_pattern_color
(esheet->sheet);
back_color = sheet_style_get_auto_pattern_color (esheet->sheet);
break;
case 65:
back_color = style_color_auto_back ();
......@@ -1819,8 +1818,8 @@ excel_set_xf (ExcelReadSheet *esheet, BiffQuery *q)
BiffXFData const *xf = excel_get_xf (esheet, GSF_LE_GET_GUINT16 (q->data + 4));
GnmStyle *mstyle = excel_get_style_from_xf (esheet, xf);
d (2, fprintf (stderr,"%s!%s%d = xf(0x%p)\n", esheet->sheet->name_unquoted,
col_name (col), row + 1, xf););
d (3, fprintf (stderr,"%s!%s%d = xf(0x%hx) = style (%p) [LEN = %u]\n", esheet->sheet->name_unquoted,
col_name (col), row + 1, GSF_LE_GET_GUINT16 (q->data + 4), mstyle, q->length););
if (mstyle != NULL)
sheet_style_set_pos (esheet->sheet, col, row, mstyle);
......
......@@ -1686,7 +1686,7 @@ excel_font_new (GnmStyle const *base_style)
efont->font_name_copy = NULL;
efont->size_pts = gnm_style_get_font_size (base_style);
efont->is_bold = gnm_style_get_font_bold (base_style);
efont->is_italic = gnm_style_get_font_uline (base_style);
efont->is_italic = gnm_style_get_font_italic (base_style);
efont->underline = gnm_style_get_font_uline (base_style);
efont->strikethrough = gnm_style_get_font_strike (base_style);
......
......@@ -144,6 +144,7 @@ src/gnm-plugin.c
src/gnm-plugin.h
src/gnm-so-filled.c
src/gnm-so-line.c
src/gnm-so-polygon.c
src/gnumeric-canvas.c
src/gnumeric-pane.c
src/gui-clipboard.c
......
......@@ -260,6 +260,7 @@ src/gnm-plugin.c
src/gnm-plugin.h
src/gnm-so-filled.c
src/gnm-so-line.c
src/gnm-so-polygon.c
src/GNOME_Gnumeric-gtk.xml.in
src/gnumeric-canvas.c
src/gnumeric-pane.c
......
......@@ -701,7 +701,7 @@ gnm_style_equal (GnmStyle const *a, GnmStyle const *b)
if (a == b)
return TRUE;
for (i = 1; i < MSTYLE_ELEMENT_MAX; i++)
for (i = MSTYLE_COLOR_BACK; i < MSTYLE_ELEMENT_MAX; i++)
if (!elem_is_eq (a, b, i))
return FALSE;
return TRUE;
......@@ -717,7 +717,7 @@ gnm_style_equal_XL (GnmStyle const *a, GnmStyle const *b)
if (a == b)
return TRUE;
for (i = 1; i < MSTYLE_VALIDATION; i++)
for (i = MSTYLE_COLOR_BACK; i < MSTYLE_VALIDATION; i++)
if (!elem_is_eq (a, b, i))
return FALSE;
return TRUE;
......
......@@ -1065,7 +1065,6 @@ sheet_style_set_range (Sheet *sheet, GnmRange const *range,
/**
* sheet_style_set_pos :
*
* @sheet :
* @col :
* @row :
......@@ -1073,7 +1072,7 @@ sheet_style_set_range (Sheet *sheet, GnmRange const *range,
*
* Change the complete style for a single cell.
* This function absorbs a reference to the the new @style.
*/
**/
void
sheet_style_set_pos (Sheet *sheet, int col, int row,
GnmStyle *style)
......@@ -1093,7 +1092,7 @@ sheet_style_set_pos (Sheet *sheet, int col, int row,
* @sheet :
*
* Returns a reference to default style for a sheet.
*/
**/
GnmStyle *
sheet_style_default (Sheet const *sheet)
{
......@@ -1922,20 +1921,27 @@ cb_style_list_add_node (GnmStyle *style,
range.end.row = apply_to->end.row;
range.end.row -= apply_to->start.row;
}
#ifdef DEBUG_STYLE_LIST
range_dump (&range, " <= Add node \n");
#endif
/* Do some simple minded merging vertically */
key.col = range.end.col;
key.row = range.start.row - 1;
#ifdef DEBUG_STYLE_LIST
range_dump (&range, " Checking\n");
#endif
if (key.row >= 0 &&
(sr = (GnmStyleRegion *)g_hash_table_lookup (mi->cache, &key)) != NULL &&
sr->range.start.col == range.start.col && (mi->style_equal) (sr->style, style)) {
g_hash_table_remove (mi->cache, &key);
sr->range.end.row = range.end.row;
} else
#ifdef DEBUG_STYLE_LIST
range_dump (&sr->range, " <= merged into\n");
#endif
} else {
#ifdef DEBUG_STYLE_LIST
range_dump (&range, " <= Added\n");
#endif
sr = style_region_new (&range, style);
}
g_hash_table_insert (mi->cache, &sr->range.end, sr);
}
......
......@@ -902,12 +902,6 @@ disconnect_sheet_signals (WorkbookControlGUI *wbcg, Sheet *sheet)
g_signal_handlers_disconnect_by_func (sheet, cb_zoom_change, wbcg);
}
/**
* wbcg_sheet_add:
* @sheet: a sheet
*
* Creates a new SheetControlGUI for the sheet and adds it to the workbook-control-gui.
*/
static void
wbcg_sheet_add (WorkbookControl *wbc, SheetView *sv)
{
......@@ -1047,7 +1041,7 @@ wbcg_sheet_order_changed (WorkbookControlGUI *wbcg, Workbook const *wb)
for (i = 0 ; i < workbook_sheet_count (wb); i++)
if (NULL != (sheet = wbcg_page_index_to_sheet (wbcg, i, &scg)) &&
sheet->index_in_wb != i)
gtk_notebook_reorder_child (wbcg->notebook,
gtk_notebook_reorder_child (wbcg->notebook,
GTK_WIDGET (scg->table), sheet->index_in_wb);
}
......
......@@ -978,8 +978,6 @@ workbook_sheet_attach_at_pos (Workbook *wb, Sheet *new_sheet, int pos)
new_sheet->name_case_insensitive,
new_sheet);
post_sheet_index_change (wb);
WORKBOOK_FOREACH_VIEW (wb, view,
wb_view_sheet_add (view, new_sheet););
......@@ -987,6 +985,9 @@ workbook_sheet_attach_at_pos (Workbook *wb, Sheet *new_sheet, int pos)
"notify::visibility",
G_CALLBACK (cb_sheet_visibility_change),
NULL);
/* Do not signal until after adding the views [#314208] */
post_sheet_index_change (wb);
}
/**
......@@ -1365,7 +1366,7 @@ workbook_sheet_state_restore (Workbook *wb, const WorkbookSheetState *wss)
int i;
/* Get rid of sheets that shouldn't be there. */
for (i = workbook_sheet_count (wb) - 1; i >= 0; i--) {
for (i = workbook_sheet_count (wb) ; i-- > 0; ) {
Sheet *sheet = workbook_sheet_by_index (wb, i);
int j;
for (j = 0; j < wss->n_sheets; j++)
......
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