]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-jobs.c
Open links with anchors. Fix for the bug #339836.
[evince.git] / shell / ev-jobs.c
index 7a37b2b9f6ff3faadc45e9a5ff0cff2f61c83395..4e01ab1923ab41e81166e33a6dceeccf88e8eed0 100644 (file)
@@ -271,10 +271,14 @@ ev_job_render_run (EvJobRender *job)
                                  G_CALLBACK (render_finished_cb), job);
        } else {
                job->pixbuf = ev_document_render_pixbuf (EV_JOB (job)->document, job->rc);
-               if (job->include_links)
-                       job->link_mapping = ev_document_get_links (EV_JOB (job)->document, job->rc->page);
+               if (job->include_links && EV_IS_LINK (EV_JOB (job)->document))
+                       job->link_mapping =
+                               ev_document_links_get_links (EV_DOCUMENT_LINKS (EV_JOB (job)->document),
+                                                            job->rc->page);
                if (job->include_text && EV_IS_SELECTION (EV_JOB (job)->document))
-                       job->text_mapping = ev_selection_get_selection_map (EV_SELECTION (EV_JOB (job)->document), job->rc);
+                       job->text_mapping =
+                               ev_selection_get_selection_map (EV_SELECTION (EV_JOB (job)->document),
+                                                               job->rc);
                if (job->include_selection && EV_IS_SELECTION (EV_JOB (job)->document)) {
                        ev_selection_render_selection (EV_SELECTION (EV_JOB (job)->document),
                                                       job->rc,
@@ -429,9 +433,13 @@ ev_job_xfer_run (EvJobXfer *job)
                char *tmp_name;
                char *base_name;
                
+               /* We'd like to keep extension of source uri since
+                * it helps to resolve some mime types, say cbz */
+               
                tmp_name = ev_tmp_filename ();
-               base_name = g_path_get_basename (job->uri);
-               job->local_uri = g_strconcat ("file:", tmp_name, base_name, NULL);
+               base_name = gnome_vfs_uri_extract_short_name (source_uri);
+               job->local_uri = g_strconcat ("file:", tmp_name, "-", base_name, NULL);
+               g_free (base_name);
                g_free (tmp_name);
                
                target_uri = gnome_vfs_uri_new (job->local_uri);