[evince/wip/chpe/xmp: 26/29] pdf: Only flag EvDocumentInfo fields when actually present
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/wip/chpe/xmp: 26/29] pdf: Only flag EvDocumentInfo fields when actually present
- Date: Fri, 7 Jan 2022 23:27:27 +0000 (UTC)
commit 2694ee440fd29bfed144b36d403431273d08a90d
Author: Christian Persch <chpe src gnome org>
Date: Sat Dec 4 01:45:44 2021 +0100
pdf: Only flag EvDocumentInfo fields when actually present
backend/pdf/ev-poppler.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.c b/backend/pdf/ev-poppler.c
index a0631e977..339b23429 100644
--- a/backend/pdf/ev-poppler.c
+++ b/backend/pdf/ev-poppler.c
@@ -554,23 +554,14 @@ pdf_document_get_info (EvDocument *document)
info = ev_document_info_new ();
- info->fields_mask |= EV_DOCUMENT_INFO_TITLE |
- EV_DOCUMENT_INFO_FORMAT |
- EV_DOCUMENT_INFO_AUTHOR |
- EV_DOCUMENT_INFO_SUBJECT |
- EV_DOCUMENT_INFO_KEYWORDS |
- EV_DOCUMENT_INFO_LAYOUT |
+ info->fields_mask |= EV_DOCUMENT_INFO_LAYOUT |
EV_DOCUMENT_INFO_START_MODE |
EV_DOCUMENT_INFO_PERMISSIONS |
EV_DOCUMENT_INFO_UI_HINTS |
- EV_DOCUMENT_INFO_CREATOR |
- EV_DOCUMENT_INFO_PRODUCER |
EV_DOCUMENT_INFO_LINEARIZED |
EV_DOCUMENT_INFO_N_PAGES |
EV_DOCUMENT_INFO_SECURITY |
- EV_DOCUMENT_INFO_PAPER_SIZE |
- EV_DOCUMENT_INFO_CONTAINS_JS |
- EV_DOCUMENT_INFO_LICENSE;
+ EV_DOCUMENT_INFO_PAPER_SIZE;
g_object_get (PDF_DOCUMENT (document)->document,
"title", &(info->title),
@@ -590,6 +581,21 @@ pdf_document_get_info (EvDocument *document)
"metadata", &metadata,
NULL);
+ if (info->title)
+ info->fields_mask |= EV_DOCUMENT_INFO_TITLE;
+ if (info->format)
+ info->fields_mask |= EV_DOCUMENT_INFO_FORMAT;
+ if (info->author)
+ info->fields_mask |= EV_DOCUMENT_INFO_AUTHOR;
+ if (info->subject)
+ info->fields_mask |= EV_DOCUMENT_INFO_SUBJECT;
+ if (info->keywords)
+ info->fields_mask |= EV_DOCUMENT_INFO_KEYWORDS;
+ if (info->creator)
+ info->fields_mask |= EV_DOCUMENT_INFO_CREATOR;
+ if (info->producer)
+ info->fields_mask |= EV_DOCUMENT_INFO_PRODUCER;
+
ev_document_info_take_created_datetime (info, created_datetime);
ev_document_info_take_modified_datetime (info, modified_datetime);
@@ -703,6 +709,7 @@ pdf_document_get_info (EvDocument *document)
#if POPPLER_CHECK_VERSION(0, 90, 0)
info->contains_js = poppler_document_has_javascript (PDF_DOCUMENT (document)->document) ?
EV_DOCUMENT_CONTAINS_JS_YES : EV_DOCUMENT_CONTAINS_JS_NO;
+ info->fields_mask |= EV_DOCUMENT_INFO_CONTAINS_JS;
#else
info->contains_js = EV_DOCUMENT_CONTAINS_JS_UNKNOWN;
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]