Commit 238656c3 authored by Morten Welinder's avatar Morten Welinder

GUI: Fix rich text entry problem.

parent 8634b10f
2014-03-11 Morten Welinder <terra@gnome.org>
* src/sheet.c (cb_set_markup): Don't mess directly with
cell->value. We need to trigger a re-render. Fixes #726086.
* src/wbc-gtk-edit.c (wbcg_edit_finish): Also supply the markup
for the pre-validation assignment.
* src/sheet.c (sheet_cell_set_text): Put markup on the value
before assigning it to the cell.
2014-03-10 Morten Welinder <terra@gnome.org>
* gnumeric.xsd: Update valign/halign attributes. Update print
......
......@@ -14,6 +14,7 @@ Morten:
* Import/Export super/subscript fonts to xlsx. [Part of #726035]
* Import xlsx auto-filters. [#725460]
* Update Gnumeric schema.
* Fix rich text problem. [#726086]
--------------------------------------------------------------------------
Gnumeric 1.12.12
......
......@@ -2879,10 +2879,14 @@ cb_set_markup (GnmCellIter const *iter, PangoAttrList *markup)
if (VALUE_IS_STRING (cell->value)) {
GOFormat *fmt;
GnmValue *val = value_dup (cell->value);
fmt = go_format_new_markup (markup, TRUE);
value_set_fmt (cell->value, fmt);
value_set_fmt (val, fmt);
go_format_unref (fmt);
gnm_cell_cleanout (cell);
gnm_cell_assign_value (cell, val);
}
return NULL;
}
......@@ -2985,8 +2989,7 @@ sheet_cell_set_text (GnmCell *cell, char const *text, PangoAttrList *markup)
} else {
g_return_if_fail (val != NULL);
gnm_cell_set_value (cell, val);
if (markup != NULL && VALUE_IS_STRING (cell->value)) {
if (markup != NULL && VALUE_IS_STRING (val)) {
gboolean quoted = (text[0] == '\'');
PangoAttrList *adj_markup;
GOFormat *fmt;
......@@ -2999,12 +3002,14 @@ sheet_cell_set_text (GnmCell *cell, char const *text, PangoAttrList *markup)
adj_markup = markup;
fmt = go_format_new_markup (adj_markup, TRUE);
value_set_fmt (cell->value, fmt);
value_set_fmt (val, fmt);
go_format_unref (fmt);
if (quoted)
pango_attr_list_unref (adj_markup);
}
gnm_cell_set_value (cell, val);
/* Queue recalc before spanning, see above. */
cell_queue_recalc (cell);
......
......@@ -381,7 +381,7 @@ wbcg_edit_finish (WBCGtk *wbcg, WBCEditResult result,
cell = sheet_cell_fetch (sheet,
sv->edit_pos.col,
sv->edit_pos.row);
sheet_cell_set_text (cell, txt, NULL);
sheet_cell_set_text (cell, txt, wbcg->edit_line.markup);
valid = gnm_validation_eval (wbc, mstyle, sheet, &sv->edit_pos, showed_dialog);
break;
}
......
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