*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <config.h>
job = EV_JOB_RENDER (object);
- if (job->ev_page) {
- ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job->ev_page->index, job);
- g_object_unref (job->ev_page);
- job->ev_page = NULL;
- }
-
+ ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job->page, job);
+
if (job->surface) {
cairo_surface_destroy (job->surface);
job->surface = NULL;
ev_job_render_run (EvJob *job)
{
EvJobRender *job_render = EV_JOB_RENDER (job);
+ EvPage *ev_page;
EvRenderContext *rc;
ev_debug_message (DEBUG_JOBS, "page: %d (%p)", job_render->page, job);
ev_document_fc_mutex_lock ();
- job_render->ev_page = ev_document_get_page (job->document, job_render->page);
- rc = ev_render_context_new (job_render->ev_page, job_render->rotation, job_render->scale);
-
+ ev_page = ev_document_get_page (job->document, job_render->page);
+ rc = ev_render_context_new (ev_page, job_render->rotation, job_render->scale);
+ g_object_unref (ev_page);
+
job_render->surface = ev_document_render (job->document, rc);
/* If job was cancelled during the page rendering,
* we return now, so that the thread is finished ASAP
ev_selection_get_selection_map (EV_SELECTION (job->document), ev_page);
if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_LINKS) && EV_IS_DOCUMENT_LINKS (job->document))
job_pd->link_mapping =
- ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), job_pd->page);
+ ev_document_links_get_links (EV_DOCUMENT_LINKS (job->document), ev_page);
if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_FORMS) && EV_IS_DOCUMENT_FORMS (job->document))
job_pd->form_field_mapping =
ev_document_forms_get_form_fields (EV_DOCUMENT_FORMS (job->document),
if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_IMAGES) && EV_IS_DOCUMENT_IMAGES (job->document))
job_pd->image_mapping =
ev_document_images_get_image_mapping (EV_DOCUMENT_IMAGES (job->document),
- job_pd->page);
+ ev_page);
if ((job_pd->flags & EV_PAGE_DATA_INCLUDE_ANNOTS) && EV_IS_DOCUMENT_ANNOTATIONS (job->document))
job_pd->annot_mapping =
ev_document_annotations_get_annotations (EV_DOCUMENT_ANNOTATIONS (job->document),
because, e.g., a password is required - if so, just reload rather than
creating a new instance */
if (job->document) {
+ const gchar *uncompressed_uri;
+
if (job_load->password) {
ev_document_security_set_password (EV_DOCUMENT_SECURITY (job->document),
job_load->password);
job->failed = FALSE;
job->finished = FALSE;
g_clear_error (&job->error);
-
+
+ uncompressed_uri = g_object_get_data (G_OBJECT (job->document),
+ "uri-uncompressed");
ev_document_load (job->document,
- job_load->uri,
+ uncompressed_uri ? uncompressed_uri : job_load->uri,
&error);
} else {
job->document = ev_document_factory_get_document (job_load->uri,
gint i;
for (i = 0; i < job->n_pages; i++) {
- g_list_foreach (job->pages[i], (GFunc)g_free, NULL);
+ g_list_foreach (job->pages[i], (GFunc)ev_rectangle_free, NULL);
g_list_free (job->pages[i]);
}