[Libreoffice-commits] core.git: libreofficekit/qa

Pranav Kant pranav913 at gmail.com
Fri May 8 08:01:50 PDT 2015


 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 40ad68bbe7cd1c86a8ebefb1539fb7b403506792
Author: Pranav Kant <pranav913 at gmail.com>
Date:   Fri May 8 19:19:57 2015 +0530

    gtktiledviewer: Stop event propagation to GtkToolbar when in edit mode
    
    If not stopped, key-press events are interpreted by both LOKDocView and
    GtkToolbar leading to poor editing experience.
    
    Change-Id: Ie878d168e202a0f3e1d52191aa3fd7cc00a7cbfd
    Reviewed-on: https://gerrit.libreoffice.org/15677
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 14cf767..cb84ee7 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -132,12 +132,17 @@ void toggleFindbar(GtkWidget* /*pButton*/, gpointer /*pItem*/)
 }
 
 /// Handles the key-press-event of the window.
-static void signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData)
+static gboolean signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData)
 {
+    LOKDocView* pLOKDocView = LOK_DOCVIEW(pDocView);
 #if GTK_CHECK_VERSION(2,18,0) // we need gtk_widget_get_visible()
-    if (!gtk_widget_get_visible(pFindbar))
-        lok_docview_post_key(pWidget, pEvent, pData);
+    if (!gtk_widget_get_visible(pFindbar) && bool(lok_docview_get_edit(pLOKDocView)))
+        {
+            lok_docview_post_key(pWidget, pEvent, pData);
+            return TRUE;
+        }
 #endif
+    return FALSE;
 }
 
 /// Searches for the next or previous text of pFindbarEntry.


More information about the Libreoffice-commits mailing list