Compare commits
10 Commits
177e6ffe70
...
2de35fb368
Author | SHA1 | Date |
---|---|---|
Marek Kasik | 2de35fb368 | |
Marek Kasik | b99599efa6 | |
Marek Kasik | d81eb73a92 | |
Marek Kasik | e5e8248731 | |
Marek Kasik | 404dbba7d7 | |
Marek Kasik | 22946f170b | |
Marek Kasik | 3f272ad762 | |
Mohan Boddu | 6dcbd50494 | |
Marek Kasik | e1c8795c16 | |
Marek Kasik | b2709c12ac |
|
@ -0,0 +1 @@
|
|||
67c0f99cdb64f0b919e5f50604ab1824caf3d4ca evince-40.5.tar.xz
|
|
@ -98,3 +98,6 @@ evince-3.0.0.tar.bz2
|
|||
/evince-3.39.2.tar.xz
|
||||
/evince-40.0.tar.xz
|
||||
/evince-40.1.tar.xz
|
||||
/evince-40.2.tar.xz
|
||||
/evince-40.4.tar.xz
|
||||
/evince-40.5.tar.xz
|
||||
|
|
|
@ -1,190 +0,0 @@
|
|||
From 1f250861fa2ec6a7117f183459e62ac285d85db6 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Tue, 2 Mar 2021 18:40:56 +0100
|
||||
Subject: [PATCH] window: Show password dialog again
|
||||
|
||||
Show password dialog when trying to open a document for which we've
|
||||
cancelled a password dialog before in recent view.
|
||||
|
||||
This is achieved by adding a signal "cancelled" to EvPasswordView since
|
||||
only successfull entering of password was signaled before by "unlock" signal.
|
||||
|
||||
We also need to unregister current document with EvApplication and clear its uri
|
||||
there to be able to open other documents in current window.
|
||||
---
|
||||
shell/ev-application.c | 16 ++++++++++++++++
|
||||
shell/ev-application.h | 1 +
|
||||
shell/ev-password-view.c | 14 ++++++++++++++
|
||||
shell/ev-password-view.h | 3 ++-
|
||||
shell/ev-window.c | 23 ++++++++++++++++++++++-
|
||||
5 files changed, 55 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/shell/ev-application.c b/shell/ev-application.c
|
||||
index 23871d9a..7a3b69ba 100644
|
||||
--- a/shell/ev-application.c
|
||||
+++ b/shell/ev-application.c
|
||||
@@ -539,6 +539,7 @@ ev_application_unregister_uri (EvApplication *application,
|
||||
g_error_free (error);
|
||||
} else {
|
||||
g_variant_unref (value);
|
||||
+ application->doc_registered = FALSE;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLE_DBUS */
|
||||
@@ -1166,6 +1167,21 @@ ev_application_get_uri (EvApplication *application)
|
||||
return application->uri;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * ev_application_clear_uri:
|
||||
+ * @application: The instance of the application.
|
||||
+ *
|
||||
+ * This unregisters current uri and clears it so that another document
|
||||
+ * can be opened in this instance. E.g. after cancelled password dialog
|
||||
+ * in recent view.
|
||||
+ */
|
||||
+void
|
||||
+ev_application_clear_uri (EvApplication *application)
|
||||
+{
|
||||
+ ev_application_unregister_uri (application, application->uri);
|
||||
+ g_clear_pointer (&application->uri, g_free);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* ev_application_get_media_keys:
|
||||
* @application: The instance of the application.
|
||||
diff --git a/shell/ev-application.h b/shell/ev-application.h
|
||||
index 00a7a18b..f9b43ab3 100644
|
||||
--- a/shell/ev-application.h
|
||||
+++ b/shell/ev-application.h
|
||||
@@ -66,6 +66,7 @@ void ev_application_open_uri_list (EvApplication *application,
|
||||
gboolean ev_application_has_window (EvApplication *application);
|
||||
guint ev_application_get_n_windows (EvApplication *application);
|
||||
const gchar * ev_application_get_uri (EvApplication *application);
|
||||
+void ev_application_clear_uri (EvApplication *application);
|
||||
GObject *ev_application_get_media_keys (EvApplication *application);
|
||||
|
||||
const gchar *ev_application_get_dot_dir (EvApplication *application,
|
||||
diff --git a/shell/ev-password-view.c b/shell/ev-password-view.c
|
||||
index 9a916d55..0dab3c51 100644
|
||||
--- a/shell/ev-password-view.c
|
||||
+++ b/shell/ev-password-view.c
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
enum {
|
||||
UNLOCK,
|
||||
+ CANCELLED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
typedef struct {
|
||||
@@ -91,6 +92,15 @@ ev_password_view_class_init (EvPasswordViewClass *class)
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
+ password_view_signals[CANCELLED] =
|
||||
+ g_signal_new ("cancelled",
|
||||
+ G_TYPE_FROM_CLASS (g_object_class),
|
||||
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
||||
+ G_STRUCT_OFFSET (EvPasswordViewClass, cancelled),
|
||||
+ NULL, NULL,
|
||||
+ g_cclosure_marshal_VOID__VOID,
|
||||
+ G_TYPE_NONE, 0);
|
||||
+
|
||||
g_object_class->finalize = ev_password_view_finalize;
|
||||
}
|
||||
|
||||
@@ -183,6 +193,10 @@ ev_password_dialog_got_response (GtkDialog *dialog,
|
||||
g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->password_entry)));
|
||||
|
||||
g_signal_emit (password_view, password_view_signals[UNLOCK], 0);
|
||||
+ } else if (response_id == GTK_RESPONSE_CANCEL ||
|
||||
+ response_id == GTK_RESPONSE_CLOSE ||
|
||||
+ response_id == GTK_RESPONSE_DELETE_EVENT) {
|
||||
+ g_signal_emit (password_view, password_view_signals[CANCELLED], 0);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
diff --git a/shell/ev-password-view.h b/shell/ev-password-view.h
|
||||
index c3fc5bbc..e279c612 100644
|
||||
--- a/shell/ev-password-view.h
|
||||
+++ b/shell/ev-password-view.h
|
||||
@@ -40,7 +40,8 @@ struct _EvPasswordViewClass {
|
||||
GtkViewportClass parent_class;
|
||||
|
||||
/* signals */
|
||||
- void (*unlock) (EvPasswordView *self);
|
||||
+ void (*unlock) (EvPasswordView *self);
|
||||
+ void (*cancelled) (EvPasswordView *self);
|
||||
};
|
||||
|
||||
GType ev_password_view_get_type (void) G_GNUC_CONST;
|
||||
diff --git a/shell/ev-window.c b/shell/ev-window.c
|
||||
index 077d577d..f728fa77 100644
|
||||
--- a/shell/ev-window.c
|
||||
+++ b/shell/ev-window.c
|
||||
@@ -239,6 +239,8 @@ typedef struct {
|
||||
|
||||
/* Send to */
|
||||
gboolean has_mailto_handler;
|
||||
+
|
||||
+ gboolean password_view_cancelled;
|
||||
} EvWindowPrivate;
|
||||
|
||||
#define GET_PRIVATE(o) ev_window_get_instance_private (o)
|
||||
@@ -1804,6 +1806,7 @@ ev_window_password_view_unlock (EvWindow *ev_window)
|
||||
password = ev_password_view_get_password (EV_PASSWORD_VIEW (priv->password_view));
|
||||
ev_job_load_set_password (EV_JOB_LOAD (priv->load_job), password);
|
||||
ev_job_scheduler_push_job (priv->load_job, EV_JOB_PRIORITY_NONE);
|
||||
+ priv->password_view_cancelled = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1821,6 +1824,18 @@ ev_window_clear_load_job (EvWindow *ev_window)
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+ev_window_password_view_cancelled (EvWindow *ev_window)
|
||||
+{
|
||||
+ EvWindowPrivate *priv = GET_PRIVATE (ev_window);
|
||||
+
|
||||
+ priv->password_view_cancelled = TRUE;
|
||||
+ if (ev_window_is_recent_view (ev_window)) {
|
||||
+ ev_window_clear_load_job (ev_window);
|
||||
+ ev_application_clear_uri (EV_APP);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void
|
||||
ev_window_clear_reload_job (EvWindow *ev_window)
|
||||
{
|
||||
@@ -2395,7 +2410,8 @@ ev_window_open_uri (EvWindow *ev_window,
|
||||
g_strdup (search_string) : NULL;
|
||||
|
||||
if (priv->uri &&
|
||||
- g_ascii_strcasecmp (priv->uri, uri) == 0) {
|
||||
+ g_ascii_strcasecmp (priv->uri, uri) == 0 &&
|
||||
+ !priv->password_view_cancelled) {
|
||||
if (ev_window_check_document_modified (ev_window, EV_WINDOW_ACTION_RELOAD))
|
||||
return;
|
||||
ev_window_reload_document (ev_window, dest);
|
||||
@@ -7643,11 +7659,16 @@ ev_window_init (EvWindow *ev_window)
|
||||
allow_links_change_zoom);
|
||||
ev_view_set_model (EV_VIEW (priv->view), priv->model);
|
||||
|
||||
+ priv->password_view_cancelled = FALSE;
|
||||
priv->password_view = ev_password_view_new (GTK_WINDOW (ev_window));
|
||||
g_signal_connect_swapped (priv->password_view,
|
||||
"unlock",
|
||||
G_CALLBACK (ev_window_password_view_unlock),
|
||||
ev_window);
|
||||
+ g_signal_connect_swapped (priv->password_view,
|
||||
+ "cancelled",
|
||||
+ G_CALLBACK (ev_window_password_view_cancelled),
|
||||
+ ev_window);
|
||||
g_signal_connect_object (priv->view, "focus_in_event",
|
||||
G_CALLBACK (view_actions_focus_in_cb),
|
||||
ev_window, 0);
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,485 @@
|
|||
--- evince-40.1/backend/dvi/mdvi-lib/pagesel.c
|
||||
+++ evince-40.1/backend/dvi/mdvi-lib/pagesel.c
|
||||
@@ -209,6 +209,7 @@ DviPageSpec *mdvi_parse_page_spec(const
|
||||
range = mdvi_parse_range(format, NULL, &count, &ptr);
|
||||
if(ptr == format) {
|
||||
if(range) mdvi_free(range);
|
||||
+ mdvi_free(spec);
|
||||
mdvi_error(_("invalid page specification `%s'\n"), format);
|
||||
return NULL;
|
||||
}
|
||||
--- evince-40.1/backend/dvi/mdvi-lib/tfmfile.c
|
||||
+++ evince-40.1/backend/dvi/mdvi-lib/tfmfile.c
|
||||
@@ -393,6 +393,7 @@ static int ofm1_load_file(FILE *in, TFMI
|
||||
/* read them in one sweep */
|
||||
if(fread(tfm, 4, size, in) != size) {
|
||||
mdvi_free(tfm);
|
||||
+ tfm = NULL;
|
||||
goto bad_tfm;
|
||||
}
|
||||
|
||||
--- evince-40.1/backend/dvi/mdvi-lib/vf.c
|
||||
+++ evince-40.1/backend/dvi/mdvi-lib/vf.c
|
||||
@@ -129,6 +129,7 @@ static int vf_load_font(DviParams *param
|
||||
if(ref == NULL) {
|
||||
mdvi_error(_("(vf) %s: could not load font `%s'\n"),
|
||||
font->fontname, name);
|
||||
+ mdvi_free(name);
|
||||
goto error;
|
||||
}
|
||||
mdvi_free(name);
|
||||
--- evince-40.1/backend/comics/comics-document.c
|
||||
+++ evince-40.1/backend/comics/comics-document.c
|
||||
@@ -453,23 +453,27 @@ comics_document_render_pixbuf (EvDocumen
|
||||
|
||||
name = ev_archive_get_entry_pathname (comics_document->archive);
|
||||
if (g_strcmp0 (name, page_path) == 0) {
|
||||
- size_t size = ev_archive_get_entry_size (comics_document->archive);
|
||||
+ gint64 size = ev_archive_get_entry_size (comics_document->archive);
|
||||
char *buf;
|
||||
ssize_t read;
|
||||
|
||||
- buf = g_malloc (size);
|
||||
- read = ev_archive_read_data (comics_document->archive, buf, size, &error);
|
||||
- if (read <= 0) {
|
||||
- if (read < 0) {
|
||||
- g_warning ("Fatal error reading '%s' in archive: %s", name, error->message);
|
||||
- g_error_free (error);
|
||||
+ if (size < 0) {
|
||||
+ g_warning ("Wrong size of entry '%s'.", name);
|
||||
+ } else {
|
||||
+ buf = g_malloc (size);
|
||||
+ read = ev_archive_read_data (comics_document->archive, buf, size, &error);
|
||||
+ if (read <= 0) {
|
||||
+ if (read < 0) {
|
||||
+ g_warning ("Fatal error reading '%s' in archive: %s", name, error->message);
|
||||
+ g_error_free (error);
|
||||
+ } else {
|
||||
+ g_warning ("Read an empty file from the archive");
|
||||
+ }
|
||||
} else {
|
||||
- g_warning ("Read an empty file from the archive");
|
||||
+ gdk_pixbuf_loader_write (loader, (guchar *) buf, size, NULL);
|
||||
}
|
||||
- } else {
|
||||
- gdk_pixbuf_loader_write (loader, (guchar *) buf, size, NULL);
|
||||
+ g_free (buf);
|
||||
}
|
||||
- g_free (buf);
|
||||
gdk_pixbuf_loader_close (loader, NULL);
|
||||
break;
|
||||
}
|
||||
--- evince-40.1/backend/pdf/ev-poppler.cc
|
||||
+++ evince-40.1/backend/pdf/ev-poppler.cc
|
||||
@@ -591,7 +591,7 @@ pdf_document_get_xmptag_from_path (xmlXP
|
||||
const char* xpath)
|
||||
{
|
||||
xmlXPathObjectPtr xpathObj;
|
||||
- char *xmpmetapath = g_strdup_printf ("%s%s", "/x:xmpmeta", xpath);
|
||||
+ char *xmpmetapath;
|
||||
xmlChar *result = NULL;
|
||||
|
||||
/* add pdf/a and pdf/x namespaces */
|
||||
@@ -620,13 +620,17 @@ pdf_document_get_xmptag_from_path (xmlXP
|
||||
if (result != NULL)
|
||||
return result;
|
||||
|
||||
+ xmpmetapath = g_strdup_printf ("%s%s", "/x:xmpmeta", xpath);
|
||||
+
|
||||
/*
|
||||
Try in /x:xmpmeta/ (xmpmeta is optional)
|
||||
https://wwwimages2.adobe.com/content/dam/acom/en/devnet/xmp/pdfs/XMP SDK Release cc-2016-08/XMPSpecificationPart1.pdf (Section 7.3.3)
|
||||
*/
|
||||
xpathObj = xmlXPathEvalExpression (BAD_CAST xmpmetapath, xpathCtx);
|
||||
- if (xpathObj == NULL)
|
||||
+ if (xpathObj == NULL) {
|
||||
+ g_free (xmpmetapath);
|
||||
return NULL;
|
||||
+ }
|
||||
|
||||
if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr != 0)
|
||||
result = xmlNodeGetContent (xpathObj->nodesetval->nodeTab[0]);
|
||||
@@ -743,12 +747,14 @@ static char *
|
||||
pdf_document_get_author_from_metadata (xmlXPathContextPtr xpathCtx)
|
||||
{
|
||||
char* result = NULL;
|
||||
- char* xmpmetapath = g_strdup_printf ("%s%s", "/x:xmpmeta", AUTHORS);
|
||||
+ char* xmpmetapath;
|
||||
/* Try in /rdf:RDF/ */
|
||||
result = pdf_document_get_lists_from_dc_tags (xpathCtx, AUTHORS);
|
||||
if (result != NULL)
|
||||
return result;
|
||||
|
||||
+ xmpmetapath = g_strdup_printf ("%s%s", "/x:xmpmeta", AUTHORS);
|
||||
+
|
||||
/* Try in /x:xmpmeta/ */
|
||||
result = pdf_document_get_lists_from_dc_tags (xpathCtx, xmpmetapath);
|
||||
g_free (xmpmetapath);
|
||||
@@ -760,12 +766,14 @@ static char *
|
||||
pdf_document_get_keywords_from_metadata (xmlXPathContextPtr xpathCtx)
|
||||
{
|
||||
char* result = NULL;
|
||||
- char* xmpmetapath = g_strdup_printf ("%s%s", "/x:xmpmeta", KEYWORDS);
|
||||
+ char* xmpmetapath;
|
||||
/* Try in /rdf:RDF/ */
|
||||
result = pdf_document_get_lists_from_dc_tags (xpathCtx, KEYWORDS);
|
||||
if (result != NULL)
|
||||
return result;
|
||||
|
||||
+ xmpmetapath = g_strdup_printf ("%s%s", "/x:xmpmeta", KEYWORDS);
|
||||
+
|
||||
/* Try in /x:xmpmeta/ */
|
||||
result = pdf_document_get_lists_from_dc_tags (xpathCtx, xmpmetapath);
|
||||
g_free (xmpmetapath);
|
||||
@@ -859,6 +859,7 @@ pdf_document_get_info (EvDocument *docum
|
||||
break;
|
||||
case POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT:
|
||||
info->layout = EV_DOCUMENT_LAYOUT_TWO_COLUMN_RIGHT;
|
||||
+ break;
|
||||
case POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT:
|
||||
info->layout = EV_DOCUMENT_LAYOUT_TWO_PAGE_LEFT;
|
||||
break;
|
||||
--- evince-40.1/properties/ev-properties-view.c
|
||||
+++ evince-40.1/properties/ev-properties-view.c
|
||||
@@ -339,6 +339,7 @@ ev_regular_paper_size (const EvDocumentI
|
||||
ABS (info->paper_width - paper_width) <= width_tolerance) {
|
||||
/* Note to translators: first placeholder is the paper name (eg.
|
||||
* A4), second placeholder is the paper size (eg. 297x210 mm) */
|
||||
+ g_free (str);
|
||||
str = g_strdup_printf (_("%s, Portrait (%s)"),
|
||||
gtk_paper_size_get_display_name (size),
|
||||
exact_size);
|
||||
@@ -346,6 +347,7 @@ ev_regular_paper_size (const EvDocumentI
|
||||
ABS (info->paper_height - paper_width) <= width_tolerance) {
|
||||
/* Note to translators: first placeholder is the paper name (eg.
|
||||
* A4), second placeholder is the paper size (eg. 297x210 mm) */
|
||||
+ g_free (str);
|
||||
str = g_strdup_printf ( _("%s, Landscape (%s)"),
|
||||
gtk_paper_size_get_display_name (size),
|
||||
exact_size);
|
||||
--- evince-40.1/cut-n-paste/libgd/gd-two-lines-renderer.c
|
||||
+++ evince-40.1/cut-n-paste/libgd/gd-two-lines-renderer.c
|
||||
@@ -281,7 +281,7 @@ gd_two_lines_renderer_render (GtkCellRen
|
||||
GtkStyleContext *context;
|
||||
gint line_one_height;
|
||||
GtkStateFlags state;
|
||||
- GdkRectangle area, render_area = *cell_area;
|
||||
+ GdkRectangle area, render_area;
|
||||
gint xpad, ypad, x_offset_1, x_offset_2, y_offset;
|
||||
PangoLayout *layout_one, *layout_two;
|
||||
PangoRectangle layout_rect;
|
||||
--- evince-40.1/cut-n-paste/unarr/rar/filter-rar.c
|
||||
+++ evince-40.1/cut-n-paste/unarr/rar/filter-rar.c
|
||||
@@ -273,8 +273,10 @@ static struct RARFilter *rar_create_filt
|
||||
filter->prog = prog;
|
||||
filter->globaldatalen = globaldatalen > RARProgramSystemGlobalSize ? globaldatalen : RARProgramSystemGlobalSize;
|
||||
filter->globaldata = calloc(1, filter->globaldatalen);
|
||||
- if (!filter->globaldata)
|
||||
+ if (!filter->globaldata) {
|
||||
+ free (filter);
|
||||
return NULL;
|
||||
+ }
|
||||
if (globaldata)
|
||||
memcpy(filter->globaldata, globaldata, globaldatalen);
|
||||
if (registers)
|
||||
--- evince-40.1/libdocument/ev-document.c
|
||||
+++ evince-40.1/libdocument/ev-document.c
|
||||
@@ -496,6 +496,9 @@ ev_document_load_stream (EvDocument
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
klass = EV_DOCUMENT_GET_CLASS (document);
|
||||
+
|
||||
+ g_return_val_if_fail (klass != NULL, FALSE);
|
||||
+
|
||||
if (!klass->load_stream) {
|
||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
"Backend does not support loading from stream");
|
||||
@@ -544,6 +547,9 @@ ev_document_load_gfile (EvDocument
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
klass = EV_DOCUMENT_GET_CLASS (document);
|
||||
+
|
||||
+ g_return_val_if_fail (klass != NULL, FALSE);
|
||||
+
|
||||
if (!klass->load_gfile) {
|
||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
"Backend does not support loading from GFile");
|
||||
@@ -867,6 +873,9 @@ ev_document_get_backend_info (EvDocument
|
||||
g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
|
||||
|
||||
klass = EV_DOCUMENT_GET_CLASS (document);
|
||||
+
|
||||
+ g_return_val_if_fail (klass != NULL, FALSE);
|
||||
+
|
||||
if (klass->get_backend_info == NULL)
|
||||
return FALSE;
|
||||
|
||||
--- evince-40.1/libview/ev-pixbuf-cache.c
|
||||
+++ evince-40.1/libview/ev-pixbuf-cache.c
|
||||
@@ -337,6 +337,11 @@ job_finished_cb (EvJob *job,
|
||||
|
||||
job_info = find_job_cache (pixbuf_cache, job_render->page);
|
||||
|
||||
+ if (job_info == NULL) {
|
||||
+ g_warning ("Job info not found.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (ev_job_is_failed (job)) {
|
||||
job_info->job = NULL;
|
||||
g_object_unref (job);
|
||||
@@ -721,6 +726,11 @@ add_job_if_needed (EvPixbufCache *pixbuf
|
||||
gint device_scale = get_device_scale (pixbuf_cache);
|
||||
gint width, height;
|
||||
|
||||
+ if (job_info == NULL) {
|
||||
+ g_warning ("Adding job with NULL info.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (job_info->job)
|
||||
return;
|
||||
|
||||
--- evince-40.1/libview/ev-print-operation.c
|
||||
+++ evince-40.1/libview/ev-print-operation.c
|
||||
@@ -181,6 +181,7 @@ ev_print_operation_set_current_page (EvP
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_if_fail (EV_IS_PRINT_OPERATION (op));
|
||||
+ g_return_if_fail (class != NULL);
|
||||
g_return_if_fail (current_page >= 0);
|
||||
|
||||
class->set_current_page (op, current_page);
|
||||
@@ -193,6 +194,7 @@ ev_print_operation_set_print_settings (E
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_if_fail (EV_IS_PRINT_OPERATION (op));
|
||||
+ g_return_if_fail (class != NULL);
|
||||
g_return_if_fail (GTK_IS_PRINT_SETTINGS (print_settings));
|
||||
|
||||
class->set_print_settings (op, print_settings);
|
||||
@@ -210,6 +212,7 @@ ev_print_operation_get_print_settings (E
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_val_if_fail (EV_IS_PRINT_OPERATION (op), NULL);
|
||||
+ g_return_val_if_fail (class != NULL, NULL);
|
||||
|
||||
return class->get_print_settings (op);
|
||||
}
|
||||
@@ -221,6 +224,7 @@ ev_print_operation_set_default_page_setu
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_if_fail (EV_IS_PRINT_OPERATION (op));
|
||||
+ g_return_if_fail (class != NULL);
|
||||
g_return_if_fail (GTK_IS_PAGE_SETUP (page_setup));
|
||||
|
||||
class->set_default_page_setup (op, page_setup);
|
||||
@@ -238,6 +242,7 @@ ev_print_operation_get_default_page_setu
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_val_if_fail (EV_IS_PRINT_OPERATION (op), NULL);
|
||||
+ g_return_val_if_fail (class != NULL, NULL);
|
||||
|
||||
return class->get_default_page_setup (op);
|
||||
}
|
||||
@@ -249,6 +254,7 @@ ev_print_operation_set_job_name (EvPrint
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_if_fail (EV_IS_PRINT_OPERATION (op));
|
||||
+ g_return_if_fail (class != NULL);
|
||||
g_return_if_fail (job_name != NULL);
|
||||
|
||||
class->set_job_name (op, job_name);
|
||||
@@ -260,6 +266,7 @@ ev_print_operation_get_job_name (EvPrint
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_val_if_fail (EV_IS_PRINT_OPERATION (op), NULL);
|
||||
+ g_return_val_if_fail (class != NULL, NULL);
|
||||
|
||||
return class->get_job_name (op);
|
||||
}
|
||||
@@ -271,6 +278,7 @@ ev_print_operation_run (EvPrintOperation
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_if_fail (EV_IS_PRINT_OPERATION (op));
|
||||
+ g_return_if_fail (class != NULL);
|
||||
|
||||
class->run (op, parent);
|
||||
}
|
||||
@@ -281,6 +289,7 @@ ev_print_operation_cancel (EvPrintOperat
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_if_fail (EV_IS_PRINT_OPERATION (op));
|
||||
+ g_return_if_fail (class != NULL);
|
||||
|
||||
class->cancel (op);
|
||||
}
|
||||
@@ -292,6 +301,7 @@ ev_print_operation_get_error (EvPrintOpe
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_if_fail (EV_IS_PRINT_OPERATION (op));
|
||||
+ g_return_if_fail (class != NULL);
|
||||
|
||||
class->get_error (op, error);
|
||||
}
|
||||
@@ -303,6 +313,7 @@ ev_print_operation_set_embed_page_setup
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_if_fail (EV_IS_PRINT_OPERATION (op));
|
||||
+ g_return_if_fail (class != NULL);
|
||||
|
||||
class->set_embed_page_setup (op, embed);
|
||||
}
|
||||
@@ -313,6 +324,7 @@ ev_print_operation_get_embed_page_setup
|
||||
EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
|
||||
|
||||
g_return_val_if_fail (EV_IS_PRINT_OPERATION (op), FALSE);
|
||||
+ g_return_val_if_fail (class != NULL, FALSE);
|
||||
|
||||
return class->get_embed_page_setup (op);
|
||||
}
|
||||
--- evince-40.1/libview/ev-timeline.c
|
||||
+++ evince-40.1/libview/ev-timeline.c
|
||||
@@ -289,9 +289,15 @@ ev_timeline_new (guint duration)
|
||||
void
|
||||
ev_timeline_start (EvTimeline *timeline)
|
||||
{
|
||||
+ EvTimelineClass *klass;
|
||||
+
|
||||
g_return_if_fail (EV_IS_TIMELINE (timeline));
|
||||
|
||||
- EV_TIMELINE_GET_CLASS (timeline)->start (timeline);
|
||||
+ klass = EV_TIMELINE_GET_CLASS (timeline);
|
||||
+
|
||||
+ g_return_if_fail (klass != NULL);
|
||||
+
|
||||
+ klass->start (timeline);
|
||||
}
|
||||
|
||||
void
|
||||
--- evince-40.1/libview/ev-view.c
|
||||
+++ evince-40.1/libview/ev-view.c
|
||||
@@ -1147,7 +1147,7 @@ ensure_rectangle_is_visible (EvView *vie
|
||||
if (rect->x < adj_value) {
|
||||
value = MAX (gtk_adjustment_get_lower (adjustment), rect->x - MARGIN);
|
||||
gtk_adjustment_set_value (view->hadjustment, value);
|
||||
- } else if (rect->x + rect->height > adj_value + allocation.width) {
|
||||
+ } else if (rect->x + rect->width > adj_value + allocation.width) {
|
||||
value = MIN (gtk_adjustment_get_upper (adjustment), rect->x + rect->width -
|
||||
allocation.width + MARGIN);
|
||||
gtk_adjustment_set_value (view->hadjustment, value);
|
||||
@@ -1777,6 +1777,11 @@ goto_fitv_dest (EvView *view, EvLinkDest
|
||||
|
||||
page = ev_link_dest_get_page (dest);
|
||||
|
||||
+ if (page < 0) {
|
||||
+ g_warning ("Link does not contain a page.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
left = ev_link_dest_get_left (dest, &change_left);
|
||||
doc_point.x = change_left ? left : 0;
|
||||
doc_point.y = 0;
|
||||
@@ -1813,6 +1818,11 @@ goto_fith_dest (EvView *view, EvLinkDest
|
||||
|
||||
page = ev_link_dest_get_page (dest);
|
||||
|
||||
+ if (page < 0) {
|
||||
+ g_warning ("Link does not contain a page.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
top = ev_link_dest_get_top (dest, &change_top);
|
||||
doc_point.x = 0;
|
||||
doc_point.y = change_top ? top : 0;
|
||||
@@ -1846,6 +1856,11 @@ goto_fit_dest (EvView *view, EvLinkDest
|
||||
|
||||
page = ev_link_dest_get_page (dest);
|
||||
|
||||
+ if (page < 0) {
|
||||
+ g_warning ("Link does not contain a page.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (view->allow_links_change_zoom) {
|
||||
double zoom;
|
||||
gdouble doc_width, doc_height;
|
||||
--- evince-40.1/libview/ev-view-presentation.c
|
||||
+++ evince-40.1/libview/ev-view-presentation.c
|
||||
@@ -448,7 +448,7 @@ ev_view_presentation_update_current_page
|
||||
{
|
||||
gint jump;
|
||||
|
||||
- if (page < 0 || page >= ev_document_get_n_pages (pview->document))
|
||||
+ if (page >= ev_document_get_n_pages (pview->document))
|
||||
return;
|
||||
|
||||
ev_view_presentation_animation_cancel (pview);
|
||||
--- evince-40.1/shell/ev-find-sidebar.c
|
||||
+++ evince-40.1/shell/ev-find-sidebar.c
|
||||
@@ -476,8 +476,10 @@ process_matches_idle (EvFindSidebar *sid
|
||||
page_label = ev_document_get_page_label (document, current_page);
|
||||
page_text = get_page_text (document, page, &areas, &n_areas);
|
||||
g_object_unref (page);
|
||||
- if (!page_text)
|
||||
+ if (!page_text) {
|
||||
+ g_free (page_label);
|
||||
continue;
|
||||
+ }
|
||||
|
||||
text_log_attrs_length = g_utf8_strlen (page_text, -1);
|
||||
text_log_attrs = g_new0 (PangoLogAttr, text_log_attrs_length + 1);
|
||||
--- evince-40.1/shell/ev-sidebar-thumbnails.c
|
||||
+++ evince-40.1/shell/ev-sidebar-thumbnails.c
|
||||
@@ -658,11 +658,11 @@ ev_sidebar_thumbnails_fill_model (EvSide
|
||||
int i;
|
||||
gint prev_width = -1;
|
||||
gint prev_height = -1;
|
||||
+ cairo_surface_t *loading_icon = NULL;
|
||||
|
||||
for (i = 0; i < sidebar_thumbnails->priv->n_pages; i++) {
|
||||
gchar *page_label;
|
||||
gchar *page_string;
|
||||
- cairo_surface_t *loading_icon = NULL;
|
||||
gint width, height;
|
||||
|
||||
page_label = ev_document_get_page_label (priv->document, i);
|
||||
--- evince-40.1/shell/ev-window.c
|
||||
+++ evince-40.1/shell/ev-window.c
|
||||
@@ -3121,10 +3121,10 @@ ev_window_load_print_settings_from_metad
|
||||
for (i = 0; i < G_N_ELEMENTS (document_print_settings); i++) {
|
||||
gchar *value = NULL;
|
||||
|
||||
- ev_metadata_get_string (priv->metadata,
|
||||
- document_print_settings[i], &value);
|
||||
- gtk_print_settings_set (print_settings,
|
||||
- document_print_settings[i], value);
|
||||
+ if (ev_metadata_get_string (priv->metadata,
|
||||
+ document_print_settings[i], &value))
|
||||
+ gtk_print_settings_set (print_settings,
|
||||
+ document_print_settings[i], value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4705,12 +4705,16 @@ ev_window_cmd_bookmarks_add (GSimpleActi
|
||||
gchar *page_label;
|
||||
|
||||
bm.page = ev_document_model_get_page (priv->model);
|
||||
- page_label = ev_document_get_page_label (priv->document, bm.page);
|
||||
- bm.title = g_strdup_printf (_("Page %s"), page_label);
|
||||
- g_free (page_label);
|
||||
+ if (bm.page >= 0) {
|
||||
+ page_label = ev_document_get_page_label (priv->document, bm.page);
|
||||
+ bm.title = g_strdup_printf (_("Page %s"), page_label);
|
||||
+ g_free (page_label);
|
||||
|
||||
- /* EvBookmarks takes ownership of bookmark */
|
||||
- ev_bookmarks_add (priv->bookmarks, &bm);
|
||||
+ /* EvBookmarks takes ownership of bookmark */
|
||||
+ ev_bookmarks_add (priv->bookmarks, &bm);
|
||||
+ } else {
|
||||
+ g_warning ("Bookmarking of a page failed.");
|
||||
+ }
|
||||
}
|
||||
|
||||
static void
|
|
@ -0,0 +1,31 @@
|
|||
From ad28a28e94c63c9ed44d01cf274e487ec85f2a46 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Wed, 13 Oct 2021 11:00:07 +0200
|
||||
Subject: [PATCH] Remove "Quit" from shortcuts page
|
||||
|
||||
The shortcut "Ctrl + q" does not do anything.
|
||||
---
|
||||
shell/help-overlay.ui | 7 -------
|
||||
1 file changed, 7 deletions(-)
|
||||
|
||||
diff --git a/shell/help-overlay.ui b/shell/help-overlay.ui
|
||||
index d2057348..ced1dd56 100644
|
||||
--- a/shell/help-overlay.ui
|
||||
+++ b/shell/help-overlay.ui
|
||||
@@ -396,13 +396,6 @@
|
||||
<property name="accelerator"><Primary>W</property>
|
||||
</object>
|
||||
</child>
|
||||
- <child>
|
||||
- <object class="GtkShortcutsShortcut">
|
||||
- <property name="visible">True</property>
|
||||
- <property name="title" translatable="yes" context="shortcut window">Quit</property>
|
||||
- <property name="accelerator"><Primary>Q</property>
|
||||
- </object>
|
||||
- </child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">True</property>
|
||||
--
|
||||
2.31.1
|
||||
|
66
evince.spec
66
evince.spec
|
@ -3,16 +3,19 @@
|
|||
%global __requires_exclude ^(%%(find %{buildroot}%{_libdir}/evince/ -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -))
|
||||
|
||||
Name: evince
|
||||
Version: 40.1
|
||||
Release: 4%{?dist}
|
||||
Version: 40.5
|
||||
Release: 2%{?dist}
|
||||
Summary: Document viewer
|
||||
|
||||
License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
|
||||
URL: https://wiki.gnome.org/Apps/Evince
|
||||
Source0: https://download.gnome.org/sources/%{name}/40/%{name}-%{version}.tar.xz
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1927705
|
||||
Patch0: evince-40.1-Show-password-dialog-again.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1975150
|
||||
Patch1: evince-40.1-covscan.patch
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2006768
|
||||
Patch2: evince-40.4-quit-shortcut.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: gcc
|
||||
|
@ -56,6 +59,9 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|||
Requires: %{name}-previewer%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-thumbnailer%{?_isa} = %{version}-%{release}
|
||||
|
||||
Provides: bundled(libunarr)
|
||||
Provides: bundled(libmdvi)
|
||||
|
||||
%description
|
||||
Evince is simple multi-page document viewer. It can display and print
|
||||
Portable Document Format (PDF), PostScript (PS) and Encapsulated PostScript
|
||||
|
@ -107,7 +113,7 @@ This package contains a backend to let evince display djvu files.
|
|||
%if ! 0%{?flatpak}
|
||||
%package nautilus
|
||||
Summary: Evince extension for nautilus
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
Requires: nautilus%{?_isa}
|
||||
|
||||
%description nautilus
|
||||
|
@ -163,6 +169,11 @@ It provides the printing preview for the GTK printing dialog.
|
|||
%find_lang evince --with-gnome
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/metainfo/evince-pdfdocument.metainfo.xml
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/metainfo/evince-psdocument.metainfo.xml
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/metainfo/evince-tiffdocument.metainfo.xml
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/metainfo/evince-comicsdocument.metainfo.xml
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/metainfo/evince-xpsdocument.metainfo.xml
|
||||
|
||||
%check
|
||||
appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/metainfo/org.gnome.Evince.appdata.xml
|
||||
|
@ -198,25 +209,20 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
|
|||
%dir %{_libdir}/evince/4/backends
|
||||
%{_libdir}/evince/4/backends/libpdfdocument.so
|
||||
%{_libdir}/evince/4/backends/pdfdocument.evince-backend
|
||||
%{_datadir}/metainfo/evince-pdfdocument.metainfo.xml
|
||||
|
||||
%{_libdir}/evince/4/backends/libpsdocument.so
|
||||
%{_libdir}/evince/4/backends/psdocument.evince-backend
|
||||
%{_datadir}/metainfo/evince-psdocument.metainfo.xml
|
||||
|
||||
%{_libdir}/evince/4/backends/libtiffdocument.so
|
||||
%{_libdir}/evince/4/backends/tiffdocument.evince-backend
|
||||
%{_datadir}/metainfo/evince-tiffdocument.metainfo.xml
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} > 7
|
||||
%{_libdir}/evince/4/backends/libcomicsdocument.so
|
||||
%{_libdir}/evince/4/backends/comicsdocument.evince-backend
|
||||
%{_datadir}/metainfo/evince-comicsdocument.metainfo.xml
|
||||
%endif
|
||||
|
||||
%{_libdir}/evince/4/backends/libxpsdocument.so
|
||||
%{_libdir}/evince/4/backends/xpsdocument.evince-backend
|
||||
%{_datadir}/metainfo/evince-xpsdocument.metainfo.xml
|
||||
|
||||
%{_libdir}/girepository-1.0/EvinceDocument-3.0.typelib
|
||||
%{_libdir}/girepository-1.0/EvinceView-3.0.typelib
|
||||
|
@ -263,6 +269,46 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
|
|||
%{_mandir}/man1/evince-previewer.1*
|
||||
|
||||
%changelog
|
||||
* Tue May 24 2022 Marek Kasik <mkasik@redhat.com> - 40.5-2
|
||||
- Fix requirements of evince-nautilus
|
||||
- Required by CI
|
||||
- Related: #2066166
|
||||
|
||||
* Mon May 23 2022 Marek Kasik <mkasik@redhat.com> - 40.5-1
|
||||
- Rebase to 40.5
|
||||
- Resolves: #2066166
|
||||
|
||||
* Wed Jan 19 2022 Marek Kasik <mkasik@redhat.com> - 40.4-4
|
||||
- Allow annotation actions for PDFs only
|
||||
- Resolves: #2041333
|
||||
|
||||
* Tue Nov 02 2021 Marek Kasik <mkasik@redhat.com> - 40.4-3
|
||||
- Remove Ctrl+q shortcut from shortcuts page
|
||||
- because it does nothing.
|
||||
- Resolves: #2006768
|
||||
|
||||
* Wed Sep 15 2021 Marek Kasik <mkasik@redhat.com> - 40.4-2
|
||||
- Remove metainfo for plugins since they are not real addons
|
||||
- Resolves: #2001781
|
||||
|
||||
* Mon Aug 16 2021 Marek Kasik <mkasik@redhat.com> - 40.4-1
|
||||
- Update to 40.4
|
||||
- Resolves: #1991425
|
||||
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 40.2-2
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Tue Jun 29 2021 Marek Kasik <mkasik@redhat.com> - 40.2-1
|
||||
- Update to 40.2
|
||||
- Resolves: #1976711
|
||||
|
||||
* Thu Jun 24 2021 Marek Kasik <mkasik@redhat.com> - 40.1-5
|
||||
- Use tmp dir as containing folder for non-native files
|
||||
- Backport fixes for issues found by Coverity Scan
|
||||
- Fix some other issues found by Coverity Scan
|
||||
- Resolves: #1975150
|
||||
|
||||
* Tue Jun 15 2021 Marek Kasik <mkasik@redhat.com> - 40.1-4
|
||||
- Show password dialog again if cancelled previously
|
||||
- Resolves: #1927705
|
||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (evince-40.1.tar.xz) = c688ee962cfff8b024b572161bae689d25b5b566ac623abeff38b4b8e6e541ce343023ed2c1ba0df1f65d6ec9a631aac3a748c940db556dbb89ab45ac565147d
|
||||
SHA512 (evince-40.5.tar.xz) = fb1df1e5dc7aa2fa7878c34157619f0e15b5aa4ba4305ab2250af109015a971594927b570238853ba1db52a3d0c6df70c678cea43721dcc345c25cb3d2d8a1c1
|
||||
|
|
Loading…
Reference in New Issue