compose->modified = FALSE;
compose->return_receipt = FALSE;
- compose->paste_as_quotation = FALSE;
compose->to_list = NULL;
compose->newsgroup_list = NULL;
{
if (compose->focused_editable &&
GTK_WIDGET_HAS_FOCUS(compose->focused_editable)) {
- compose->paste_as_quotation = TRUE;
+ /* let text_insert() (called directly or at a later time
+ * after the gtk_editable_paste_clipboard) know that
+ * text is to be inserted as a quotation. implemented
+ * by using a simple refcount... */
+ gint paste_as_quotation = GPOINTER_TO_INT(gtk_object_get_data(
+ GTK_OBJECT(compose->focused_editable),
+ "paste_as_quotation"));
+ gtk_object_set_data(GTK_OBJECT(compose->focused_editable),
+ "paste_as_quotation",
+ GINT_TO_POINTER(paste_as_quotation + 1));
gtk_editable_paste_clipboard
(GTK_EDITABLE(compose->focused_editable));
- compose->paste_as_quotation = FALSE;
}
}
gint length, gint *position, Compose *compose)
{
GtkEditable *editable = GTK_EDITABLE(widget);
+ gint paste_as_quotation = GPOINTER_TO_INT(gtk_object_get_data
+ (GTK_OBJECT(widget), "paste_as_quotation"));
gtk_signal_handler_block_by_func(GTK_OBJECT(widget),
GTK_SIGNAL_FUNC(text_inserted),
compose);
- if (compose->paste_as_quotation) {
+ if (paste_as_quotation) {
gchar *new_text;
gchar *qmark;
gint pos;
gtk_editable_set_position(editable, pos);
*position = pos;
g_free(new_text);
+ gtk_object_set_data(GTK_OBJECT(widget), "paste_as_quotation",
+ GINT_TO_POINTER(paste_as_quotation - 1));
} else
gtk_editable_insert_text(editable, text, length, position);