1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4 * command-context.c: Gnumeric specific extensions to GOCmdContext
6 * Copyright (C) 1999-2005 Jody Goldberg (jody@gnome.org)
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) version 3.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 #include <gnumeric-config.h>
25 #include "command-context.h"
28 #include <glib/gi18n-lib.h>
30 #define CC_CLASS(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GO_TYPE_CMD_CONTEXT, GOCmdContextClass))
33 format_message (GQuark id
, char const *message
)
35 char const *msg
= message
? message
: "";
36 return g_error_new_literal (id
, 0, msg
);
40 gnm_cmd_context_error_calc (GOCmdContext
*context
, char const *msg
)
42 GError
*err
= format_message (gnm_error_calc (), msg
);
43 go_cmd_context_error (context
, err
);
48 gnm_cmd_context_error_splits_array (GOCmdContext
*context
,
49 G_GNUC_UNUSED
char const *cmd
,
50 GnmRange
const *array
)
55 err
= g_error_new (gnm_error_array(), 1,
56 _("Would split array %s"), range_as_string (array
));
58 err
= g_error_new (gnm_error_array(), 0,
59 _("Would split an array"));
60 go_cmd_context_error (context
, err
);
65 gnm_cmd_context_error_splits_merge (GOCmdContext
*context
,
66 GnmRange
const *merge
)
69 g_error_new (gnm_error_array(), 1,
70 _("Would split merge %s"),
71 range_as_string (merge
));
72 go_cmd_context_error (context
, err
);
77 gnm_error_array (void)
81 quark
= g_quark_from_static_string ("gnm_error_array");
90 quark
= g_quark_from_static_string ("gnm_error_calc");