diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-07-30 05:16:39 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-10-02 11:00:52 +0530 |
commit | fb09d4aa2ec33cd933fdef449f20c52fcad9ddca (patch) | |
tree | b6c6e5fd67891883c5ea40ccb5b4122e0be5600d /libreofficekit | |
parent | 0f78547e2f03868128dcc1400c326644dd6438cc (diff) |
lokdocview: Remove unnecessary code
Change-Id: I1d744c91f01eb098e9273d2459b63a5444558f39
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 9dd83bf518f5..b5fc11d82d9e 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -815,38 +815,19 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent) } } - if (pEvent->type == GDK_KEY_RELEASE) - { - GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); - LOEvent* pLOEvent = new LOEvent(LOK_POST_KEY); - pLOEvent->m_nKeyEvent = LOK_KEYEVENT_KEYUP; - pLOEvent->m_nCharCode = nCharCode; - pLOEvent->m_nKeyCode = nKeyCode; - g_task_set_task_data(task, pLOEvent, LOEvent::destroy); - g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != nullptr) - { - g_warning("Unable to call LOK_POST_KEY: %s", error->message); - g_clear_error(&error); - } - g_object_unref(task); - } - else + GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); + LOEvent* pLOEvent = new LOEvent(LOK_POST_KEY); + pLOEvent->m_nKeyEvent = pEvent->type == GDK_KEY_RELEASE ? LOK_KEYEVENT_KEYUP : LOK_KEYEVENT_KEYINPUT; + pLOEvent->m_nCharCode = nCharCode; + pLOEvent->m_nKeyCode = nKeyCode; + g_task_set_task_data(task, pLOEvent, LOEvent::destroy); + g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); + if (error != nullptr) { - GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr); - LOEvent* pLOEvent = new LOEvent(LOK_POST_KEY); - pLOEvent->m_nKeyEvent = LOK_KEYEVENT_KEYINPUT; - pLOEvent->m_nCharCode = nCharCode; - pLOEvent->m_nKeyCode = nKeyCode; - g_task_set_task_data(task, pLOEvent, LOEvent::destroy); - g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error); - if (error != nullptr) - { - g_warning("Unable to call LOK_POST_KEY: %s", error->message); - g_clear_error(&error); - } - g_object_unref(task); + g_warning("Unable to call LOK_POST_KEY: %s", error->message); + g_clear_error(&error); } + g_object_unref(task); return FALSE; } |