]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/ev-poppler.cc
Implement fitr links
[evince.git] / pdf / ev-poppler.cc
index 5633840e9297db5841cbb1d3805a34c00feef4a4..30b5a72e0964c6adacad8fd7532d7777174a0b79 100644 (file)
@@ -729,10 +729,17 @@ ev_link_from_dest (PopplerAction *action)
                                              action->goto_dest.dest->top);
                break;
        case POPPLER_DEST_FITV:
-               unimplemented_dest = "POPPLER_DEST_FITV";
+               link = ev_link_new_page_fitv (action->any.title,
+                                             action->goto_dest.dest->page_num - 1,
+                                             action->goto_dest.dest->left);
                break;
        case POPPLER_DEST_FITR:
-               unimplemented_dest = "POPPLER_DEST_FITR";
+               link = ev_link_new_page_fitr (action->any.title,
+                                             action->goto_dest.dest->page_num - 1,
+                                             action->goto_dest.dest->left,
+                                             action->goto_dest.dest->bottom,
+                                             action->goto_dest.dest->right,
+                                             action->goto_dest.dest->top);
                break;
        case POPPLER_DEST_FITB:
                unimplemented_dest = "POPPLER_DEST_FITB";
@@ -819,16 +826,22 @@ build_tree (PdfDocument      *pdf_document,
                action = poppler_index_iter_get_action (iter);
                expand = poppler_index_iter_is_open (iter);
                if (action) {
+                       char *title_markup;
+
                        gtk_tree_store_append (GTK_TREE_STORE (model), &tree_iter, parent);
                        link = ev_link_from_action (action);
                        poppler_action_free (action);
+                       title_markup = g_markup_escape_text (ev_link_get_title (link), -1);
 
                        gtk_tree_store_set (GTK_TREE_STORE (model), &tree_iter,
-                                           EV_DOCUMENT_LINKS_COLUMN_MARKUP, ev_link_get_title (link),
+                                           EV_DOCUMENT_LINKS_COLUMN_MARKUP, title_markup,
                                            EV_DOCUMENT_LINKS_COLUMN_LINK, link,
                                            EV_DOCUMENT_LINKS_COLUMN_EXPAND, expand,
                                            -1);
+
+                       g_free (title_markup);
                        g_object_unref (link);
+
                        child = poppler_index_iter_get_child (iter);
                        if (child)
                                build_tree (pdf_document, model, &tree_iter, child);