Commit 6c972dc3 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Use range 0-INT_MAX so we don't split anything. (cb_entry_cursor_pos):

2004-12-20  Morten Welinder  <terra@gnome.org>

	* src/workbook-edit.c (wbcg_edit_add_markup): Use range 0-INT_MAX
	so we don't split anything.
	(cb_entry_cursor_pos): Ditto.
	(wbcg_edit_init_markup): The .cur_fmt from markup, not
	full_content, so we don't end up setting font sizes, etc.
	(cb_entry_cursor_pos): Don't do anything if the entry is empty.
parent a93ec9dd
2004-12-20 Morten Welinder <terra@gnome.org>
* src/workbook-edit.c (wbcg_edit_add_markup): Use range 0-INT_MAX
so we don't split anything.
(cb_entry_cursor_pos): Ditto.
(wbcg_edit_init_markup): The .cur_fmt from markup, not
full_content, so we don't end up setting font sizes, etc.
(cb_entry_cursor_pos): Don't do anything if the entry is empty.
2004-12-20 Morten Welinder <terra@gnome.org>
* src/workbook-edit.c (cb_delete_filter): Be much more careful.
......
......@@ -31,6 +31,7 @@ Morten:
* Fix inserting new characters into a rich text string.
* Fix deleting more than one character at once from a rich text
string.
* Fix rich text problem when starting from empty. [#161723].
--------------------------------------------------------------------------
Gnumeric 1.4.1
......
2004-12-20 Morten Welinder <terra@gnome.org>
* src/workbook-edit.c (wbcg_edit_add_markup): Use range 0-INT_MAX
so we don't split anything.
(cb_entry_cursor_pos): Ditto.
(wbcg_edit_init_markup): The .cur_fmt from markup, not
full_content, so we don't end up setting font sizes, etc.
(cb_entry_cursor_pos): Don't do anything if the entry is empty.
2004-12-20 Morten Welinder <terra@gnome.org>
* src/workbook-edit.c (cb_delete_filter): Be much more careful.
......
......@@ -368,6 +368,9 @@ cb_entry_cursor_pos (WorkbookControlGUI *wbcg)
GtkEditable *entry = GTK_EDITABLE (wbcg_get_entry (wbcg));
char const *str = gtk_entry_get_text (GTK_ENTRY (entry));
if (str[0] == 0)
return;
/* 1) Use first selected character if there is a selection
* 2) Use the character just before the edit pos if it exists
* 3) Use the first character */
......@@ -402,7 +405,7 @@ cb_entry_cursor_pos (WorkbookControlGUI *wbcg)
for (ptr = attrs; ptr != NULL ; ptr = ptr->next) {
PangoAttribute *attr = ptr->data;
attr->start_index = 0;
attr->end_index = 1;
attr->end_index = INT_MAX;
pango_attr_list_change (new_list, attr);
}
g_slist_free (attrs);
......@@ -489,7 +492,7 @@ wbcg_edit_init_markup (WorkbookControlGUI *wbcg, PangoAttrList *markup)
wbcg->edit_line.full_content = mstyle_generate_attrs_full (
sheet_style_get (sv->sheet, sv->edit_pos.col, sv->edit_pos.row));
pango_attr_list_splice (wbcg->edit_line.full_content, markup, 0, 0);
wbcg->edit_line.cur_fmt = pango_attr_list_copy (wbcg->edit_line.full_content);
wbcg->edit_line.cur_fmt = pango_attr_list_copy (markup);
wbcg->edit_line.signal_insert = g_signal_connect (
entry, "insert-text",
......@@ -533,7 +536,7 @@ wbcg_edit_add_markup (WorkbookControlGUI *wbcg, PangoAttribute *attr)
/* the format to use when inserting text, we will resize it later */
attr->start_index = 0;
attr->end_index = 1;
attr->end_index = INT_MAX;
pango_attr_list_change (wbcg->edit_line.cur_fmt, attr);
g_signal_emit (G_OBJECT (wbcg), wbcg_signals [WBCG_MARKUP_CHANGED], 0);
}
......
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