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

Miklos Vajna vmiklos at collabora.co.uk
Thu Apr 23 08:54:33 PDT 2015


 editeng/source/editeng/impedit.cxx                  |    4 ++++
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   14 ++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit ef9722558a33a6e88ed5ab76198f2698ddd1e003
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Apr 23 17:26:31 2015 +0200

    ImpEditView::SetEditSelection: fix missing tiled rendering selection callbacks
    
    Commit 2f31ac76be64953d19a72e3d8eae42b1ac5c5473 (editeng tiled
    rendering: allow resetting selection with a single click, 2015-03-16)
    changed ImpEditView::DrawSelection() so that the selection is only
    emitted when the view is in selection mode. However, this way selections
    set by ImpEditEngine::Search() were lost, as it only set the selection, but not
    the selection mode. So when in tiled rendering, always adjust selection
    mode depending on if the selection is empty or not, that makes the
    search result selections show up.
    
    Change-Id: I00b0739c5263a98a437e38d01b73c5004e50957b

diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 8866f99..118fc01 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -143,6 +143,10 @@ void ImpEditView::SetEditSelection( const EditSelection& rEditSelection )
     // set state before notification
     aEditSelection = rEditSelection;
 
+    if (isTiledRendering())
+        // Tiled rendering: selections are only painted when we are in selection mode.
+        pEditEngine->SetInSelectionMode(aEditSelection.HasRange());
+
     if ( pEditEngine->pImpEditEngine->GetNotifyHdl().IsSet() )
     {
         const EditDoc& rDoc = pEditEngine->GetEditDoc();
commit 658467304c40676dfd8a5d117f3b1866de40b959
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Apr 23 15:06:30 2015 +0200

    gtktiledviewer: let findbar have the focus when it's visible
    
    1) Give its GtkEntry focus after pressing the button to show the
    findbar, so one can immediately can begin typing.
    
    2) Only forward keypresses to LOK if the findbar is not visible, so it's
    not necessary to stop editing to be able to search.
    
    Change-Id: I5c9487739a550e34c66f39b12469392028bb7e3d

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index fc309ed..4b5f1c5 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -124,7 +124,17 @@ void toggleFindbar(GtkWidget* /*pButton*/, gpointer /*pItem*/)
         gtk_widget_hide(pFindbar);
     }
     else
+    {
         gtk_widget_show_all(pFindbar);
+        gtk_widget_grab_focus(pFindbarEntry);
+    }
+}
+
+/// Handles the key-press-event of the window.
+static void signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData)
+{
+    if (!gtk_widget_get_visible(pFindbar))
+        lok_docview_post_key(pWidget, pEvent, pData);
 }
 
 /// Searches for the next or previous text of pFindbarEntry.
@@ -415,8 +425,8 @@ int main( int argc, char* argv[] )
     g_signal_connect(pDocView, "command-changed", G_CALLBACK(signalCommand), NULL);
 
     // Input handling.
-    g_signal_connect(pWindow, "key-press-event", G_CALLBACK(lok_docview_post_key), pDocView);
-    g_signal_connect(pWindow, "key-release-event", G_CALLBACK(lok_docview_post_key), pDocView);
+    g_signal_connect(pWindow, "key-press-event", G_CALLBACK(signalKey), pDocView);
+    g_signal_connect(pWindow, "key-release-event", G_CALLBACK(signalKey), pDocView);
 
     gtk_container_add( GTK_CONTAINER(pVBox), pDocView );
 


More information about the Libreoffice-commits mailing list