From 9013c980670dc394cbd1af3d93a29e46865ebabc Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2019 10:52:24 +0000 Subject: import evince-3.28.2-8.el7 --- diff --git a/SOURCES/evince-3.28.2-print-scaling.patch b/SOURCES/evince-3.28.2-print-scaling.patch new file mode 100644 index 0000000..b997cbb --- /dev/null +++ b/SOURCES/evince-3.28.2-print-scaling.patch @@ -0,0 +1,84 @@ +--- a/backend/pdf/ev-poppler.cc ++++ b/backend/pdf/ev-poppler.cc +@@ -1037,6 +1037,7 @@ pdf_document_get_info (EvDocument *document) + PopplerPermissions permissions; + char *metadata; + gboolean linearized; ++ PopplerPrintScaling print_scaling; + + info = g_new0 (EvDocumentInfo, 1); + +@@ -1068,6 +1069,7 @@ pdf_document_get_info (EvDocument *document) + "page-mode", &mode, + "page-layout", &layout, + "viewer-preferences", &view_prefs, ++ "print-scaling", &print_scaling, + "permissions", &permissions, + "creator", &(info->creator), + "producer", &(info->producer), +@@ -1160,6 +1162,20 @@ pdf_document_get_info (EvDocument *document) + info->ui_hints |= EV_DOCUMENT_UI_HINT_DIRECTION_RTL; + } + ++ /* ++ * Save the PrintScaling preference in the bit field ++ * so we don't need to modify EvDocumentInfo type downstream ++ */ ++ switch (print_scaling) { ++ default: ++ case POPPLER_PRINT_SCALING_APP_DEFAULT: ++ info->ui_hints &= ~(1 << 30); ++ break; ++ case POPPLER_PRINT_SCALING_NONE: ++ info->ui_hints |= 1 << 30; ++ break; ++ } ++ + info->permissions = 0; + if (permissions & POPPLER_PERMISSIONS_OK_TO_PRINT) { + info->permissions |= EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT; +--- a/libview/ev-print-operation.c ++++ b/libview/ev-print-operation.c +@@ -1953,9 +1953,14 @@ ev_print_operation_print_create_custom_widget (EvPrintOperationPrint *print, + EvPrintScale page_scale; + gboolean autorotate; + gboolean use_source_size; ++ EvDocumentInfo *info; + + settings = gtk_print_operation_get_print_settings (print->op); +- page_scale = gtk_print_settings_get_int_with_default (settings, EV_PRINT_SETTING_PAGE_SCALE, 1); ++ info = ev_document_get_info (EV_PRINT_OPERATION (print)->document); ++ if (info->ui_hints & (1 << 30)) ++ page_scale = EV_SCALE_NONE; ++ else ++ page_scale = gtk_print_settings_get_int_with_default (settings, EV_PRINT_SETTING_PAGE_SCALE, 1); + autorotate = gtk_print_settings_has_key (settings, EV_PRINT_SETTING_AUTOROTATE) ? + gtk_print_settings_get_bool (settings, EV_PRINT_SETTING_AUTOROTATE) : + TRUE; +--- a/shell/ev-window.c ++++ b/shell/ev-window.c +@@ -3040,10 +3040,23 @@ ev_window_save_print_settings (EvWindow + GtkPrintSettings *print_settings) + { + GKeyFile *key_file; +- gint i; ++ gint i, page_scale; ++ EvDocumentInfo *info; + + key_file = get_print_settings_file (); ++ ++ /* Do not store page scaling enforced by opened document */ ++ info = ev_document_get_info (window->priv->document); ++ page_scale = gtk_print_settings_get_int (print_settings, "evince-print-setting-page-scale"); ++ if (info->ui_hints & (1 << 30) && page_scale == 0) { ++ page_scale = g_key_file_get_integer (key_file, ++ EV_PRINT_SETTINGS_GROUP, ++ "evince-print-setting-page-scale", ++ NULL); ++ } ++ + gtk_print_settings_to_key_file (print_settings, key_file, EV_PRINT_SETTINGS_GROUP); ++ g_key_file_set_integer (key_file, EV_PRINT_SETTINGS_GROUP, "evince-print-setting-page-scale", page_scale); + + /* Always Remove n_copies from global settings */ + g_key_file_remove_key (key_file, EV_PRINT_SETTINGS_GROUP, GTK_PRINT_SETTINGS_N_COPIES, NULL); diff --git a/SPECS/evince.spec b/SPECS/evince.spec index 3609bd1..a83b938 100644 --- a/SPECS/evince.spec +++ b/SPECS/evince.spec @@ -1,11 +1,11 @@ -%global poppler_version 0.24.0 +%global poppler_version 0.26.5-36 %global glib2_version 2.36.0 %global gtk3_version 3.16.0 %global gxps_version 0.2.1 Name: evince Version: 3.28.2 -Release: 5%{?dist} +Release: 8%{?dist} Summary: Document viewer License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse @@ -24,6 +24,8 @@ Patch8: evince-3.28.2-libarchive-3.1.2.patch Patch9: evince-3.28.2-signed-size.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1593244 Patch10: evince-3.28.2-application-id.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1541358 +Patch11: evince-3.28.2-print-scaling.patch BuildRequires: pkgconfig(adwaita-icon-theme) BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib2_version} @@ -33,7 +35,7 @@ BuildRequires: pkgconfig(gtk+-x11-3.0) >= %{gtk3_version} BuildRequires: pkgconfig(libsecret-1) BuildRequires: pkgconfig(libspectre) BuildRequires: pkgconfig(libxml-2.0) -BuildRequires: pkgconfig(poppler-glib) >= %{poppler_version} +BuildRequires: poppler-glib-devel >= %{poppler_version} BuildRequires: pkgconfig(libarchive) BuildRequires: libtiff-devel BuildRequires: gettext @@ -75,6 +77,7 @@ Summary: Libraries for the evince document viewer %if 0%{?fedora} Recommends: %{name}-djvu%{?_isa} = %{version}-%{release} %endif +Requires: poppler-glib >= %{poppler_version} %description libs This package contains shared libraries needed for evince @@ -273,6 +276,20 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null ||: %{_libdir}/mozilla/plugins/libevbrowserplugin.so %changelog +* Thu May 9 2019 Marek Kasik - 3.28.2-8 +- Do not free EvDocumentInfo in ev_window_save_print_settings(), +- it is freed in EvDocument's destructor +- Resolves: #1541358 + +* Tue May 7 2019 Marek Kasik - 3.28.2-7 +- Do not store page-scaling for documents with enforced +- page-scaling +- Resolves: #1541358 + +* Mon Mar 18 2019 Marek Kasik - 3.28.2-6 +- Use PrintScaling preference stored in PDFs +- Resolves: #1541358 + * Tue Jul 24 2018 Marek Kasik - 3.28.2-5 - Set application-id for evince - Resolves: #1593244