diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2005-06-15 14:06:40 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2005-06-15 14:06:40 (GMT) |
commit | 3be2b7d94dc4475256b89f8033ef5cca17513530 (patch) | |
tree | f685d4748766b1d2bb18eeab22e9ea54e03c12a4 /pdf/ev-poppler.cc | |
parent | 4301d174db5623094cb313a467a2abab34a2b381 (diff) |
Expand links when specified by the document. Depend on a poppler api
2005-06-15 Marco Pesenti Gritti <mpg@redhat.com>
* backend/ev-document-links.h:
* pdf/ev-poppler.cc:
* shell/ev-sidebar-links.c: (create_loading_model),
(expand_open_links), (job_finished_callback):
Expand links when specified by the document.
Depend on a poppler api (defined out for now)
Diffstat (limited to 'pdf/ev-poppler.cc')
-rw-r--r-- | pdf/ev-poppler.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pdf/ev-poppler.cc b/pdf/ev-poppler.cc index 9989d82..aebe7ce 100644 --- a/pdf/ev-poppler.cc +++ b/pdf/ev-poppler.cc @@ -658,8 +658,14 @@ build_tree (PdfDocument *pdf_document, PopplerIndexIter *child; PopplerAction *action; EvLink *link; + gboolean expand; action = poppler_index_iter_get_action (iter); +#ifdef POPPLER_LINK_IS_OPEN + expand = poppler_index_iter_is_open (iter); +#else + expand = TRUE; +#endif if (action) { gtk_tree_store_append (GTK_TREE_STORE (model), &tree_iter, parent); link = ev_link_from_action (action); @@ -668,6 +674,7 @@ build_tree (PdfDocument *pdf_document, gtk_tree_store_set (GTK_TREE_STORE (model), &tree_iter, EV_DOCUMENT_LINKS_COLUMN_MARKUP, ev_link_get_title (link), EV_DOCUMENT_LINKS_COLUMN_LINK, link, + EV_DOCUMENT_LINKS_COLUMN_EXPAND, expand, -1); child = poppler_index_iter_get_child (iter); if (child) @@ -688,16 +695,16 @@ pdf_document_links_get_links_model (EvDocumentLinks *document_links) g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), NULL); iter = poppler_index_iter_new (pdf_document->document); - /* Create the model iff we have items*/ + /* Create the model if we have items*/ if (iter != NULL) { model = (GtkTreeModel *) gtk_tree_store_new (EV_DOCUMENT_LINKS_COLUMN_NUM_COLUMNS, G_TYPE_STRING, - G_TYPE_POINTER); + G_TYPE_POINTER, + G_TYPE_BOOLEAN); build_tree (pdf_document, model, NULL, iter); poppler_index_iter_free (iter); } - return model; } |