From 1a9dc517d24c563078b45a9d1a0c82ef3c710fef Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Wed, 20 Apr 2005 23:06:19 +0000 Subject: [PATCH] Implement dummy get_info to fix crash --- ChangeLog | 10 ++++++++++ djvu/djvu-document.c | 43 +++++++++++-------------------------------- dvi/dvi-document.c | 42 +++++++++++------------------------------- 3 files changed, 32 insertions(+), 63 deletions(-) diff --git a/ChangeLog b/ChangeLog index 851d8c76..82894001 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-04-21 Nickolay V. Shmyrev + + * djvu/djvu-document.c: (djvu_document_class_init), + (djvu_document_get_info), (djvu_document_document_iface_init): + * dvi/dvi-document.c: (dvi_document_class_init), + (dvi_document_get_info), (dvi_document_document_iface_init): + + Dummy implementation of get_info method for dvi and djvu. Fix + crashes with those backends + 2005-04-20 Marco Pesenti Gritti * data/evince.desktop.in: diff --git a/djvu/djvu-document.c b/djvu/djvu-document.c index d74af665..e6a270f1 100644 --- a/djvu/djvu-document.c +++ b/djvu/djvu-document.c @@ -184,44 +184,12 @@ djvu_document_finalize (GObject *object) G_OBJECT_CLASS (djvu_document_parent_class)->finalize (object); } -static void -djvu_document_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) - { - case PROP_TITLE: - /* read only */ - break; - } -} - -static void -djvu_document_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) - { - case PROP_TITLE: - g_value_set_string (value, NULL); - break; - } -} - static void djvu_document_class_init (DjvuDocumentClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = djvu_document_finalize; - gobject_class->get_property = djvu_document_get_property; - gobject_class->set_property = djvu_document_set_property; - - g_object_class_override_property (gobject_class, PROP_TITLE, "title"); } static gboolean @@ -230,6 +198,16 @@ djvu_document_can_get_text (EvDocument *document) return FALSE; } +static EvDocumentInfo * +djvu_document_get_info (EvDocument *document) +{ + EvDocumentInfo *info; + + info = g_new0 (EvDocumentInfo, 1); + + return info; +} + static void djvu_document_document_iface_init (EvDocumentIface *iface) { @@ -239,6 +217,7 @@ djvu_document_document_iface_init (EvDocumentIface *iface) iface->get_n_pages = djvu_document_get_n_pages; iface->get_page_size = djvu_document_get_page_size; iface->render_pixbuf = djvu_document_render_pixbuf; + iface->get_info = djvu_document_get_info; } static void diff --git a/dvi/dvi-document.c b/dvi/dvi-document.c index b9edc9e6..61526d2d 100644 --- a/dvi/dvi-document.c +++ b/dvi/dvi-document.c @@ -198,33 +198,6 @@ dvi_document_finalize (GObject *object) G_OBJECT_CLASS (dvi_document_parent_class)->finalize (object); } -static void -dvi_document_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) - { - case PROP_TITLE: - /* read only */ - break; - } -} - -static void -dvi_document_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) - { - case PROP_TITLE: - g_value_set_string (value, NULL); - break; - } -} static void dvi_document_class_init (DviDocumentClass *klass) @@ -232,10 +205,6 @@ dvi_document_class_init (DviDocumentClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = dvi_document_finalize; - gobject_class->get_property = dvi_document_get_property; - gobject_class->set_property = dvi_document_set_property; - - g_object_class_override_property (gobject_class, PROP_TITLE, "title"); } static gboolean @@ -244,6 +213,16 @@ dvi_document_can_get_text (EvDocument *document) return FALSE; } +static EvDocumentInfo * +dvi_document_get_info (EvDocument *document) +{ + EvDocumentInfo *info; + + info = g_new0 (EvDocumentInfo, 1); + + return info; +} + static void dvi_document_document_iface_init (EvDocumentIface *iface) { @@ -253,6 +232,7 @@ dvi_document_document_iface_init (EvDocumentIface *iface) iface->get_n_pages = dvi_document_get_n_pages; iface->get_page_size = dvi_document_get_page_size; iface->render_pixbuf = dvi_document_render_pixbuf; + iface->get_info = dvi_document_get_info; } static void -- 2.43.5