]> www.fi.muni.cz Git - evince.git/commitdiff
[libview] Remove ev_view_page_label_from_dest()
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 3 Jan 2010 17:14:19 +0000 (18:14 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 3 Jan 2010 20:14:12 +0000 (21:14 +0100)
It shouldn't be a view method since it depends on the document rather than
the view and it's been replaced by ev_document_links_get_dest_page_label()

libview/ev-view.c
libview/ev-view.h

index d7475815fd623f16dd2bff47a1cf07e390a93070..b6ffd798aaebd5b3db9fed3dcdc8555da38838bd 100644 (file)
@@ -1753,42 +1753,6 @@ ev_view_handle_link (EvView *view, EvLink *link)
        }
 }
 
-gchar *
-ev_view_page_label_from_dest (EvView *view, EvLinkDest *dest)
-{
-       EvLinkDestType type;
-       gchar *msg = NULL;
-
-       type = ev_link_dest_get_dest_type (dest);
-
-       switch (type) {
-               case EV_LINK_DEST_TYPE_NAMED: {
-                       EvLinkDest  *dest2;
-                       const gchar *named_dest;
-                       
-                       named_dest = ev_link_dest_get_named_dest (dest);
-                       dest2 = ev_document_links_find_link_dest (EV_DOCUMENT_LINKS (view->document),
-                                                                 named_dest);
-                       if (dest2) {
-                               msg = ev_document_get_page_label (view->document,
-                                                                 ev_link_dest_get_page (dest2));
-                               g_object_unref (dest2);
-                       }
-               }
-                       
-                       break;
-               case EV_LINK_DEST_TYPE_PAGE_LABEL: {
-                       msg = g_strdup (ev_link_dest_get_page_label (dest));
-               }
-                       break;
-               default: 
-                       msg = ev_document_get_page_label (view->document,
-                                                         ev_link_dest_get_page (dest));
-       }
-       
-       return msg;
-}
-
 static char *
 tip_from_action_named (EvLinkAction *action)
 {
@@ -1830,8 +1794,8 @@ tip_from_link (EvView *view, EvLink *link)
 
        switch (type) {
                case EV_LINK_ACTION_TYPE_GOTO_DEST:
-                       page_label = ev_view_page_label_from_dest (view,
-                                                                  ev_link_action_get_dest (action));
+                       page_label = ev_document_links_get_dest_page_label (EV_DOCUMENT_LINKS (view->document),
+                                                                           ev_link_action_get_dest (action));
                        if (page_label) {
                                msg = g_strdup_printf (_("Go to page %s"), page_label);
                                g_free (page_label);
index c63ad33fed95a6a7274afb11e130b2e84b57c06e..135917278045ce29f7b55cc084f65aec92484dc0 100644 (file)
@@ -97,7 +97,6 @@ void         ev_view_handle_link        (EvView         *view,
                                           EvLink         *link);
 gboolean       ev_view_next_page         (EvView         *view);
 gboolean       ev_view_previous_page     (EvView         *view);
-gchar*         ev_view_page_label_from_dest (EvView *view, EvLinkDest *dest);
 
 void          ev_view_autoscroll_start   (EvView *view);
 void           ev_view_autoscroll_stop    (EvView *view);