Commit 70e12895 authored by Jean Bréfort's avatar Jean Bréfort

Set the "hexpand" property to TRUE for toolbars. [#655858]

parent caaa1da7
2011-08-03 Jean Brefort <jean.brefort@normalesup.org>
* src/wbc-gtk.c (cb_add_menus_toolbars): set the "hexpand" property to
TRUE for toolbars. [#655858]
2011-08-02 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/wbc-gtk.c (cb_add_menus_toolbars): the box is now a GtkHandleBox
......
......@@ -149,7 +149,7 @@ go_gnm_component_render (GOComponent *component, cairo_t *cr, double width_pixel
cairo_scale (cr, ((double) width_pixels) / gognm->width, ((double) height_pixels) / gognm->height);
cairo_rectangle (cr, 0., 0., gognm->width, gognm->height);
cairo_clip (cr); /* not sure it is necessary */
gnm_gtk_print_cell_range (cr, gognm->sheet, &range, 0., 0.,
gnm_gtk_print_cell_range (cr, gognm->sheet, &range, 0., 0.,
gognm->sheet->print_info);
/* Now render objects */
gnm_print_sheet_objects (cr, gognm->sheet, &range, 0., 0.);
......@@ -302,7 +302,7 @@ go_plugin_init (GOPlugin *plugin, G_GNUC_UNUSED GOCmdContext *cc)
}
G_MODULE_EXPORT void
go_plugin_shutdown (G_GNUC_UNUSED GOPlugin *plugin,
go_plugin_shutdown (G_GNUC_UNUSED GOPlugin *plugin,
G_GNUC_UNUSED GOCmdContext *cc)
{
}
......@@ -492,7 +492,7 @@ xl_xml_data_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
"received '%s'"),
xin->content->str);
} else
v = value_new_from_string (state->val_type, xin->content->str,
v = value_new_from_string (state->val_type, xin->content->str,
NULL, FALSE);
if (NULL != state->texpr) {
if (NULL != v)
......@@ -1050,7 +1050,7 @@ xl_xml_probe_start_element (const xmlChar *name,
}
gboolean
excel_xml_file_probe (G_GNUC_UNUSED GOFileOpener const *fo,
excel_xml_file_probe (G_GNUC_UNUSED GOFileOpener const *fo,
GsfInput *input, GOFileProbeLevel pl)
{
if (pl == GO_FILE_PROBE_FILE_NAME) {
......@@ -1065,7 +1065,7 @@ excel_xml_file_probe (G_GNUC_UNUSED GOFileOpener const *fo,
}
void
excel_xml_file_open (G_GNUC_UNUSED GOFileOpener const *fo,
excel_xml_file_open (G_GNUC_UNUSED GOFileOpener const *fo,
GOIOContext *io_context,
WorkbookView *wb_view, GsfInput *input)
{
......
......@@ -71,7 +71,7 @@ xlsx_read_prop_type (GsfXMLIn *xin, GType g_type)
XLSXReadState *state = (XLSXReadState *)xin->user_state;
GValue *res = g_new0 (GValue, 1);
if (gsf_xml_gvalue_from_str (res, g_type, xin->content->str))
gsf_doc_meta_data_insert
gsf_doc_meta_data_insert
(state->metadata,
g_strdup (xin->node->user_data.v_str), res);
else
......@@ -133,7 +133,7 @@ xlsx_read_custom_property_type (GsfXMLIn *xin, GType g_type)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
GValue *res;
if (state->meta_prop_name == NULL) {
xlsx_warning (xin, _("Corrupt file: Second child element in custom property encountered."));
return;
......@@ -141,12 +141,12 @@ xlsx_read_custom_property_type (GsfXMLIn *xin, GType g_type)
res = g_new0 (GValue, 1);
if (gsf_xml_gvalue_from_str (res, g_type, xin->content->str)) {
gsf_doc_meta_data_insert
gsf_doc_meta_data_insert
(state->metadata,
state->meta_prop_name, res);
state->meta_prop_name = NULL;
} else
g_free (res);
g_free (res);
}
static void
......@@ -243,14 +243,14 @@ xlsx_read_docprops_core (XLSXReadState *state)
{
GsfInput *in;
/* optional */
in = gsf_open_pkg_open_rel_by_type
in = gsf_open_pkg_open_rel_by_type
(GSF_INPUT (state->zip),
"http://schemas.openxmlformats.org/package/2006/relationships/metadata/"
"core-properties", NULL);
if (in == NULL) return;
xlsx_parse_stream (state, in, xlsx_docprops_core_dtd);
}
static void
......@@ -258,7 +258,7 @@ xlsx_read_docprops_extended (XLSXReadState *state)
{
GsfInput *in;
/* optional */
in = gsf_open_pkg_open_rel_by_type
in = gsf_open_pkg_open_rel_by_type
(GSF_INPUT (state->zip),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"
"extended-properties", NULL);
......@@ -272,7 +272,7 @@ xlsx_read_docprops_custom (XLSXReadState *state)
{
GsfInput *in;
/* optional */
in = gsf_open_pkg_open_rel_by_type
in = gsf_open_pkg_open_rel_by_type
(GSF_INPUT (state->zip),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"
"custom-properties", NULL);
......
......@@ -965,7 +965,7 @@ xlsx_chart_grad_linear (GsfXMLIn *xin, xmlChar const **attrs)
g_return_if_fail (state->cur_style);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_int (xin, attrs, "ang", &ang))
state->cur_style->fill.gradient.dir
state->cur_style->fill.gradient.dir
= xlsx_get_gradient_direction (ang / 60000.);
/* FIXME: we do not support the "scaled" attribute */
}
......
......@@ -3497,7 +3497,7 @@ xlsx_col_elem_begin (GsfXMLIn *xin, xmlChar const **attrs)
static void
xlsx_col_border_begin (GsfXMLIn *xin, xmlChar const **attrs)
{
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
gboolean diagonal_down = FALSE, diagonal_up = FALSE;
......@@ -3505,16 +3505,16 @@ xlsx_col_border_begin (GsfXMLIn *xin, xmlChar const **attrs)
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_bool (xin, attrs, "diagonalDown", &diagonal_down)) ;
else (attr_bool (xin, attrs, "diagonalUp", &diagonal_up)) ;
if (diagonal_up) {
GnmBorder *border = gnm_style_border_fetch
GnmBorder *border = gnm_style_border_fetch
(GNM_STYLE_BORDER_THIN, style_color_black (), GNM_STYLE_BORDER_DIAGONAL);
gnm_style_set_border (state->style_accum,
MSTYLE_BORDER_DIAGONAL,
border);
}
if (diagonal_down) {
GnmBorder *border = gnm_style_border_fetch
GnmBorder *border = gnm_style_border_fetch
(GNM_STYLE_BORDER_HAIR, style_color_black (), GNM_STYLE_BORDER_DIAGONAL);
gnm_style_set_border (state->style_accum,
MSTYLE_BORDER_REV_DIAGONAL,
......@@ -3746,7 +3746,7 @@ xlsx_border_diagonal_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
if (NULL == state->border_color)
state->border_color = style_color_black ();
new_border = gnm_style_border_fetch
new_border = gnm_style_border_fetch
(state->border_style, state->border_color, GNM_STYLE_BORDER_DIAGONAL);
border = gnm_style_get_border (state->style_accum, MSTYLE_BORDER_REV_DIAGONAL);
......
......@@ -171,12 +171,12 @@ xlsx_pivot_date_fmt (void)
*
* Returns a GOGradientDirection corresponding to the angle ang (0...360)
**/
GOGradientDirection
GOGradientDirection
xlsx_get_gradient_direction (double ang)
{
int ang_i;
g_return_val_if_fail (ang >=-360. && ang <= 360., GO_GRADIENT_N_TO_S);
ang_i = ang;
while (ang_i < 0)
ang_i += 360;
......
......@@ -2,7 +2,7 @@
/**
* xls-write-docprops.c: MS Excel XLSX export of document properties
*
* Copyright (C) 2011 Andreas J. Guelzow, All rights reserved
* Copyright (C) 2011 Andreas J. Guelzow, All rights reserved
* aguelzow@pyrshep.ca
*
* This program is free software; you can redistribute it and/or
......@@ -76,7 +76,7 @@ xlsx_map_to_bool (GsfXMLOut *output, GValue const *val)
xlsx_add_bool (output, NULL, g_value_get_int (val) != 0);
break;
case G_TYPE_STRING:
xlsx_add_bool (output, NULL,
xlsx_add_bool (output, NULL,
0 == g_ascii_strcasecmp (g_value_get_string (val), "true")
|| 0 == g_ascii_strcasecmp (g_value_get_string (val), "yes"));
break;
......@@ -108,8 +108,8 @@ xlsx_map_to_date_core (GsfXMLOut *output, GValue const *val)
gsf_timestamp_set_time (ts, tm.tv_sec);
str = gsf_timestamp_as_string (ts);
gsf_xml_out_add_cstr (output, NULL, str);
g_free (str);
}
g_free (str);
}
}
static void
......@@ -134,7 +134,7 @@ xlsx_map_to_keys (GsfXMLOut *output, GValue const *val)
/* sets of keywords depending on laguage */
g_free (str);
}
}
}
}
static output_function
......@@ -143,7 +143,7 @@ xlsx_map_prop_name_to_output_fun (char const *name)
/* shared by all instances and never freed */
static GHashTable *xlsx_prop_name_map_output_fun_extended = NULL;
if (NULL == xlsx_prop_name_map_output_fun_extended)
if (NULL == xlsx_prop_name_map_output_fun_extended)
{
static struct {
char const *gsf_key;
......@@ -189,7 +189,7 @@ xlsx_map_prop_name_extended (char const *name)
/* shared by all instances and never freed */
static GHashTable *xlsx_prop_name_map_extended = NULL;
if (NULL == xlsx_prop_name_map_extended)
if (NULL == xlsx_prop_name_map_extended)
{
static struct {
char const *gsf_key;
......@@ -237,7 +237,7 @@ xlsx_map_prop_name_extended (char const *name)
/* GSF_META_NAME_OBJECT_COUNT */
/* GSF_META_NAME_SPREADSHEET_COUNT */
/* GSF_META_NAME_TABLE_COUNT */
/* GSF_META_NAME_GENERATOR stored as Application and AppVersion */
/* GSF_META_NAME_GENERATOR stored as Application and AppVersion */
/* GSF_META_NAME_KEYWORD cmp with GSF_META_NAME_KEYWORDS in core*/
/* GSF_META_NAME_LAST_PRINTED cmp with GSF_META_NAME_PRINT_DATE in core*/
/* GSF_META_NAME_PRINTED_BY */
......@@ -263,7 +263,7 @@ xlsx_meta_write_props_extended (char const *prop_name, GsfDocProp *prop, GsfXMLO
if (NULL != (mapped_name = xlsx_map_prop_name_extended (prop_name))) {
gsf_xml_out_start_element (output, mapped_name);
if (NULL != val) {
output_function of = xlsx_map_prop_name_to_output_fun
output_function of = xlsx_map_prop_name_to_output_fun
(prop_name);
if (of != NULL)
of (output, val);
......@@ -277,7 +277,7 @@ xlsx_meta_write_props_extended (char const *prop_name, GsfDocProp *prop, GsfXMLO
static void
xlsx_write_docprops_app (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfile *docprops_dir)
{
GsfOutput *part = gsf_outfile_open_pkg_add_rel
GsfOutput *part = gsf_outfile_open_pkg_add_rel
(docprops_dir, "app.xml",
"application/vnd.openxmlformats-officedocument.extended-properties+xml",
root_part,
......@@ -298,10 +298,10 @@ xlsx_write_docprops_app (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfil
gsf_xml_out_add_float (xml, NULL, version, 5);
gsf_xml_out_end_element (xml); /* </AppVersion> */
gsf_doc_meta_data_foreach (meta, (GHFunc) xlsx_meta_write_props_extended, xml);
gsf_doc_meta_data_foreach (meta, (GHFunc) xlsx_meta_write_props_extended, xml);
gsf_xml_out_end_element (xml); /* </Properties> */
g_object_unref (xml);
gsf_output_close (part);
g_object_unref (part);
......@@ -313,7 +313,7 @@ xlsx_map_prop_name (char const *name)
/* shared by all instances and never freed */
static GHashTable *xlsx_prop_name_map = NULL;
if (NULL == xlsx_prop_name_map)
if (NULL == xlsx_prop_name_map)
{
static struct {
char const *gsf_key;
......@@ -356,9 +356,9 @@ xlsx_meta_write_props (char const *prop_name, GsfDocProp *prop, GsfXMLOut *outpu
GValue const *val = gsf_doc_prop_get_val (prop);
if (NULL != (mapped_name = xlsx_map_prop_name (prop_name))) {
gsf_xml_out_start_element (output, mapped_name);
gsf_xml_out_start_element (output, mapped_name);
if (NULL != val) {
output_function of = xlsx_map_prop_name_to_output_fun
output_function of = xlsx_map_prop_name_to_output_fun
(prop_name);
if (of != NULL)
of (output, val);
......@@ -373,7 +373,7 @@ xlsx_meta_write_props (char const *prop_name, GsfDocProp *prop, GsfXMLOut *outpu
static void
xlsx_write_docprops_core (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfile *docprops_dir)
{
GsfOutput *part = gsf_outfile_open_pkg_add_rel
GsfOutput *part = gsf_outfile_open_pkg_add_rel
(docprops_dir, "core.xml",
"application/vnd.openxmlformats-package.core-properties+xml",
root_part,
......@@ -391,7 +391,7 @@ xlsx_write_docprops_core (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfi
gsf_doc_meta_data_foreach (meta, (GHFunc) xlsx_meta_write_props, xml);
gsf_xml_out_end_element (xml); /* </cp:coreProperties> */
g_object_unref (xml);
gsf_output_close (part);
g_object_unref (part);
......@@ -403,7 +403,7 @@ xlsx_map_to_pid (char const *name)
/* shared by all instances and never freed */
static GHashTable *xlsx_pid_map = NULL;
if (NULL == xlsx_pid_map)
if (NULL == xlsx_pid_map)
{
static struct {
char const *name_key;
......@@ -425,11 +425,11 @@ xlsx_map_to_pid (char const *name)
}
static void
xlsx_meta_write_props_custom_type (char const *prop_name, GValue const *val, GsfXMLOut *xml, char const *type,
xlsx_meta_write_props_custom_type (char const *prop_name, GValue const *val, GsfXMLOut *xml, char const *type,
int *custom_pid)
{
int pid = xlsx_map_to_pid (prop_name);
gsf_xml_out_start_element (xml, "property");
gsf_xml_out_add_cstr_unchecked (xml, "fmtid", "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}");
......@@ -443,7 +443,7 @@ xlsx_meta_write_props_custom_type (char const *prop_name, GValue const *val, Gsf
gsf_xml_out_start_element (xml, type);
if (NULL != val)
gsf_xml_out_add_gvalue (xml, NULL, val);
gsf_xml_out_end_element (xml);
gsf_xml_out_end_element (xml);
gsf_xml_out_end_element (xml); /* </property> */
}
......@@ -451,7 +451,7 @@ static void
xlsx_meta_write_props_custom (char const *prop_name, GsfDocProp *prop, GsfXMLOut *output)
{
int custom_pid = 29;
if ((0 != strcmp (GSF_META_NAME_GENERATOR, prop_name)) && (NULL == xlsx_map_prop_name (prop_name))
if ((0 != strcmp (GSF_META_NAME_GENERATOR, prop_name)) && (NULL == xlsx_map_prop_name (prop_name))
&& (NULL == xlsx_map_prop_name_extended (prop_name))) {
GValue const *val = gsf_doc_prop_get_val (prop);
if (VAL_IS_GSF_TIMESTAMP(val))
......@@ -480,7 +480,7 @@ xlsx_meta_write_props_custom (char const *prop_name, GsfDocProp *prop, GsfXMLOut
static void
xlsx_write_docprops_custom (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfile *docprops_dir)
{
GsfOutput *part = gsf_outfile_open_pkg_add_rel
GsfOutput *part = gsf_outfile_open_pkg_add_rel
(docprops_dir, "custom.xml",
"application/vnd.openxmlformats-officedocument.custom-properties+xml",
root_part,
......@@ -495,7 +495,7 @@ xlsx_write_docprops_custom (XLSXWriteState *state, GsfOutfile *root_part, GsfOut
gsf_doc_meta_data_foreach (meta, (GHFunc) xlsx_meta_write_props_custom, xml);
gsf_xml_out_end_element (xml); /* </Properties> */
g_object_unref (xml);
gsf_output_close (part);
g_object_unref (part);
......
......@@ -273,7 +273,7 @@ xlsx_write_pivot_cache_definition (XLSXWriteState *state, GsfOutfile *wb_part,
if (cache->refreshed_by) gsf_xml_out_add_cstr (xml, "refreshedBy", cache->refreshed_by);
if (cache->refreshed_on) {
if (state->version == ECMA_376_2006)
gsf_xml_out_add_float (xml, "refreshedDate",
gsf_xml_out_add_float (xml, "refreshedDate",
go_val_as_float (cache->refreshed_on), -1);
else {
GOFormat const *format = go_format_new_from_XL ("yyyy-mm-dd\"T\"hh:mm:ss");
......@@ -281,7 +281,7 @@ xlsx_write_pivot_cache_definition (XLSXWriteState *state, GsfOutfile *wb_part,
gsf_xml_out_add_cstr_unchecked (xml, "refreshedDateIso", date);
g_free (date);
go_format_unref (format);
}
}
}
gsf_xml_out_add_int (xml, "createdVersion", cache->XL_created_ver);
gsf_xml_out_add_int (xml, "refreshedVersion", cache->XL_refresh_ver);
......
This diff is collapsed.
......@@ -426,7 +426,7 @@ gnumeric_interpolation (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
g_free (vals2);
return value_new_error_std (ei->pos, GNM_ERROR_VALUE);
}
/* argv[3] */
if (argv[3]) {
......@@ -464,9 +464,9 @@ gnumeric_interpolation (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
/* argv[0] & argv[1] */
flags = COLLECT_IGNORE_BLANKS | COLLECT_IGNORE_STRINGS | COLLECT_IGNORE_BOOLS;
error = collect_float_pairs (argv[0], argv[1], ei->pos, flags, &vals0, &vals1,
error = collect_float_pairs (argv[0], argv[1], ei->pos, flags, &vals0, &vals1,
&n0, &constp);
if (error) {
......
......@@ -509,7 +509,7 @@ make_function (LotusState *state, GnmExprList **stack, guint8 const *data, const
f = works_ordinal_to_info[*data];
} else {
if (*data <= LOTUS_MAX_ORDINAL)
f = lotus_ordinal_to_info[*data];
f = lotus_ordinal_to_info[*data];
}
if (f == NULL) {
......@@ -861,7 +861,7 @@ lotus_parse_formula_new (LotusState *state, GnmParsePos *orig,
if (!g_ascii_isalnum (p[-1]))
break;
f = g_hash_table_lookup ((state->is_works) ?
f = g_hash_table_lookup ((state->is_works) ?
works_funcname_to_info
: lotus_funcname_to_info, p);
handle_named_func (&stack, orig,
......
......@@ -2462,8 +2462,8 @@ cell_set_fmt (LotusState *state, GnmCell *cell, int fmt)
range.start = cell->pos;
range.end = range.start;
style = g_hash_table_lookup (state->style_pool,
style = g_hash_table_lookup (state->style_pool,
GINT_TO_POINTER (fmt));
if (style) {
......@@ -2795,7 +2795,7 @@ lotus_read_works (LotusState *state, record_t *r)
memcpy(font->typeface, r->data + 2, l);
font->typeface[l] = 0;
font->size = r->data[36];
codepage = gnm_font_override_codepage (font->typeface);
if (codepage != -1)
font->converter = gsf_msole_iconv_open_for_import (codepage);
......
This diff is collapsed.
This diff is collapsed.
......@@ -477,7 +477,7 @@ gnm_app_create_opener_filter (GList *openers)
GtkFileFilter *filter = gtk_file_filter_new ();
gboolean for_history = (openers == NULL);
if (openers == NULL)
openers = go_get_file_openers ();
......
......@@ -195,7 +195,7 @@ get_single_floats_cache_entry (GnmValue const *value, CollectFlags flags)
}
static PairsFloatsCacheEntry *
get_pairs_floats_cache_entry (GnmValue const *vx, GnmValue const *vy,
get_pairs_floats_cache_entry (GnmValue const *vx, GnmValue const *vy,
CollectFlags flags)
{
PairsFloatsCacheEntry key;
......@@ -235,7 +235,7 @@ get_or_fake_cache_entry (GnmValue const *key, CollectFlags flags,
}
static PairsFloatsCacheEntry *
get_or_fake_pairs_cache_entry (GnmValue const *key_x, GnmValue const *key_y,
get_or_fake_pairs_cache_entry (GnmValue const *key_x, GnmValue const *key_y,
CollectFlags flags,
GnmEvalPos const *ep)
{
......@@ -285,7 +285,7 @@ get_single_cache_key (GnmExpr const *e, GnmEvalPos const *ep)
return v;
} else
return NULL;
}
/* ------------------------------------------------------------------------- */
......@@ -692,7 +692,7 @@ collect_float_pairs_ce (GnmValue const *vx, GnmValue const *vy,
&n0, &missing0, &ce->error);
if (ce->error)
goto err;
ce->data_y = collect_floats_value_with_info (vy, ep, flags,
&n1, &missing1, &ce->error);
......@@ -711,7 +711,7 @@ collect_float_pairs_ce (GnmValue const *vx, GnmValue const *vy,
gnm_strip_missing (ce->data_y, &n1, missing0);
}
ce->n = n0;
err:
if (ce->n <= 0) {
g_free (ce->data_x);
......@@ -778,7 +778,7 @@ collect_float_pairs (GnmValue const *vx, GnmValue const *vy,
g_hash_table_replace (pairs_floats_cache, ce, ce);
total_cache_size += 1 + ce->n;
}
}
}
if (free_keys) {
value_release (key_x);
......@@ -821,8 +821,8 @@ collect_float_pairs (GnmValue const *vx, GnmValue const *vy,
ce->data_x = NULL;
ce->data_y = NULL;
pairs_floats_cache_entry_free (ce);
}
return NULL;
}
return NULL;
}
}
......
......@@ -1449,7 +1449,7 @@ cmd_insert_cols (WorkbookControl *wbc,
{
char *mesg;
GnmRange r;
range_init_full_sheet (&r, sheet);
r.start.row = r.end.row - count + 1;
......
#ifndef GNUMERIC_GTK_COMPILATION_H
#define GNUMERIC_GTK_COMPILATION_H
#if defined(__GNUC__)
#if defined(__GNUC__)
#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ )
#if (GCC_VERSION >= 402)
#if (GCC_VERSION >= 406)
......
......@@ -527,7 +527,7 @@ tool_load_selection (GenericToolState *state, gboolean allow_multiple)
gtk_widget_show (state->dialog);
gnm_expr_entry_grab_focus (GNM_EXPR_ENTRY (state->input_entry),
TRUE);
}
......
This diff is collapsed.
......@@ -212,7 +212,7 @@ typedef struct _FormatState {
} input_msg;
struct {
gboolean is_selector;
GtkWindow *w;
GtkWindow *w;
gpointer closure;
} style_selector;
......@@ -2024,14 +2024,14 @@ cb_fmt_dialog_dialog_buttons (GtkWidget *btn, FormatState *state)
for (i = GNM_STYLE_BORDER_TOP; i <= GNM_STYLE_BORDER_DIAG; i++) {
GnmBorder *b = border_get_mstyle (state, i);
if (b)
gnm_style_set_border
(state->result,
MSTYLE_BORDER_TOP +
gnm_style_set_border
(state->result,
MSTYLE_BORDER_TOP +
(int)(i - GNM_STYLE_BORDER_TOP),
b);
}
gnm_style_merge (style, state->result);
dialog_cell_format_style_added
dialog_cell_format_style_added
(state->style_selector.closure,
style);
gnm_style_unref (state->result);
......@@ -2530,7 +2530,7 @@ dialog_cell_format (WBCGtk *wbcg, FormatDialogPosition_t pageno)
*/
void
dialog_cell_format_select_style (WBCGtk *wbcg, gint pages,
dialog_cell_format_select_style (WBCGtk *wbcg, gint pages,
GtkWindow *w,
GnmStyle *style, gpointer closure)
{
......@@ -2558,7 +2558,7 @@ dialog_cell_format_select_style (WBCGtk *wbcg, gint pages,
fmt_dialog_impl (state, FD_BACKGROUND);
for (i = 0; i <= FD_LAST; i++) {
GtkWidget *widget = gtk_notebook_get_nth_page
GtkWidget *widget = gtk_notebook_get_nth_page
(state->notebook, i);
if (widget != NULL && !((1<<i) & pages))
gtk_widget_hide (widget);
......@@ -2566,7 +2566,7 @@ dialog_cell_format_select_style (WBCGtk *wbcg, gint pages,
gtk_widget_hide (state->apply_button);
go_gtk_window_set_transient (GTK_WINDOW (w),
go_gtk_window_set_transient (GTK_WINDOW (w),
GTK_WINDOW (state->dialog));
gtk_window_set_modal (GTK_WINDOW (state->dialog), TRUE);
gtk_widget_show (GTK_WIDGET (state->dialog));
......
......@@ -148,7 +148,7 @@ typedef struct {
} DialogDocMetaData;
static gchar *dialog_doc_metadata_get_prop_val (DialogDocMetaData *state, char const *prop_name,
static gchar *dialog_doc_metadata_get_prop_val (DialogDocMetaData *state, char const *prop_name,
GValue *prop_value);
static gboolean cb_dialog_doc_metadata_ppt_changed (G_GNUC_UNUSED GtkEntry *entry,
......@@ -224,15 +224,15 @@ dialog_doc_metadata_get_value_type_from_name (gchar const *name, GType def)
g_hash_table_insert (dialog_doc_metadata_name_to_type,
(gpointer)map_vector[i],
GINT_TO_POINTER (GSF_DOCPROP_VECTOR_TYPE));
i = G_N_ELEMENTS (map_timestamps);
while (i-- > 0)
g_hash_table_insert (dialog_doc_metadata_name_to_type,
(gpointer)map_timestamps[i],
GINT_TO_POINTER (GSF_TIMESTAMP_TYPE));
}
res = g_hash_table_lookup (dialog_doc_metadata_name_to_type, name);
if (res != NULL)
......@@ -329,12 +329,12 @@ dialog_doc_metadata_transform_str_to_float (const GValue *string_value,
g_return_if_fail (G_VALUE_HOLDS_STRING (string_value));
g_return_if_fail (G_VALUE_HOLDS_FLOAT (float_value));
str = g_value_get_string (string_value);
conversion = format_match_number (str, NULL, NULL);
if (conversion) {
x = value_get_as_float (conversion);
value_release (conversion);
value_release (conversion);
} else
x = 0.;
......@@ -351,7 +351,7 @@ dialog_doc_metadata_transform_str_to_boolean (const GValue *string_value,
g_return_if_fail (G_VALUE_HOLDS_STRING (string_value));
g_return_if_fail (G_VALUE_HOLDS_BOOLEAN (b_value));
str = g_value_get_string (string_value);
conversion = format_match_number (str, NULL, NULL);
if (conversion) {
......@@ -418,10 +418,10 @@ time2str (time_t t)
char buffer[4000];
gsize len;
char const *format = "%c";
if (t == -1)
return NULL;
len = strftime (buffer, sizeof (buffer), format, localtime (&t));
if (len == 0)
return NULL;
......@@ -516,13 +516,13 @@ gnm_docprop_vector_as_string (GsfDocPropVector *vector)
num_values = gva->n_values;
rstring = g_string_sized_new (num_values * 8);
for (i = 0; i < num_values; i++) {
char *str;
GValue *v;
v = g_value_array_get_nth (gva, i);
if (G_VALUE_TYPE(v) == G_TYPE_STRING)
str = g_strescape (g_value_get_string (v), "");
else {
......@@ -771,7 +771,7 @@ dialog_doc_metadata_add_prop (DialogDocMetaData *state,
const gchar *link,
GType val_type)
{
gboolean editable = (val_type != G_TYPE_INVALID)
gboolean editable = (val_type != G_TYPE_INVALID)
&& (val_type != GSF_DOCPROP_VECTOR_TYPE);
if (value == NULL)
value = "";
......@@ -859,7 +859,7 @@ dialog_doc_metadata_set_gsf_prop (DialogDocMetaData *state,
if (value != NULL && *value == 0)
value = NULL;
if ((value == NULL) && (link == NULL)) {
if ((existing_prop == NULL) ||
if ((existing_prop == NULL) ||
((existing_value == NULL) && (existing_link == NULL)))
return G_TYPE_INVALID;
else {
......@@ -881,7 +881,7 @@ dialog_doc_metadata_set_gsf_prop (DialogDocMetaData *state,
link_changed = TRUE;
else
link_changed = (0 != strcmp (link, existing_link));
if (existing_value == NULL)
value_changed = (value != NULL);
else if (G_VALUE_HOLDS_STRING (existing_value) && (type == 0 || type == G_TYPE_STRING)) {
......@@ -956,7 +956,7 @@ dialog_doc_metadata_set_prop (DialogDocMetaData *state,
g_return_if_fail (state->metadata != NULL);
val_type = dialog_doc_metadata_set_gsf_prop (state, prop_name, prop_value,
val_type = dialog_doc_metadata_set_gsf_prop (state, prop_name, prop_value,
link_value, type);
/* Due to changes in type, prop_value may have changed */
......@@ -985,13 +985,13 @@ dialog_doc_metadata_set_prop (DialogDocMetaData *state,
value);
if (strcmp (prop_name, g_value