+static void
+build_tree (PdfDocument *pdf_document,
+ GtkTreeModel *model,
+ GtkTreeIter *parent,
+ GooList *items)
+{
+ int i;
+
+ for (i = 0; i < items->getLength (); i++) {
+ OutlineItem *item;
+ GtkTreeIter iter;
+ LinkAction *link_action;
+ gchar *title;
+ EvLink *link;
+
+ item = (OutlineItem *)items->get (i);
+ gtk_tree_store_append (GTK_TREE_STORE (model), &iter, parent);
+
+ link_action = item->getAction ();
+ title = unicode_to_char (item, pdf_document->umap);
+ link = build_link_from_action (pdf_document, link_action, title);
+
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
+ EV_DOCUMENT_LINKS_COLUMN_MARKUP, title,
+ EV_DOCUMENT_LINKS_COLUMN_LINK, link,
+ -1);
+
+ item->open ();
+ if (item->hasKids () && item->getKids ()) {
+ build_tree (pdf_document,
+ model,
+ &iter,
+ item->getKids ());
+ }
+ }
+}
+
+static GtkTreeModel *
+pdf_document_links_get_links_model (EvDocumentLinks *document_links)