[evolution/gnome-3-20] EHTMLEditorView - Redoing a delete operation in a PRE element could wrap the content in SPAN element



commit 648ec4ab54ac3d09619e3b518359ce81c2cc927f
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Jun 1 14:58:24 2016 +0200

    EHTMLEditorView - Redoing a delete operation in a PRE element could wrap the content in SPAN element
    
    There was one case unhandled in commit b962cc71.

 e-util/e-html-editor-view.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 17527ed..1147dd2 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -13510,7 +13510,9 @@ redo_delete (EHTMLEditorView *view,
        gboolean delete_key, control_key;
        glong length = 1;
        gint ii;
+       WebKitDOMDocument *document;
        WebKitDOMDocumentFragment *fragment = event->data.fragment;
+       WebKitDOMHTMLElement *body;
        WebKitDOMNode *node;
 
        restore_selection_to_history_event_state (view, event->before);
@@ -13518,6 +13520,12 @@ redo_delete (EHTMLEditorView *view,
        delete_key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (event->data.fragment), 
"history-delete-key"));
        control_key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (event->data.fragment), 
"history-control-key"));
 
+       document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view));
+       body = webkit_dom_document_get_body (document);
+
+       if (!view->priv->html_mode)
+               set_monospace_font_family_on_body (WEBKIT_DOM_ELEMENT (body), TRUE);
+
        if (!delete_key && key_press_event_process_backspace_key (view))
                goto out;
 
@@ -13598,6 +13606,9 @@ redo_delete (EHTMLEditorView *view,
        body_key_up_event_process_backspace_or_delete (view, delete_key);
        view->priv->renew_history_after_coordinates = TRUE;
 
+       if (!view->priv->html_mode)
+               set_monospace_font_family_on_body (WEBKIT_DOM_ELEMENT (body), FALSE);
+
        restore_selection_to_history_event_state (view, event->after);
 
        e_html_editor_view_force_spell_check_for_current_paragraph (view);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]