Commit 7c949552 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Don't override a user format.

2003-06-30  Morten Welinder  <terra@gnome.org>

	* src/commands.c (cmd_set_text_redo): Don't override a user
	format.
parent ed2c6c03
2003-06-30 Morten Welinder <terra@gnome.org>
* src/commands.c (cmd_set_text_redo): Don't override a user
format.
* src/gui-clipboard.c (text_to_cell_region): Handle column
selection here too.
* src/stf-parse.c (stf_parse_region): Ditto.
......
2003-06-30 Morten Welinder <terra@gnome.org>
* src/commands.c (cmd_set_text_redo): Don't override a user
format.
* src/gui-clipboard.c (text_to_cell_region): Handle column
selection here too.
* src/stf-parse.c (stf_parse_region): Ditto.
......
2003-06-30 Morten Welinder <terra@gnome.org>
* src/commands.c (cmd_set_text_redo): Don't override a user
format.
* src/gui-clipboard.c (text_to_cell_region): Handle column
selection here too.
* src/stf-parse.c (stf_parse_region): Ditto.
......
......@@ -776,6 +776,7 @@ typedef struct
EvalPos pos;
gchar *text;
gboolean has_user_format;
CellRegion *old_contents;
} CmdSetText;
......@@ -807,7 +808,7 @@ cmd_set_text_redo (GnumericCommand *cmd, WorkbookControl *wbc)
sheet_cell_set_text (cell, me->text);
expr = cell->base.expression;
if (expr) {
if (!me->has_user_format && expr) {
EvalPos ep;
StyleFormat *sf = auto_style_format_suggest (expr,
eval_pos_init (&ep, me->cmd.sheet, &me->pos.eval));
......@@ -886,6 +887,11 @@ cmd_set_text (WorkbookControl *wbc,
g_free (where);
g_free (text);
me->has_user_format =
!style_format_is_general
(mstyle_get_format (sheet_style_get (sheet,
pos->col, pos->row)));
/* Register the command object */
return command_push_undo (wbc, obj);
}
......
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