Commit cad2cf93 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

xps: Do not use EvDocument API in get_info implementation

get_info might be called while the document is being loaded and the
EvDocument cache is not filled yet. Use only the GXPS API to make
sure we get valid values. This fixes the page size always reported as
0x0 in the properties dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=711093
parent 14092aab
......@@ -171,16 +171,18 @@ xps_document_get_info (EvDocument *document)
EV_DOCUMENT_INFO_PAPER_SIZE;
if (gxps_document_get_n_pages (xps->doc) > 0) {
ev_document_get_page_size (document, 0,
&(info->paper_width),
&(info->paper_height));
info->n_pages = gxps_document_get_n_pages (xps->doc);
if (info->n_pages > 0) {
GXPSPage *gxps_page;
gxps_page = gxps_document_get_page (xps->doc, 0, NULL);
gxps_page_get_size (gxps_page, &(info->paper_width), &(info->paper_height));
g_object_unref (gxps_page);
info->paper_width = info->paper_width / 96.0f * 25.4f;
info->paper_height = info->paper_height / 96.0f * 25.4f;
}
info->n_pages = gxps_document_get_n_pages (xps->doc);
return info;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment