[gnumeric] Replaced last GtkTable instances and fixed a couple of layout issues.
- From: Jean Bréfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Replaced last GtkTable instances and fixed a couple of layout issues.
- Date: Sat, 2 Mar 2013 13:44:48 +0000 (UTC)
commit ea35cd5d573be2887b92c16c190a39d4df80f69f
Author: Jean Brefort <jean brefort normalesup org>
Date: Sat Mar 2 13:43:09 2013 +0100
Replaced last GtkTable instances and fixed a couple of layout issues.
ChangeLog | 17 +++
NEWS | 3 +
plugins/excel/xlsx-read.c | 2 +-
plugins/fn-stat/functions.c | 2 +-
plugins/openoffice/openoffice-read.c | 56 ++++----
plugins/openoffice/openoffice-write.c | 4 +-
src/cell-draw.c | 10 +-
src/cell.c | 2 +-
src/dialogs/ChangeLog | 4 +
src/dialogs/dialog-hyperlink.c | 2 +-
src/dialogs/dialog-preferences.c | 16 +-
src/dialogs/dialog-printer-setup.c | 14 +-
src/dialogs/dialog-sheet-resize.c | 8 +-
src/func.c | 6 +-
src/gnm-pane-impl.h | 1 -
src/gnm-pane.c | 4 -
src/gnm-plugin.c | 2 +-
src/gnm-so-path.c | 10 +-
src/graph.c | 2 +-
src/item-bar.c | 8 +-
src/sheet-control-gui-priv.h | 4 +-
src/sheet-control-gui.c | 232 ++++++++++++++++-----------------
src/sheet-style.h | 2 +-
src/sheet.c | 2 +-
src/ssdiff.c | 30 ++--
src/value.c | 2 +-
src/wbc-gtk.c | 26 ++--
src/workbook-view.c | 4 +-
28 files changed, 245 insertions(+), 230 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b020f8c..95cba1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2013-03-02 Jean Brefort <jean brefort normalesup org>
+
+ * src/gnm-pane-impl.h: remove alignments.
+ * src/gnm-pane.c (gnm_pane_header_init): dittO;
+ * src/gnm-plugin.c (plugin_service_ui_read_xml): fixed a C++ type comment.
+ * src/item-bar.c (item_bar_calc_size): force recalc when indent changed.
+ * src/sheet-control-gui-priv.h: remove all tables by one grid.
+ * src/sheet-control-gui.c (cb_table_destroy), (scg_set_panes),
+ (set_resize_pane_pos), (idle_resize), (cb_canvas_resize),
+ (sheet_control_gui_new), (scg_finalize), (scg_adjust_preferences),
+ (scg_mode_edit): ditto.
+ * src/wbc-gtk.c (cb_show_sheet), (cb_sheet_label_button_press),
+ (cb_sheet_visibility_change), (wbcg_sheet_add),
+ (wbcg_sheet_remove), (wbcg_sheet_focus),
+ (wbcg_sheet_order_changed), (wbcg_sheet_remove_all),
+ (wbcg_get_nth_scg): ditto.
+
2013-03-01 Jean Brefort <jean brefort normalesup org>
* src/gui-file.c (gui_file_open): GtkTable to GtkGrid.
diff --git a/NEWS b/NEWS
index 8432ec0..45603da 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ Andreas:
Jean:
* Fixed aspect ratio for graph sheets. [#691472]
+ * Replaced all GtkTable instances by GtkGrid.
+ * Make the row and column header clickable even when indented.
+ * Fix horizontal and vertical pane positions after indentation.
Morten:
* Fix a few compiler warnings.
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index c0c9256..0fbbc05 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -4461,7 +4461,7 @@ xlsx_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *context,
g_hash_table_destroy (state.theme_colors_by_name);
workbook_set_saveinfo (state.wb, GO_FILE_FL_AUTO,
- go_file_saver_for_id ((state.version == ECMA_376_2006) ?
+ go_file_saver_for_id ((state.version == ECMA_376_2006) ?
"Gnumeric_Excel:xlsx" :
"Gnumeric_Excel:xlsx2"));
}
diff --git a/plugins/fn-stat/functions.c b/plugins/fn-stat/functions.c
index c63f2b0..d3a50ea 100644
--- a/plugins/fn-stat/functions.c
+++ b/plugins/fn-stat/functions.c
@@ -4203,7 +4203,7 @@ gnumeric_subtotal (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
switch (fun_nbr) {
case 1: func = gnm_range_average; break;
- case 2: flags_errors = COLLECT_IGNORE_ERRORS;
+ case 2: flags_errors = COLLECT_IGNORE_ERRORS;
func = gnm_range_count; break;
case 3: flags_errors = COLLECT_ZERO_ERRORS;
flags_strings = COLLECT_ZERO_STRINGS;
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 0735bf5..92ca69d 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -1819,7 +1819,7 @@ odf_fix_en_collect (gchar const *key, G_GNUC_UNUSED GnmNamedExpr *nexpr, odf_fix
int i, limit = g_utf8_next_char (here) - here;
for (i = 0; i<limit;i++)
here[i] = '_';
- }
+ }
}
while (!odf_fix_en_validate (str->str, fen))
g_string_append_c (str, '_');
@@ -1848,8 +1848,8 @@ odf_fix_en_apply (const char *orig, const char *fixed, odf_fix_expr_names_t *fen
fen->nexpr = NULL;
workbook_foreach_name (fen->state->pos.wb, FALSE,
(GHFunc)odf_fix_en_find, fen);
-
- if (fen->nexpr == NULL)
+
+ if (fen->nexpr == NULL)
return;
expr_name_set_name (fen->nexpr, fixed);
@@ -1871,7 +1871,7 @@ odf_fix_expr_names (OOParseState *state)
odf_fix_expr_names_t *fen = odf_fix_expr_names_t_new (state);
workbook_foreach_name (state->pos.wb, FALSE,
- (GHFunc)odf_fix_en_collect, fen);
+ (GHFunc)odf_fix_en_collect, fen);
g_hash_table_foreach (fen->orig2fixed, (GHFunc)odf_fix_en_apply, fen);
odf_fix_expr_names_t_free (fen);
@@ -5077,7 +5077,7 @@ odf_scientific (GsfXMLIn *xin, xmlChar const **attrs)
else if (oo_attr_bool (xin, attrs, OO_GNUM_NS_EXT, "literal-E",
&use_literal_E));
if (engineering)
- details->exponent_step = 3;
+ details->exponent_step = 3;
details->use_markup = !use_literal_E;
details->simplify_mantissa = (details->min_digits == 0) && !use_literal_E;
go_format_generate_str (state->cur_format.accum, details);
@@ -6203,7 +6203,7 @@ oo_style_prop_cell (GsfXMLIn *xin, xmlChar const **attrs)
}
#endif
- gnm_style_set_font_strike (style, strike_through_style > 0 ||
+ gnm_style_set_font_strike (style, strike_through_style > 0 ||
(strike_through_type > 0 && strike_through_style == -1));
}
@@ -9141,7 +9141,7 @@ static gnm_float
odf_parse_float (char *text, char **end)
{
gnm_float x = gnm_strto (text, end);
-
+
if (text == *end)
x = 1.;
@@ -9167,7 +9167,7 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
double viewbox_top = 0.;
double viewbox_width = 0.;
double viewbox_height = 0.;
-
+
if (x)
return *x;
@@ -9175,18 +9175,18 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
if (level < 0) {
oo_warning (xin, _("Infinite loop encountered while parsing formula '%s' "
- "of name '%s'"),
+ "of name '%s'"),
o_formula, key);
return 0;
}
-
+
g_return_val_if_fail (formula != NULL, level);
if (state->chart.cs_viewbox) {
/*
Note:
In ODF 1.2 part 1 19.570 svg:viewBox we have:
- "The syntax for using this attribute is the same as the [SVG] syntax.
+ "The syntax for using this attribute is the same as the [SVG] syntax.
The value of the attribute are four numbers separated by white spaces,
which define the left, top, right, and bottom dimensions of the user
coordinate system."
@@ -9200,9 +9200,9 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
viewbox_left = go_strtod (state->chart.cs_viewbox, &end);
viewbox_top = go_strtod (end, &end);
viewbox_width = go_strtod (end, &end);
- viewbox_height = go_strtod (end, &end);
+ viewbox_height = go_strtod (end, &end);
}
-
+
gstr = g_string_new ("");
while (*formula != 0) {
@@ -9222,9 +9222,9 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
function_reference::= "?" name
name::= [^#x20#x9]+
--------------------------
- so we should graball non-space, non-tab characters
+ so we should graball non-space, non-tab characters
as a function_reference name.
-
+
The problem is that LO creates files in which these
function reference are not terminated by space or tab!
@@ -9278,7 +9278,7 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
case 'b':
if (g_str_has_prefix (formula, "bottom")) {
formula += 6;
- g_string_append_printf (gstr, "%.12" GNM_FORMAT_g,
+ g_string_append_printf (gstr, "%.12" GNM_FORMAT_g,
viewbox_top + viewbox_height);
} else {
g_string_append_c (gstr, *formula);
@@ -9297,7 +9297,7 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
case 'r':
if (g_str_has_prefix (formula, "right")) {
formula += 5;
- g_string_append_printf (gstr, "%.12" GNM_FORMAT_g,
+ g_string_append_printf (gstr, "%.12" GNM_FORMAT_g,
viewbox_left + viewbox_width);
} else {
g_string_append_c (gstr, *formula);
@@ -9324,8 +9324,8 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
break;
- /* The ODF specs says (in ODF 1.2 part 1 item 19.171):
- "sin(n) returns the trigonometric sine of n, where n is an angle
+ /* The ODF specs says (in ODF 1.2 part 1 item 19.171):
+ "sin(n) returns the trigonometric sine of n, where n is an angle
specified in degrees"
but LibreOffice clearly uses sin(n) with n in radians
*/
@@ -9354,7 +9354,7 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
default:
g_string_append_c (gstr, *formula);
formula++;
- break;
+ break;
}
}
@@ -9377,12 +9377,12 @@ odf_get_cs_formula_value (GsfXMLIn *xin, char const *key, GHashTable *vals, gint
*x = x_ret;
g_hash_table_insert (vals, g_strdup (key), x);
} else
- oo_warning (xin, _("Unable to evaluate formula '%s' ('%s') of name '%s'"),
+ oo_warning (xin, _("Unable to evaluate formula '%s' ('%s') of name '%s'"),
o_formula, gstr->str, key);
value_release (val);
gnm_expr_top_unref (texpr);
} else
- oo_warning (xin, _("Unable to parse formula '%s' ('%s') of name '%s'"),
+ oo_warning (xin, _("Unable to parse formula '%s' ('%s') of name '%s'"),
o_formula, gstr->str, key);
g_string_free (gstr, TRUE);
return x_ret;
@@ -9396,7 +9396,7 @@ odf_custom_shape_end (GsfXMLIn *xin, GsfXMLBlob *blob)
GHashTable *vals = NULL;
char **strs, **cur;
GPtrArray *paths;
-
+
if (state->chart.cs_variables || state->chart.cs_modifiers) {
vals = g_hash_table_new_full
(g_str_hash, g_str_equal,
@@ -9404,7 +9404,7 @@ odf_custom_shape_end (GsfXMLIn *xin, GsfXMLBlob *blob)
if (state->chart.cs_modifiers) {
int i = 0;
char *next = state->chart.cs_modifiers;
-
+
while (*next != 0) {
char *end = next;
gnm_float x = odf_parse_float (next, &end);
@@ -9440,9 +9440,9 @@ odf_custom_shape_end (GsfXMLIn *xin, GsfXMLBlob *blob)
if (vals)
g_hash_table_unref (vals);
-
+
/* Note that we have already created a rectangle */
-
+
if (paths->len == 1) {
odf_custom_shape_replace_object
(state, g_object_new (GNM_SO_PATH_TYPE,
@@ -9471,7 +9471,7 @@ odf_custom_shape_end (GsfXMLIn *xin, GsfXMLBlob *blob)
oo_warning (xin , _("An unsupported custom shape was encountered and "
"converted to a rectangle."));
g_ptr_array_unref (paths);
-
+
od_draw_text_frame_end (xin, blob);
g_free (state->chart.cs_enhanced_path);
@@ -9491,7 +9491,7 @@ odf_custom_shape_equation (GsfXMLIn *xin, xmlChar const **attrs)
{
OOParseState *state = (OOParseState *)xin->user_state;
gchar const *name = NULL, *meaning = NULL;
- for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
+ for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]),
OO_NS_DRAW, "name"))
name = CXML2C (attrs[1]);
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index d7eedb4..0fee98a 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -3648,7 +3648,7 @@ odf_write_sheet (GnmOOExport *state)
/* and TABLE "table-rows" wrapper, */
/* MS Excel 2010 stumbles over it */
/* So we may not use them! */
-
+
Sheet const *sheet = state->sheet;
int max_cols = gnm_sheet_get_max_cols (sheet);
int max_rows = gnm_sheet_get_max_rows (sheet);
@@ -3677,7 +3677,7 @@ odf_write_sheet (GnmOOExport *state)
if (repeat_left_end < max_cols)
odf_write_formatted_columns (state, sheet, col_styles,
repeat_left_end + 1, max_cols);
- } else
+ } else
odf_write_formatted_columns (state, sheet, col_styles, 0, max_cols);
if (print_load_repeat_range (sheet->print_info->repeat_top, &r, sheet)) {
diff --git a/src/cell-draw.c b/src/cell-draw.c
index b312b10..b776be7 100644
--- a/src/cell-draw.c
+++ b/src/cell-draw.c
@@ -27,7 +27,7 @@
static char const hashes[] =
"################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################";
-static gboolean
+static gboolean
cell_draw_simplify_cb (PangoAttribute *attribute,
gboolean *recalc_height)
{
@@ -35,18 +35,18 @@ cell_draw_simplify_cb (PangoAttribute *attribute,
(attribute->klass->type == PANGO_ATTR_SCALE)) {
*recalc_height = TRUE;
return TRUE;
- }
+ }
return (attribute->klass->type == PANGO_ATTR_SHAPE);
}
static void
cell_draw_simplify_attributes (GnmRenderedValue *rv)
{
- PangoAttrList *pal = pango_attr_list_ref
+ PangoAttrList *pal = pango_attr_list_ref
(pango_layout_get_attributes (rv->layout));
gboolean recalc_height = FALSE;
- pango_attr_list_unref
- (pango_attr_list_filter
+ pango_attr_list_unref
+ (pango_attr_list_filter
(pal, (PangoAttrFilterFunc) cell_draw_simplify_cb, &recalc_height));
if (recalc_height)
pango_layout_get_size (rv->layout, NULL,
diff --git a/src/cell.c b/src/cell.c
index 77f1bfd..48be4a6 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -955,7 +955,7 @@ gnm_cell_get_format_given_style (GnmCell const *cell, GnmStyle const *style)
GOFormat const *
gnm_cell_get_format (GnmCell const *cell)
{
- return gnm_cell_get_format_given_style (cell, NULL);
+ return gnm_cell_get_format_given_style (cell, NULL);
}
/*
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 575d6d1..d673a85 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,7 @@
+2013-03-02 Jean Brefort <jean brefort normalesup org>
+
+ * dialog-printer-setup.c (margin_preview_page_create): fixed preview.
+
2013-03-01 Jean Brefort <jean brefort normalesup org>
* kaplan-meier.ui: fixed layout.
diff --git a/src/dialogs/dialog-hyperlink.c b/src/dialogs/dialog-hyperlink.c
index 8052aed..928f3c9 100644
--- a/src/dialogs/dialog-hyperlink.c
+++ b/src/dialogs/dialog-hyperlink.c
@@ -497,7 +497,7 @@ dhl_init (HyperlinkState *state)
w = go_gtk_builder_get_widget (state->gui, "internal-link-grid");
expr_entry = gnm_expr_entry_new (state->wbcg, TRUE);
- gtk_widget_set_hexpand (GTK_WIDGET (expr_entry), TRUE);
+ gtk_widget_set_hexpand (GTK_WIDGET (expr_entry), TRUE);
gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (expr_entry));
gtk_entry_set_activates_default
(gnm_expr_entry_get_entry (expr_entry), TRUE);
diff --git a/src/dialogs/dialog-preferences.c b/src/dialogs/dialog-preferences.c
index 46bead4..de141fe 100644
--- a/src/dialogs/dialog-preferences.c
+++ b/src/dialogs/dialog-preferences.c
@@ -546,7 +546,7 @@ wordlist_pref_create_widget (GOConfNode *node, GtkWidget *grid,
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
gtk_container_add (GTK_CONTAINER (sw), tv);
- g_object_set (w, "column-spacing", 12, "row-spacing", 6,
+ g_object_set (w, "column-spacing", 12, "row-spacing", 6,
"hexpand", TRUE, "vexpand", TRUE, NULL);
gtk_grid_attach (GTK_GRID (grid), w, 0, row, 2, 1);
g_object_set (sw, "hexpand", TRUE, "vexpand", TRUE, NULL);
@@ -722,7 +722,7 @@ pref_undo_page_initializer (PrefState *state,
GtkWidget *page = gtk_grid_new ();
gint row = 0;
- g_object_set (page, "column-spacing", 12, "row-spacing", 6,
+ g_object_set (page, "column-spacing", 12, "row-spacing", 6,
"vexpand", TRUE, NULL);
int_pref_create_widget (gnm_conf_get_undo_max_descriptor_width_node (),
page, row++, 5, 5, 200, 1,
@@ -762,7 +762,7 @@ pref_sort_page_initializer (PrefState *state,
GtkWidget *page = gtk_grid_new ();
gint row = 0;
- g_object_set (page, "column-spacing", 12, "row-spacing", 6,
+ g_object_set (page, "column-spacing", 12, "row-spacing", 6,
"vexpand", TRUE, NULL);
int_pref_create_widget (gnm_conf_get_core_sort_dialog_max_initial_clauses_node (),
page, row++, 10, 0, 50, 1,
@@ -803,7 +803,7 @@ pref_window_page_initializer (PrefState *state,
gint row = 0;
GtkWidget *w;
- g_object_set (page, "column-spacing", 12, "row-spacing", 6,
+ g_object_set (page, "column-spacing", 12, "row-spacing", 6,
"vexpand", TRUE, NULL);
double_pref_create_widget (gnm_conf_get_core_gui_window_y_node (),
page, row++, 0.75, 0.25, 1, 0.05, 2,
@@ -930,7 +930,7 @@ pref_file_page_initializer (PrefState *state,
GtkWidget *page = gtk_grid_new ();
gint row = 0;
- g_object_set (page, "column-spacing", 12, "row-spacing", 6,
+ g_object_set (page, "column-spacing", 12, "row-spacing", 6,
"vexpand", TRUE, NULL);
int_pref_create_widget (gnm_conf_get_core_xml_compression_level_node (),
page, row++, 9, 0, 9, 1,
@@ -982,7 +982,7 @@ pref_screen_page_initializer (PrefState *state,
GtkWidget *page = gtk_grid_new ();
gint row = 0;
- g_object_set (page, "column-spacing", 12, "row-spacing", 6,
+ g_object_set (page, "column-spacing", 12, "row-spacing", 6,
"vexpand", TRUE, NULL);
double_pref_create_widget (gnm_conf_get_core_gui_screen_horizontaldpi_node (),
page, row++, 96, 50, 250, 1, 1,
@@ -1012,7 +1012,7 @@ pref_tool_page_initializer (PrefState *state,
GtkWidget *page = gtk_grid_new ();
gint row = 0;
- g_object_set (page, "column-spacing", 12, "row-spacing", 6,
+ g_object_set (page, "column-spacing", 12, "row-spacing", 6,
"vexpand", TRUE, NULL);
enum_pref_create_widget (gnm_conf_get_core_gui_editing_enter_moves_dir_node (),
page, row++,
@@ -1076,7 +1076,7 @@ pref_copypaste_page_initializer (PrefState *state,
GtkWidget *page = gtk_grid_new ();
gint row = 0;
- g_object_set (page, "column-spacing", 12, "row-spacing", 6,
+ g_object_set (page, "column-spacing", 12, "row-spacing", 6,
"vexpand", TRUE, NULL);
bool_pref_create_widget (gnm_conf_get_cut_and_paste_prefer_clipboard_node (),
page, row++,
diff --git a/src/dialogs/dialog-printer-setup.c b/src/dialogs/dialog-printer-setup.c
index 4eaa40b..bb7a0ac 100644
--- a/src/dialogs/dialog-printer-setup.c
+++ b/src/dialogs/dialog-printer-setup.c
@@ -73,6 +73,7 @@ typedef struct {
GocItem *group;
/* Values for the scaling of the nice preview */
+ int width, height;
int offset_x, offset_y; /* For centering the small page preview */
double scale;
} MarginPreviewInfo;
@@ -429,7 +430,7 @@ margin_preview_page_available_size (PrinterSetupState *state,
NULL);
widths = g_new0 (guint, ncols);
heights = g_new0 (guint, nrows);
-
+
/* Iterate through all child widgets in the grid */
for (child_list = gtk_container_get_children (GTK_CONTAINER (grid));
child_list; child_list = child_list->next) {
@@ -448,7 +449,7 @@ margin_preview_page_available_size (PrinterSetupState *state,
gtk_widget_get_preferred_size (GTK_WIDGET(child_widget), &requisition, NULL);
/* Find largest widget in each table column */
- /* Exclude widgets that expand across more than one grid cells
+ /* Exclude widgets that expand across more than one grid cells
* or are not in a relevant column */
if (left >= first_col && width == 1 && left < first_col + ncols) {
if ((guint) requisition.width > widths[left - first_col]) {
@@ -498,14 +499,13 @@ margin_preview_page_create (PrinterSetupState *state)
MarginPreviewPageAvailableSize margin_available_size;
margin_preview_page_available_size (state, &margin_available_size);
+ gtk_widget_set_size_request (state->preview.canvas, margin_available_size.width,
margin_available_size.height);
width = state->width;
height = state->height;
-
- if (width < height)
- pi->scale = (margin_available_size.height - PREVIEW_MARGIN_Y) / height;
- else
- pi->scale = (margin_available_size.width - PREVIEW_MARGIN_X) / width;
+ x1 = (margin_available_size.width - PREVIEW_MARGIN_X) / width;
+ x2 = (margin_available_size.height - PREVIEW_MARGIN_Y) / height;
+ pi->scale = MIN (x1, x2);
pi->offset_x = (margin_available_size.width - (width * pi->scale)) / 2;
pi->offset_y = (margin_available_size.height - (height * pi->scale)) / 2;
diff --git a/src/dialogs/dialog-sheet-resize.c b/src/dialogs/dialog-sheet-resize.c
index 31c302e..60b5baf 100644
--- a/src/dialogs/dialog-sheet-resize.c
+++ b/src/dialogs/dialog-sheet-resize.c
@@ -124,14 +124,14 @@ cb_ok_clicked (ResizeState *state)
sheets = workbook_sheets (wb);
for (l = sheets; l; l = l->next) {
Sheet *this_sheet = l->data;
-
+
if (this_sheet == state->sheet)
continue;
-
+
if (cols == gnm_sheet_get_max_cols (this_sheet) &&
rows == gnm_sheet_get_max_rows (this_sheet))
continue;
-
+
changed_sheets = g_slist_prepend (changed_sheets, this_sheet);
}
g_slist_free (sheets);
@@ -145,7 +145,7 @@ cb_ok_clicked (ResizeState *state)
changed_sheets = g_slist_prepend (changed_sheets, state->sheet);
}
-
+
if (changed_sheets)
cmd_resize_sheets (wbc, changed_sheets,
diff --git a/src/func.c b/src/func.c
index e623c62..e1c920f 100644
--- a/src/func.c
+++ b/src/func.c
@@ -789,7 +789,7 @@ gnm_func_group_free (GnmFuncGroup *fn_group)
g_free (fn_group);
}
-static GnmFuncGroup *
+static GnmFuncGroup *
gnm_func_group_ref (GnmFuncGroup *fn_group)
{
fn_group->ref_count++;
@@ -1083,7 +1083,7 @@ GnmFunc *
gnm_func_lookup_localized (char const *name, Workbook *scope)
{
GnmFunc *fd;
- GHashTableIter hiter;
+ GHashTableIter hiter;
gpointer value;
/* Must localize all function names. */
@@ -1113,7 +1113,7 @@ GSList *
gnm_func_lookup_prefix (char const *prefix, Workbook *scope, gboolean trans)
{
GSList *res = NULL;
- GHashTableIter hiter;
+ GHashTableIter hiter;
gpointer value;
/*
diff --git a/src/gnm-pane-impl.h b/src/gnm-pane-impl.h
index 8ad733e..8537722 100644
--- a/src/gnm-pane-impl.h
+++ b/src/gnm-pane-impl.h
@@ -43,7 +43,6 @@ struct _GnmPane {
int index;
struct {
- GtkWidget *alignment;
GocCanvas *canvas;
ItemBar *item;
} col, row;
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index ee60f11..05c228c 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -993,7 +993,6 @@ gnm_pane_header_init (GnmPane *pane, SheetControlGUI *scg,
gboolean is_col_header)
{
Sheet *sheet = scg_sheet (scg);
- GtkWidget *alignment;
GocCanvas *canvas = gnm_simple_canvas_new (scg);
GocGroup *group = goc_canvas_get_root (canvas);
GocItem *item = goc_item_new (group,
@@ -1009,13 +1008,10 @@ gnm_pane_header_init (GnmPane *pane, SheetControlGUI *scg,
goc_canvas_set_direction (canvas, GOC_DIRECTION_RTL);
pane->col.canvas = canvas;
pane->col.item = ITEM_BAR (item);
- alignment = pane->col.alignment = gtk_alignment_new (0, 1, 1, 0);
} else {
pane->row.canvas = canvas;
pane->row.item = ITEM_BAR (item);
- alignment = pane->row.alignment = gtk_alignment_new (1, 0, 0, 1);
}
- gtk_container_add (GTK_CONTAINER (alignment), GTK_WIDGET (canvas));
pane->size_guide.points = NULL;
pane->size_guide.start = NULL;
diff --git a/src/gnm-plugin.c b/src/gnm-plugin.c
index b90ca1d..c4081c8 100644
--- a/src/gnm-plugin.c
+++ b/src/gnm-plugin.c
@@ -391,7 +391,7 @@ plugin_service_ui_read_xml (GOPluginService *service, xmlNode *tree, GOErrorInfo
strcmp (CXML2C (ptr->name), "action"))
continue;
name = go_xml_node_get_cstr (ptr, "name");
-// label = go_xml_node_get_cstr (ptr, "label");
+/* label = go_xml_node_get_cstr (ptr, "label");*/
/*****************************************************************************************/
label_node = go_xml_get_child_by_name_no_lang (ptr, "label");
label = label_node
diff --git a/src/gnm-so-path.c b/src/gnm-so-path.c
index d98f14d..de83cd4 100644
--- a/src/gnm-so-path.c
+++ b/src/gnm-so-path.c
@@ -381,7 +381,7 @@ sop_sax_path (GsfXMLIn *xin, xmlChar const **attrs)
g_object_set (G_OBJECT (sop), "paths", sop->paths, NULL);
g_ptr_array_unref (sop->paths);
return;
- }
+ }
}
static void
@@ -426,7 +426,7 @@ gnm_so_path_prep_sax_parser (SheetObject *so, GsfXMLIn *xin,
g_object_set (G_OBJECT (sop), "path", path, NULL);
go_path_free (path);
}
- }
+ }
}
static void
@@ -522,7 +522,7 @@ gnm_so_path_set_property (GObject *obj, guint param_id,
g_free (sop->text);
sop->text = g_strdup (str == NULL ? "" : str);
break;
- }
+ }
case SOP_PROP_MARKUP:
if (sop->markup != NULL)
pango_attr_list_unref (sop->markup);
@@ -602,13 +602,13 @@ gnm_so_path_class_init (GObjectClass *gobject_class)
so_class->copy = gnm_so_path_copy;
so_class->rubber_band_directly = FALSE;
so_class->xml_export_name = "SheetObjectPath";
-
+
#ifdef GNM_WITH_GTK
so_class->new_view = gnm_so_path_new_view;
so_class->user_config = gnm_so_path_user_config;
#endif /* GNM_WITH_GTK */
so_class->draw_cairo = gnm_so_path_draw_cairo;
-
+
g_object_class_install_property (gobject_class, SOP_PROP_PATH,
g_param_spec_boxed ("path", NULL, NULL, GO_TYPE_PATH,
GSF_PARAM_STATIC | G_PARAM_READWRITE));
diff --git a/src/graph.c b/src/graph.c
index d0995b9..59fe73d 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -685,7 +685,7 @@ gnm_go_data_vector_load_values (GODataVector *dat)
&start_sheet, &end_sheet, &r);
/* clip here rather than relying on sheet_foreach
- * because that only clips if we ignore blanks
+ * because that only clips if we ignore blanks
* but add +1 to max_used so that we can have matrices with
* empty cells at the end, see #684072 */
if (r.end.row > start_sheet->rows.max_used)
diff --git a/src/item-bar.c b/src/item-bar.c
index ee0462b..648d637 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -169,7 +169,11 @@ item_bar_calc_size (ItemBar *ib)
g_list_free (item_list);
- ib->indent = ib_compute_pixels_from_indent (sheet, ib->is_col_header);
+ size = ib_compute_pixels_from_indent (sheet, ib->is_col_header);
+ if (size != ib->indent) {
+ ib->indent = size;
+ goc_item_bounds_changed (GOC_ITEM (ib));
+ }
pango_font_description_free (desc);
g_object_unref (layout);
@@ -526,7 +530,7 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
cairo_restore (cr);
}
}
- prev_visible = cri->visible;
+ prev_visible = cri->visible;
prev_level = cri->outline_level;
++col;
} while ((rtl && end <= total) || (!rtl && total <= end));
diff --git a/src/sheet-control-gui-priv.h b/src/sheet-control-gui-priv.h
index 67a72ea..3ec919a 100644
--- a/src/sheet-control-gui-priv.h
+++ b/src/sheet-control-gui-priv.h
@@ -16,9 +16,7 @@ struct _SheetControlGUI {
/* Cached SheetControl attribute to reduce casting. */
WBCGtk *wbcg;
- GtkTable *table;
- GtkTable *inner_table;
- GtkTable *corner;
+ GtkGrid *grid;
GtkWidget *select_all_btn;
GtkWidget *label;
struct {
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 43ea033..4d3d4b9 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -687,9 +687,9 @@ cb_table_destroy (SheetControlGUI *scg)
SheetControl *sc = (SheetControl *) scg;
int i;
- if (scg->table) {
- g_object_unref (scg->table);
- scg->table = NULL;
+ if (scg->grid) {
+ g_object_unref (scg->grid);
+ scg->grid = NULL;
}
scg_mode_edit (scg); /* finish any object edits */
@@ -1134,18 +1134,12 @@ scg_set_panes (SheetControl *sc)
if (!scg->pane[1]) {
scg->pane[1] = gnm_pane_new (scg, TRUE, FALSE, 1);
gnm_pane_set_direction (scg->pane[1], direction);
- gtk_table_attach (scg->inner_table,
- GTK_WIDGET (scg->pane[1]),
- 1, 2, 2, 3,
- GTK_FILL | GTK_SHRINK,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
- gtk_table_attach (scg->inner_table,
- GTK_WIDGET (scg->pane[1]->col.alignment),
- 1, 2, 0, 1,
- GTK_FILL | GTK_SHRINK,
- GTK_FILL,
- 0, 0);
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->pane[1]),
+ 2, 3, 1, 1);
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->pane[1]->col.canvas),
+ 2, 0, 1, 2);
}
gnm_pane_bound_set (scg->pane[1],
tl->col, br->row, br->col - 1, gnm_sheet_get_last_row (sv->sheet));
@@ -1155,12 +1149,9 @@ scg_set_panes (SheetControl *sc)
if (!scg->pane[2]) {
scg->pane[2] = gnm_pane_new (scg, FALSE, FALSE, 2);
gnm_pane_set_direction (scg->pane[2], direction);
- gtk_table_attach (scg->inner_table,
- GTK_WIDGET (scg->pane[2]),
- 1, 2, 1, 2,
- GTK_FILL | GTK_SHRINK,
- GTK_FILL,
- 0, 0);
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->pane[2]),
+ 2, 2, 1, 1);
}
gnm_pane_bound_set (scg->pane[2],
tl->col, tl->row, br->col - 1, br->row - 1);
@@ -1170,18 +1161,12 @@ scg_set_panes (SheetControl *sc)
if (!scg->pane[3]) {
scg->pane[3] = gnm_pane_new (scg, FALSE, TRUE, 3);
gnm_pane_set_direction (scg->pane[3], direction);
- gtk_table_attach (scg->inner_table,
- GTK_WIDGET (scg->pane[3]),
- 2, 3, 1, 2,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_FILL | GTK_SHRINK,
- 0, 0);
- gtk_table_attach (scg->inner_table,
- GTK_WIDGET (scg->pane[3]->row.alignment),
- 0, 1, 1, 2,
- GTK_FILL | GTK_SHRINK,
- GTK_FILL,
- 0, 0);
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->pane[3]),
+ 3, 2, 1, 1);
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->pane[3]->row.canvas),
+ 0, 2, 2, 1);
}
gnm_pane_bound_set (scg->pane[3],
br->col, tl->row, gnm_sheet_get_last_col (sv->sheet), br->row - 1);
@@ -1199,7 +1184,7 @@ scg_set_panes (SheetControl *sc)
0, 0, gnm_sheet_get_last_col (sv->sheet), gnm_sheet_get_last_row (sv->sheet));
}
- gtk_widget_show_all (GTK_WIDGET (scg->inner_table));
+ gtk_widget_show_all (GTK_WIDGET (scg->grid));
/* in case headers are hidden */
scg_adjust_preferences (scg);
@@ -1332,21 +1317,22 @@ static void
set_resize_pane_pos (SheetControlGUI *scg, GtkPaned *p)
{
int handle_size, pane_pos, size;
+ GtkAllocation alloc;
if (!scg->pane[0])
return;
if (p == scg->vpane) {
- gtk_widget_get_size_request (
- GTK_WIDGET (scg->pane[0]->col.canvas), NULL, &pane_pos);
+ gtk_widget_get_allocation (GTK_WIDGET (scg->pane[0]->col.canvas), &alloc);
+ pane_pos = alloc.height;
if (scg->pane[3]) {
gtk_widget_get_size_request (
GTK_WIDGET (scg->pane[3]), NULL, &size);
pane_pos += size;
}
} else {
- gtk_widget_get_size_request (
- GTK_WIDGET (scg->pane[0]->row.canvas), &pane_pos, NULL);
+ gtk_widget_get_allocation (GTK_WIDGET (scg->pane[0]->row.canvas), &alloc);
+ pane_pos = alloc.width;
if (scg->pane[1]) {
gtk_widget_get_size_request (
GTK_WIDGET (scg->pane[1]), &size, NULL);
@@ -1468,6 +1454,31 @@ cb_check_resize (GtkPaned *p, GtkAllocation *allocation,
}
}
+struct resize_closure {
+ GtkPaned *p;
+ SheetControlGUI *scg;
+};
+
+static gboolean
+idle_resize (struct resize_closure *r)
+{
+
+ set_resize_pane_pos (r->scg, r->p);
+ g_free (r);
+ return FALSE;
+}
+
+static void
+cb_canvas_resize (GtkWidget *w, GtkAllocation *allocation,
+ SheetControlGUI *scg)
+{
+ struct resize_closure *r = g_new (struct resize_closure, 1);
+ r->scg = scg;
+ r->p = (w == GTK_WIDGET (scg->pane[0]->col.canvas))? scg->hpane: scg->vpane;
+ /* The allocation is not correct at this point, weird */
+ g_idle_add ((GSourceFunc) idle_resize, r);
+}
+
static gboolean
post_create_cb (SheetControlGUI *scg)
{
@@ -1528,7 +1539,7 @@ SheetControlGUI *
sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
{
SheetControlGUI *scg;
- GnmUpdateType scroll_update_policy;
+/* GnmUpdateType scroll_update_policy; */ /* see warning below */
Sheet *sheet;
GocDirection direction;
GdkRGBA cfore, cback;
@@ -1557,9 +1568,15 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
scg->col_group.buttons = g_ptr_array_new ();
scg->row_group.buttons = g_ptr_array_new ();
scg->col_group.button_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_set_homogeneous (GTK_BOX (scg->col_group.button_box), TRUE);
+ g_object_set (scg->col_group.button_box,
+ "halign", GTK_ALIGN_CENTER,
+ "homogeneous", TRUE,
+ NULL);
scg->row_group.button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_box_set_homogeneous (GTK_BOX (scg->row_group.button_box), TRUE);
+ g_object_set (scg->row_group.button_box,
+ "valign", GTK_ALIGN_CENTER,
+ "homogeneous", TRUE,
+ NULL);
scg->select_all_btn = gtk_drawing_area_new ();
gtk_widget_add_events (scg->select_all_btn, GDK_BUTTON_PRESS_MASK);
g_signal_connect (G_OBJECT (scg->select_all_btn), "draw",
@@ -1567,52 +1584,36 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
g_signal_connect (G_OBJECT (scg->select_all_btn), "event",
G_CALLBACK (cb_select_all_btn_event), scg);
- scg->corner = GTK_TABLE (gtk_table_new (2, 2, FALSE));
- gtk_table_attach (scg->corner, scg->col_group.button_box,
- 1, 2, 0, 1,
- GTK_SHRINK,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
- gtk_table_attach (scg->corner, scg->row_group.button_box,
- 0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_SHRINK,
- 0, 0);
- gtk_table_attach (scg->corner, scg->select_all_btn,
- 1, 2, 1, 2,
- 0,
- 0,
- 0, 0);
+ scg->grid = GTK_GRID (gtk_grid_new ());
+ gtk_grid_attach (scg->grid, scg->col_group.button_box,
+ 1, 0, 1, 1);
+ gtk_grid_attach (scg->grid, scg->row_group.button_box,
+ 0, 1, 1, 1);
+ gtk_grid_attach (scg->grid, scg->select_all_btn, 1, 1, 1, 1);
scg->pane[1] = scg->pane[2] = scg->pane[3] = NULL;
scg->pane[0] = gnm_pane_new (scg, TRUE, TRUE, 0);
gnm_pane_set_direction (scg->pane[0], direction);
- scg->inner_table = GTK_TABLE (gtk_table_new (3, 3, FALSE));
- gtk_table_attach (scg->inner_table, GTK_WIDGET (scg->corner),
- 0, 1, 0, 1,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
- gtk_table_attach (scg->inner_table, GTK_WIDGET (scg->pane[0]->col.alignment),
- 2, 3, 0, 1,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_FILL,
- 0, 0);
- gtk_table_attach (scg->inner_table, GTK_WIDGET (scg->pane[0]->row.alignment),
- 0, 1, 2, 3,
- GTK_FILL,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
- gtk_table_attach (scg->inner_table, GTK_WIDGET (scg->pane[0]),
- 2, 3, 2, 3,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
- gtk_widget_show_all (GTK_WIDGET (scg->inner_table));
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->pane[0]->col.canvas),
+ 3, 0, 1, 2);
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->pane[0]->row.canvas),
+ 0, 3, 2, 1);
+ g_object_set (scg->pane[0],
+ "hexpand", TRUE,
+ "vexpand", TRUE,
+ NULL);
+ gtk_grid_attach (scg->grid, GTK_WIDGET (scg->pane[0]),
+ 3, 3, 1, 1);
+ g_signal_connect_after (G_OBJECT (scg->pane[0]->col.canvas), "size-allocate",
+ G_CALLBACK (cb_canvas_resize), scg);
+ g_signal_connect_after (G_OBJECT (scg->pane[0]->row.canvas), "size-allocate",
+ G_CALLBACK (cb_canvas_resize), scg);
/* Scroll bars and their adjustments */
- scroll_update_policy = gnm_conf_get_core_gui_editing_livescrolling ()
- ? GNM_UPDATE_CONTINUOUS : GNM_UPDATE_DELAYED;
+/* scroll_update_policy = gnm_conf_get_core_gui_editing_livescrolling ()
+ ? GNM_UPDATE_CONTINUOUS : GNM_UPDATE_DELAYED;*/ /* see below */
scg->va = (GtkAdjustment *)gtk_adjustment_new (0., 0., 1, 1., 1., 1.);
scg->vs = g_object_new (GTK_TYPE_SCROLLBAR,
"orientation", GTK_ORIENTATION_VERTICAL,
@@ -1644,31 +1645,21 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
"adjust_bounds",
G_CALLBACK (cb_hscrollbar_adjust_bounds), sheet);
- scg->table = GTK_TABLE (gtk_table_new (4, 4, FALSE));
- g_object_ref (scg->table);
- gtk_table_attach (scg->table, GTK_WIDGET (scg->inner_table),
- 0, 1, 0, 1,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
+ g_object_ref (scg->grid);
scg->vpane = g_object_new (GTK_TYPE_PANED, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
- gtk_paned_add1 (scg->vpane, gtk_label_new (NULL)); /* use a spacer */
+ gtk_paned_add1 (scg->vpane, gtk_label_new (NULL)); /* use a spacer */
gtk_paned_add2 (scg->vpane, scg->vs);
scg_gtk_paned_set_position (scg, scg->vpane, 0);
- gtk_table_attach (scg->table, GTK_WIDGET (scg->vpane),
- 1, 2, 0, 1,
- GTK_FILL,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
+ gtk_widget_set_vexpand (GTK_WIDGET (scg->vpane), TRUE);
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->vpane), 4, 0, 1, 4);
scg->hpane = g_object_new (GTK_TYPE_PANED, NULL);
gtk_paned_add1 (scg->hpane, gtk_label_new (NULL)); /* use a spacer */
gtk_paned_add2 (scg->hpane, scg->hs);
scg_gtk_paned_set_position (scg, scg->hpane, 0);
- gtk_table_attach (scg->table, GTK_WIDGET (scg->hpane),
- 0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_FILL,
- 0, 0);
+ gtk_widget_set_hexpand (GTK_WIDGET (scg->hpane), TRUE);
+ gtk_grid_attach (scg->grid,
+ GTK_WIDGET (scg->hpane), 0, 4, 4, 1);
/* do not connect until after setting position */
g_signal_connect (G_OBJECT (scg->vpane), "notify::position",
G_CALLBACK (cb_resize_pane_motion), scg);
@@ -1679,11 +1670,11 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
g_signal_connect_after (G_OBJECT (scg->hpane), "size-allocate",
G_CALLBACK (cb_check_resize), scg);
- g_signal_connect_data (G_OBJECT (scg->table),
+ g_signal_connect_data (G_OBJECT (scg->grid),
"size-allocate",
G_CALLBACK (scg_scrollbar_config), scg, NULL,
G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- g_signal_connect_object (G_OBJECT (scg->table),
+ g_signal_connect_object (G_OBJECT (scg->grid),
"destroy",
G_CALLBACK (cb_table_destroy), G_OBJECT (scg),
G_CONNECT_SWAPPED);
@@ -1706,16 +1697,16 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
NULL);
} else {
scg->active_panes = 0;
- scg->table = GTK_TABLE (gtk_table_new (1, 1, FALSE));
- g_object_ref (scg->table);
+ scg->grid = GTK_GRID (gtk_grid_new ());
+ g_object_ref (scg->grid);
sheet->hide_col_header = sheet->hide_row_header = FALSE;
if (sheet->sheet_type == GNM_SHEET_OBJECT) {
scg->vs = g_object_new (GOC_TYPE_CANVAS, NULL);
- gtk_table_attach (scg->table, scg->vs,
- 0, 1, 0, 1,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
+ g_object_set (scg->vs,
+ "hexpand", TRUE,
+ "vexpand", TRUE,
+ NULL);
+ gtk_grid_attach (scg->grid, scg->vs, 0, 0, 1, 1);
gtk_widget_set_can_focus (scg->vs, TRUE);
gtk_widget_set_can_default (scg->vs, TRUE);
g_signal_connect (G_OBJECT (scg->vs), "key-press-event",
@@ -1728,7 +1719,7 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
g_object_set_data (G_OBJECT (scg->vs), "sheet-control", scg);
if (sheet->sheet_objects) {
/* we need an idle function because not every thing is initialized at this
point */
- sheet_object_new_view ((SheetObject *) sheet->sheet_objects->data,
+ sheet_object_new_view ((SheetObject *) sheet->sheet_objects->data,
(SheetObjectViewContainer*) scg->vs);
g_idle_add ((GSourceFunc) post_create_cb, scg);
}
@@ -1797,10 +1788,10 @@ scg_finalize (GObject *object)
sv_detach_control (sc);
}
- if (scg->table) {
- gtk_widget_destroy (GTK_WIDGET (scg->table));
- g_object_unref (scg->table);
- scg->table = NULL;
+ if (scg->grid) {
+ gtk_widget_destroy (GTK_WIDGET (scg->grid));
+ g_object_unref (scg->grid);
+ scg->grid = NULL;
}
if (scg->label) {
@@ -1877,19 +1868,22 @@ scg_adjust_preferences (SheetControlGUI *scg)
SCG_FOREACH_PANE (scg, pane, {
if (pane->col.canvas != NULL) {
- gtk_widget_set_visible (GTK_WIDGET (pane->col.alignment),
+ gtk_widget_set_visible (GTK_WIDGET (pane->col.canvas),
!sheet->hide_col_header);
}
if (pane->row.canvas != NULL) {
- gtk_widget_set_visible (GTK_WIDGET (pane->row.alignment),
+ gtk_widget_set_visible (GTK_WIDGET (pane->row.canvas),
!sheet->hide_row_header);
}
});
- if (scg->corner) {
- gtk_widget_set_visible (GTK_WIDGET (scg->corner),
- !(sheet->hide_col_header || sheet->hide_row_header));
+ if (scg->select_all_btn) {
+ /* we used to test for the corner table existence, why??? */
+ gboolean visible = !(sheet->hide_col_header || sheet->hide_row_header);
+ gtk_widget_set_visible (scg->select_all_btn, visible);
+ gtk_widget_set_visible (scg->row_group.button_box, visible);
+ gtk_widget_set_visible (scg->col_group.button_box, visible);
if (scg_wbc (scg) != NULL) {
WorkbookView *wbv = wb_control_view (scg_wbc (scg));
@@ -2484,7 +2478,7 @@ scg_mode_edit (SheetControlGUI *scg)
/* During destruction we have already been disconnected
* so don't bother changing the cursor */
- if (scg->table != NULL &&
+ if (scg->grid != NULL &&
scg_sheet (scg) != NULL &&
scg_view (scg) != NULL) {
scg_set_display_cursor (scg);
diff --git a/src/sheet-style.h b/src/sheet-style.h
index a9c339c..0fd91f4 100644
--- a/src/sheet-style.h
+++ b/src/sheet-style.h
@@ -50,7 +50,7 @@ void sheet_style_get_nondefault_extent (Sheet const *sheet, GnmRange *extent,
const GnmRange *src, GnmStyle **col_defaults);
guint8 * sheet_style_get_nondefault_rows (Sheet const *sheet,
GnmStyle **col_defaults);
-
+
gboolean sheet_style_is_default (Sheet const *sheet, const GnmRange *r, GnmStyle **col_defaults);
void style_row_init (GnmBorder const * * *prev_vert,
GnmStyleRow *sr, GnmStyleRow *next_sr,
diff --git a/src/sheet.c b/src/sheet.c
index 2130028..ed9514e 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -3752,7 +3752,7 @@ GPtrArray *
sheet_cells (Sheet *sheet, const GnmRange *r)
{
GPtrArray *res = g_ptr_array_new ();
- GHashTableIter hiter;
+ GHashTableIter hiter;
gpointer value;
g_hash_table_iter_init (&hiter, sheet->cell_hash);
diff --git a/src/ssdiff.c b/src/ssdiff.c
index c95fe89..6507ed0 100644
--- a/src/ssdiff.c
+++ b/src/ssdiff.c
@@ -168,7 +168,7 @@ null_sheet_order_changed (G_GNUC_UNUSED GnmDiffState *state)
{
}
-static void
+static void
null_sheet_attr_int_changed (G_GNUC_UNUSED GnmDiffState *state,
G_GNUC_UNUSED const char *name,
G_GNUC_UNUSED int o,
@@ -252,7 +252,7 @@ def_sheet_order_changed (GnmDiffState *state)
gsf_output_printf (state->output, _("Sheet order changed.\n"));
}
-static void
+static void
def_sheet_attr_int_changed (GnmDiffState *state, const char *name,
G_GNUC_UNUSED int o, G_GNUC_UNUSED int n)
{
@@ -260,7 +260,7 @@ def_sheet_attr_int_changed (GnmDiffState *state, const char *name,
name);
}
-static void
+static void
def_cell_changed (GnmDiffState *state, GnmCell const *oc, GnmCell const *nc)
{
if (oc && nc)
@@ -273,7 +273,7 @@ def_cell_changed (GnmDiffState *state, GnmCell const *oc, GnmCell const *nc)
g_assert_not_reached ();
}
-static void
+static void
def_style_changed (GnmDiffState *state, GnmRange const *r,
G_GNUC_UNUSED Sheet const *osh,
G_GNUC_UNUSED Sheet const *nsh,
@@ -353,7 +353,7 @@ xml_sheet_end (GnmDiffState *state)
gsf_xml_out_end_element (state->xml); /* </Sheet> */
}
-static void
+static void
xml_sheet_attr_int_changed (GnmDiffState *state, const char *name,
int o, int n)
{
@@ -399,7 +399,7 @@ output_cell (GnmDiffState *state, GnmCell const *cell,
g_string_free (str, TRUE);
}
-static void
+static void
xml_cell_changed (GnmDiffState *state, GnmCell const *oc, GnmCell const *nc)
{
const GnmCellPos *pos;
@@ -428,9 +428,9 @@ xml_cell_changed (GnmDiffState *state, GnmCell const *oc, GnmCell const *nc)
gsf_xml_out_add_int (state->xml, "New", (fun) (ns)); \
gsf_xml_out_end_element (state->xml); \
} while (0)
-
-static void
+
+static void
xml_style_changed (GnmDiffState *state, GnmRange const *r,
G_GNUC_UNUSED Sheet const *osh,
G_GNUC_UNUSED Sheet const *nsh,
@@ -489,7 +489,7 @@ xml_style_changed (GnmDiffState *state, GnmRange const *r,
"Rev-Diagonal",
"Diagonal"
};
-
+
char *tag = g_strconcat ("Border",
border_names[e - MSTYLE_BORDER_TOP],
NULL);
@@ -673,7 +673,7 @@ highlight_apply (GnmDiffState *state, const char *sheetname,
sheet_style_apply_range (sheet, r, state->highlight_style);
}
-static void
+static void
highlight_cell_changed (GnmDiffState *state,
GnmCell const *oc, GnmCell const *nc)
{
@@ -683,7 +683,7 @@ highlight_cell_changed (GnmDiffState *state,
highlight_apply (state, nc->base.sheet->name_unquoted, &r);
}
-static void
+static void
highlight_style_changed (GnmDiffState *state, GnmRange const *r,
G_GNUC_UNUSED Sheet const *osh,
Sheet const *nsh,
@@ -724,7 +724,7 @@ compare_corresponding_cells (GnmCell const *co, GnmCell const *cn)
return !(value_equal (co->value, cn->value) &&
go_format_eq (VALUE_FMT (co->value),
VALUE_FMT (cn->value)));
-
+
return FALSE;
}
@@ -776,7 +776,7 @@ diff_sheets_cells (GnmDiffState *state, Sheet *old_sheet, Sheet *new_sheet)
state->actions->cell_changed (state, co, cn);
io++, in++;
continue;
- }
+ }
}
if (co) {
@@ -913,7 +913,7 @@ diff (char const *oldfilename, char const *newfilename,
Sheet *new_sheet = workbook_sheet_by_name (state.new.wb,
old_sheet->name_unquoted);
state.actions->sheet_start (&state, old_sheet, new_sheet);
-
+
if (new_sheet) {
if (new_sheet->index_in_wb < last_index)
sheet_order_changed = TRUE;
@@ -1000,7 +1000,7 @@ main (int argc, char const **argv)
g_printerr (_("%s: Only one output format may be specified.\n"),
g_get_prgname ());
return 1;
- }
+ }
if (ssdiff_highlight) {
actions = &highlight_actions;
diff --git a/src/value.c b/src/value.c
index 0275a70..9dae41b 100644
--- a/src/value.c
+++ b/src/value.c
@@ -1848,7 +1848,7 @@ parse_database_criteria (GnmEvalPos const *ep, GnmValue const *database, GnmValu
* @unique_only:
*
* Finds the rows from the given database that match the criteria.
- * Returns: (element-type int) (transfer full): the list of matching rows.
+ * Returns: (element-type int) (transfer full): the list of matching rows.
**/
GSList *
find_rows_that_match (Sheet *sheet, int first_col, int first_row,
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 731ad25..1823afa 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -480,7 +480,7 @@ cb_show_sheet (SheetControlGUI *scg)
{
WBCGtk *wbcg = scg->wbcg;
int page_number = gtk_notebook_page_num (wbcg->snotebook,
- GTK_WIDGET (scg->table));
+ GTK_WIDGET (scg->grid));
gnm_notebook_set_current_page (wbcg->bnotebook, page_number);
}
@@ -600,7 +600,7 @@ cb_sheet_label_button_press (GtkWidget *widget, GdkEventButton *event,
return FALSE;
page_number = gtk_notebook_page_num (wbcg->snotebook,
- GTK_WIDGET (scg->table));
+ GTK_WIDGET (scg->grid));
gnm_notebook_set_current_page (wbcg->bnotebook, page_number);
if (event->button == 1 || NULL != wbcg->rangesel)
@@ -1035,7 +1035,7 @@ cb_sheet_visibility_change (Sheet *sheet,
g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
viz = sheet_is_visible (sheet);
- gtk_widget_set_visible (GTK_WIDGET (scg->table), viz);
+ gtk_widget_set_visible (GTK_WIDGET (scg->grid), viz);
gtk_widget_set_visible (GTK_WIDGET (scg->label), viz);
wbcg_menu_state_sheet_count (scg->wbcg);
@@ -1103,7 +1103,7 @@ wbcg_sheet_add (WorkbookControl *wbc, SheetView *sv)
scg = sheet_control_gui_new (sv, wbcg);
- g_object_set_data (G_OBJECT (scg->table), SHEET_CONTROL_KEY, scg);
+ g_object_set_data (G_OBJECT (scg->grid), SHEET_CONTROL_KEY, scg);
g_object_set_data (G_OBJECT (scg->label), SHEET_CONTROL_KEY, scg);
g_signal_connect_after (G_OBJECT (scg->label),
@@ -1132,9 +1132,9 @@ wbcg_sheet_add (WorkbookControl *wbc, SheetView *sv)
NULL);
gtk_widget_show (scg->label);
- gtk_widget_show_all (GTK_WIDGET (scg->table));
+ gtk_widget_show_all (GTK_WIDGET (scg->grid));
if (!visible) {
- gtk_widget_hide (GTK_WIDGET (scg->table));
+ gtk_widget_hide (GTK_WIDGET (scg->grid));
gtk_widget_hide (GTK_WIDGET (scg->label));
}
g_object_connect (G_OBJECT (sheet),
@@ -1151,7 +1151,7 @@ wbcg_sheet_add (WorkbookControl *wbc, SheetView *sv)
*/
int pos = -1;
gtk_notebook_insert_page (wbcg->snotebook,
- GTK_WIDGET (scg->table), NULL,
+ GTK_WIDGET (scg->grid), NULL,
pos);
gnm_notebook_insert_tab (wbcg->bnotebook,
GTK_WIDGET (scg->label),
@@ -1182,7 +1182,7 @@ wbcg_sheet_remove (WorkbookControl *wbc, Sheet *sheet)
disconnect_sheet_signals (scg);
gtk_widget_destroy (GTK_WIDGET (scg->label));
- gtk_widget_destroy (GTK_WIDGET (scg->table));
+ gtk_widget_destroy (GTK_WIDGET (scg->grid));
wbcg_menu_state_sheet_count (wbcg);
}
@@ -1195,7 +1195,7 @@ wbcg_sheet_focus (WorkbookControl *wbc, Sheet *sheet)
if (scg) {
int n = gtk_notebook_page_num (wbcg->snotebook,
- GTK_WIDGET (scg->table));
+ GTK_WIDGET (scg->grid));
gnm_notebook_set_current_page (wbcg->bnotebook, n);
if (wbcg->rangesel == NULL)
@@ -1252,7 +1252,7 @@ wbcg_sheet_order_changed (WBCGtk *wbcg)
for (i = 0, l = scgs; l; l = l->next, i++) {
SheetControlGUI *scg = l->data;
gtk_notebook_reorder_child (wbcg->snotebook,
- GTK_WIDGET (scg->table),
+ GTK_WIDGET (scg->grid),
i);
gnm_notebook_move_tab (wbcg->bnotebook,
GTK_WIDGET (scg->label),
@@ -1299,7 +1299,7 @@ wbcg_sheet_remove_all (WorkbookControl *wbc)
disconnect_sheet_signals (scg);
if (scg != current) {
gtk_widget_destroy (GTK_WIDGET (scg->label));
- gtk_widget_destroy (GTK_WIDGET (scg->table));
+ gtk_widget_destroy (GTK_WIDGET (scg->grid));
}
}
@@ -1308,7 +1308,7 @@ wbcg_sheet_remove_all (WorkbookControl *wbc)
/* Do current scg last. */
if (current) {
gtk_widget_destroy (GTK_WIDGET (current->label));
- gtk_widget_destroy (GTK_WIDGET (current->table));
+ gtk_widget_destroy (GTK_WIDGET (current->grid));
}
wbcg->snotebook = tmp;
@@ -5858,7 +5858,7 @@ wbcg_get_nth_scg (WBCGtk *wbcg, int i)
if (NULL != wbcg->snotebook &&
NULL != (w = gtk_notebook_get_nth_page (wbcg->snotebook, i)) &&
NULL != (scg = get_scg (w)) &&
- NULL != scg->table &&
+ NULL != scg->grid &&
NULL != scg_sheet (scg) &&
NULL != scg_view (scg))
return scg;
diff --git a/src/workbook-view.c b/src/workbook-view.c
index cd97e1c..fde9b6d 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -993,8 +993,8 @@ workbook_view_new (Workbook *wb)
g_return_val_if_fail (wb != NULL, NULL);
- wbv = g_object_new
- (WORKBOOK_VIEW_TYPE,
+ wbv = g_object_new
+ (WORKBOOK_VIEW_TYPE,
"show-horizontal-scrollbar", TRUE,
"show-vertical-scrollbar", TRUE,
"show-notebook-tabs", TRUE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]