From cfe4ba6711c12ea9ad1ddba4cbd60e964715170b Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Sun, 7 Sep 2008 16:27:14 +0000 Subject: [PATCH] Patch for case unsensitive page label match by Michael Lee. See bug 2008-09-07 Nickolay V. Shmyrev * shell/ev-page-cache.c (ev_page_cache_set_page_label): Patch for case unsensitive page label match by Michael Lee. See bug #550136. * shell/ev-page-action.c (create_tool_item): * test/Makefile.am: * test/test1.py: * test/test4.py: * test/test5.py: Added test for the above and updated other tests. svn path=/trunk/; revision=3161 --- ChangeLog | 15 +++++++++++++++ shell/ev-page-action.c | 4 ++++ shell/ev-page-cache.c | 9 +++++++++ test/Makefile.am | 13 +++++++++++-- test/test-page-labels.pdf | Bin 0 -> 10150 bytes test/test1.py | 2 +- test/test4.py | 7 ++++--- test/test5.py | 24 ++++++++++++++++++++++++ 8 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 test/test-page-labels.pdf create mode 100755 test/test5.py diff --git a/ChangeLog b/ChangeLog index 15b6eead..9c16b3ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-09-07 Nickolay V. Shmyrev + + * shell/ev-page-cache.c (ev_page_cache_set_page_label): + + Patch for case unsensitive page label match by Michael Lee. + See bug #550136. + + * shell/ev-page-action.c (create_tool_item): + * test/Makefile.am: + * test/test1.py: + * test/test4.py: + * test/test5.py: + + Added test for the above and updated other tests. + 2008-09-07 Carlos Garcia Campos * shell/ev-window.c: (image_save_dialog_response_cb): diff --git a/shell/ev-page-action.c b/shell/ev-page-action.c index ef87e75e..cc3615ab 100644 --- a/shell/ev-page-action.c +++ b/shell/ev-page-action.c @@ -163,6 +163,7 @@ create_tool_item (GtkAction *action) { EvPageActionWidget *proxy; GtkWidget *hbox; + AtkObject *obj; proxy = g_object_new (ev_page_action_widget_get_type (), NULL); gtk_container_set_border_width (GTK_CONTAINER (proxy), 6); @@ -172,6 +173,9 @@ create_tool_item (GtkAction *action) gtk_box_set_spacing (GTK_BOX (hbox), 6); proxy->entry = gtk_entry_new (); + obj = gtk_widget_get_accessible (proxy->entry); + atk_object_set_name (obj, "page-label-entry"); + g_signal_connect(proxy->entry, "scroll-event",G_CALLBACK(page_scroll_cb),action); gtk_widget_add_events(GTK_WIDGET(proxy->entry),GDK_BUTTON_MOTION_MASK); gtk_entry_set_width_chars (GTK_ENTRY (proxy->entry), 5); diff --git a/shell/ev-page-cache.c b/shell/ev-page-cache.c index bbddbbc0..a43876a4 100644 --- a/shell/ev-page-cache.c +++ b/shell/ev-page-cache.c @@ -482,6 +482,15 @@ ev_page_cache_set_page_label (EvPageCache *page_cache, } } + /* Second, look for a match with case insensitively */ + for (i = 0; i < page_cache->n_pages; i++) { + if (page_cache->page_labels[i] != NULL && + ! strcasecmp (page_label, page_cache->page_labels[i])) { + ev_page_cache_set_current_page (page_cache, i); + return TRUE; + } + } + /* Next, parse the label, and see if the number fits */ value = strtol (page_label, &endptr, 10); if (endptr[0] == '\0') { diff --git a/test/Makefile.am b/test/Makefile.am index db56b57a..aa562d38 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,15 @@ -dist_check_SCRIPTS = test1.py test2.py test3.py test4.py +dist_check_SCRIPTS = \ + test1.py \ + test2.py \ + test3.py \ + test4.py \ + test5.py TESTS = $(dist_check_SCRIPTS) -EXTRA_DIST = test-encrypt.pdf test-links.pdf test-mime.bin +EXTRA_DIST = \ + test-encrypt.pdf \ + test-links.pdf \ + test-mime.bin \ + test-page-labels.pdf diff --git a/test/test-page-labels.pdf b/test/test-page-labels.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c7d12671e0ad2b6335d1c88071f3a897f9c353da GIT binary patch literal 10150 zcmcI~2RxPU`#*)OtjH=IA=}w2E9+R5y+a4b$T%ksGCmQNG-O0(MIlO7wv<(A2pQQU zBQvrU{?9SKALa9UeZRlo@B2S5R$^w9ZHv%>EArU}eUAzN<5v)RVBNN=n9w5p} z^clhW1P`L8yDh;3gx(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