Commit 356536f6 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

Add EvMappingList data struct instead of using a GList

It just wraps the GList and adds reference counting
parent c3f6c6c0
......@@ -689,7 +689,7 @@ djvu_document_find_iface_init (EvDocumentFindInterface *iface)
iface->find_text = djvu_document_find_find_text;
}
static GList *
static EvMappingList *
djvu_document_links_get_links (EvDocumentLinks *document_links,
EvPage *page)
{
......
......@@ -26,7 +26,7 @@
#include "djvu-links.h"
#include "djvu-document-private.h"
#include "ev-document-links.h"
#include "ev-mapping.h"
#include "ev-mapping-list.h"
static gboolean number_from_miniexp(miniexp_t sexp, int *number)
{
......@@ -354,7 +354,7 @@ djvu_links_has_document_links (EvDocumentLinks *document_links)
return FALSE;
}
GList *
EvMappingList *
djvu_links_get_links (EvDocumentLinks *document_links,
gint page,
double scale_factor)
......@@ -390,7 +390,7 @@ djvu_links_get_links (EvDocumentLinks *document_links,
ddjvu_miniexp_release (djvu_document->d_document, page_annotations);
}
return retval;
return ev_mapping_list_new (page, retval, (GDestroyNotify)g_object_unref);
}
EvLinkDest *
......
......@@ -24,12 +24,12 @@
#include <glib.h>
GtkTreeModel *djvu_links_get_links_model (EvDocumentLinks *document_links);
GList *djvu_links_get_links (EvDocumentLinks *document_links,
gint page,
double scale_factor);
EvLinkDest *djvu_links_find_link_dest (EvDocumentLinks *document_links,
const gchar *link_name);
gboolean djvu_links_has_document_links (EvDocumentLinks *document_links);
GtkTreeModel *djvu_links_get_links_model (EvDocumentLinks *document_links);
EvMappingList *djvu_links_get_links (EvDocumentLinks *document_links,
gint page,
double scale_factor);
EvLinkDest *djvu_links_find_link_dest (EvDocumentLinks *document_links,
const gchar *link_name);
gboolean djvu_links_has_document_links (EvDocumentLinks *document_links);
#endif /* __DJVU_LINK_H__ */
......@@ -37,7 +37,6 @@
#include "ev-poppler.h"
#include "ev-file-exporter.h"
#include "ev-mapping.h"
#include "ev-document-find.h"
#include "ev-document-misc.h"
#include "ev-document-links.h"
......@@ -1242,7 +1241,7 @@ pdf_document_links_get_links_model (EvDocumentLinks *document_links)
return model;
}
static GList *
static EvMappingList *
pdf_document_links_get_links (EvDocumentLinks *document_links,
EvPage *page)
{
......@@ -1277,7 +1276,7 @@ pdf_document_links_get_links (EvDocumentLinks *document_links,
poppler_page_free_link_mapping (mapping_list);
return g_list_reverse (retval);
return ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
}
static EvLinkDest *
......@@ -1308,7 +1307,7 @@ pdf_document_document_links_iface_init (EvDocumentLinksInterface *iface)
iface->find_link_dest = pdf_document_links_find_link_dest;
}
static GList *
static EvMappingList *
pdf_document_images_get_image_mapping (EvDocumentImages *document_images,
EvPage *page)
{
......@@ -1341,7 +1340,7 @@ pdf_document_images_get_image_mapping (EvDocumentImages *document_images,
poppler_page_free_image_mapping (mapping_list);
return g_list_reverse (retval);
return ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
}
GdkPixbuf *
......@@ -2265,7 +2264,7 @@ ev_form_field_from_poppler_field (PopplerFormField *poppler_field)
return ev_field;
}
static GList *
static EvMappingList *
pdf_document_forms_get_form_fields (EvDocumentForms *document,
EvPage *page)
{
......@@ -2310,7 +2309,9 @@ pdf_document_forms_get_form_fields (EvDocumentForms *document,
poppler_page_free_form_field_mapping (fields);
return g_list_reverse (retval);
return retval ? ev_mapping_list_new (page->index,
g_list_reverse (retval),
(GDestroyNotify)g_object_unref) : NULL;
}
static gchar *
......@@ -2664,7 +2665,7 @@ ev_annot_from_poppler_annot (PopplerAnnot *poppler_annot,
return ev_annot;
}
static GList *
static EvMappingList *
pdf_document_annotations_get_annotations (EvDocumentAnnotations *document_annotations,
EvPage *page)
{
......@@ -2715,7 +2716,7 @@ pdf_document_annotations_get_annotations (EvDocumentAnnotations *document_annota
poppler_page_free_annot_mapping (annots);
return g_list_reverse (retval);
return ev_mapping_list_new (page->index, g_list_reverse (retval), (GDestroyNotify)g_object_unref);
}
static void
......
......@@ -49,6 +49,7 @@
#include <libdocument/ev-link-action.h>
#include <libdocument/ev-link-dest.h>
#include <libdocument/ev-link.h>
#include <libdocument/ev-mapping-list.h>
#include <libdocument/ev-page.h>
#include <libdocument/ev-render-context.h>
#include <libdocument/ev-selection.h>
......
......@@ -35,7 +35,7 @@ INST_H_SRC_FILES = \
ev-link-action.h \
ev-link-dest.h \
ev-link.h \
ev-mapping.h \
ev-mapping-list.h \
ev-page.h \
ev-render-context.h \
ev-selection.h \
......@@ -80,7 +80,7 @@ libevdocument_la_SOURCES= \
ev-debug.c \
ev-file-exporter.c \
ev-file-helpers.c \
ev-mapping.c \
ev-mapping-list.c \
ev-module.c \
ev-page.c \
ev-render-context.c \
......
......@@ -28,7 +28,7 @@ ev_document_annotations_default_init (EvDocumentAnnotationsInterface *klass)
{
}
GList *
EvMappingList *
ev_document_annotations_get_annotations (EvDocumentAnnotations *document_annots,
EvPage *page)
{
......
......@@ -29,6 +29,7 @@
#include "ev-document.h"
#include "ev-annotation.h"
#include "ev-mapping-list.h"
G_BEGIN_DECLS
......@@ -47,20 +48,20 @@ struct _EvDocumentAnnotationsInterface
GTypeInterface base_iface;
/* Methods */
GList *(* get_annotations) (EvDocumentAnnotations *document_annots,
EvPage *page);
void (* annotation_set_contents) (EvDocumentAnnotations *document_annots,
EvAnnotation *annot,
const gchar *contents);
EvMappingList *(* get_annotations) (EvDocumentAnnotations *document_annots,
EvPage *page);
void (* annotation_set_contents) (EvDocumentAnnotations *document_annots,
EvAnnotation *annot,
const gchar *contents);
};
GType ev_document_annotations_get_type (void) G_GNUC_CONST;
GList *ev_document_annotations_get_annotations (EvDocumentAnnotations *document_annots,
EvPage *page);
GType ev_document_annotations_get_type (void) G_GNUC_CONST;
EvMappingList *ev_document_annotations_get_annotations (EvDocumentAnnotations *document_annots,
EvPage *page);
void ev_document_annotations_annotation_set_contents (EvDocumentAnnotations *document_annots,
EvAnnotation *annot,
const gchar *contents);
void ev_document_annotations_annotation_set_contents (EvDocumentAnnotations *document_annots,
EvAnnotation *annot,
const gchar *contents);
G_END_DECLS
......
......@@ -28,7 +28,7 @@ ev_document_forms_default_init (EvDocumentFormsInterface *klass)
{
}
GList *
EvMappingList *
ev_document_forms_get_form_fields (EvDocumentForms *document_forms,
EvPage *page)
{
......
......@@ -29,6 +29,7 @@
#include "ev-document.h"
#include "ev-form-field.h"
#include "ev-mapping-list.h"
G_BEGIN_DECLS
......@@ -47,78 +48,78 @@ struct _EvDocumentFormsInterface
GTypeInterface base_iface;
/* Methods */
GList *(* get_form_fields) (EvDocumentForms *document_forms,
EvPage *page);
gchar *(* form_field_text_get_text) (EvDocumentForms *document_forms,
EvFormField *field);
void (* form_field_text_set_text) (EvDocumentForms *document_forms,
EvFormField *field,
const gchar *text);
gboolean (* form_field_button_get_state) (EvDocumentForms *document_forms,
EvFormField *field);
void (* form_field_button_set_state) (EvDocumentForms *document_forms,
EvFormField *field,
gboolean state);
gchar *(* form_field_choice_get_item) (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
gint (* form_field_choice_get_n_items) (EvDocumentForms *document_forms,
EvFormField *field);
gboolean (* form_field_choice_is_item_selected) (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void (* form_field_choice_select_item) (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void (* form_field_choice_toggle_item) (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void (* form_field_choice_unselect_all) (EvDocumentForms *document_forms,
EvFormField *field);
void (* form_field_choice_set_text) (EvDocumentForms *document_forms,
EvFormField *field,
const gchar *text);
gchar *(* form_field_choice_get_text) (EvDocumentForms *document_forms,
EvFormField *field);
EvMappingList *(* get_form_fields) (EvDocumentForms *document_forms,
EvPage *page);
gchar *(* form_field_text_get_text) (EvDocumentForms *document_forms,
EvFormField *field);
void (* form_field_text_set_text) (EvDocumentForms *document_forms,
EvFormField *field,
const gchar *text);
gboolean (* form_field_button_get_state) (EvDocumentForms *document_forms,
EvFormField *field);
void (* form_field_button_set_state) (EvDocumentForms *document_forms,
EvFormField *field,
gboolean state);
gchar *(* form_field_choice_get_item) (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
gint (* form_field_choice_get_n_items) (EvDocumentForms *document_forms,
EvFormField *field);
gboolean (* form_field_choice_is_item_selected) (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void (* form_field_choice_select_item) (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void (* form_field_choice_toggle_item) (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void (* form_field_choice_unselect_all) (EvDocumentForms *document_forms,
EvFormField *field);
void (* form_field_choice_set_text) (EvDocumentForms *document_forms,
EvFormField *field,
const gchar *text);
gchar *(* form_field_choice_get_text) (EvDocumentForms *document_forms,
EvFormField *field);
};
GType ev_document_forms_get_type (void) G_GNUC_CONST;
GList *ev_document_forms_get_form_fields (EvDocumentForms *document_forms,
EvPage *page);
GType ev_document_forms_get_type (void) G_GNUC_CONST;
EvMappingList *ev_document_forms_get_form_fields (EvDocumentForms *document_forms,
EvPage *page);
gchar *ev_document_forms_form_field_text_get_text (EvDocumentForms *document_forms,
EvFormField *field);
void ev_document_forms_form_field_text_set_text (EvDocumentForms *document_forms,
EvFormField *field,
const gchar *text);
gchar *ev_document_forms_form_field_text_get_text (EvDocumentForms *document_forms,
EvFormField *field);
void ev_document_forms_form_field_text_set_text (EvDocumentForms *document_forms,
EvFormField *field,
const gchar *text);
gboolean ev_document_forms_form_field_button_get_state (EvDocumentForms *document_forms,
EvFormField *field);
void ev_document_forms_form_field_button_set_state (EvDocumentForms *document_forms,
EvFormField *field,
gboolean state);
gboolean ev_document_forms_form_field_button_get_state (EvDocumentForms *document_forms,
EvFormField *field);
void ev_document_forms_form_field_button_set_state (EvDocumentForms *document_forms,
EvFormField *field,
gboolean state);
gchar *ev_document_forms_form_field_choice_get_item (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
gint ev_document_forms_form_field_choice_get_n_items (EvDocumentForms *document_forms,
EvFormField *field);
gboolean ev_document_forms_form_field_choice_is_item_selected (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void ev_document_forms_form_field_choice_select_item (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void ev_document_forms_form_field_choice_toggle_item (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void ev_document_forms_form_field_choice_unselect_all (EvDocumentForms *document_forms,
EvFormField *field);
void ev_document_forms_form_field_choice_set_text (EvDocumentForms *document_forms,
EvFormField *field,
const gchar *text);
gchar *ev_document_forms_form_field_choice_get_text (EvDocumentForms *document_forms,
EvFormField *field);
gchar *ev_document_forms_form_field_choice_get_item (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
gint ev_document_forms_form_field_choice_get_n_items (EvDocumentForms *document_forms,
EvFormField *field);
gboolean ev_document_forms_form_field_choice_is_item_selected (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void ev_document_forms_form_field_choice_select_item (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void ev_document_forms_form_field_choice_toggle_item (EvDocumentForms *document_forms,
EvFormField *field,
gint index);
void ev_document_forms_form_field_choice_unselect_all (EvDocumentForms *document_forms,
EvFormField *field);
void ev_document_forms_form_field_choice_set_text (EvDocumentForms *document_forms,
EvFormField *field,
const gchar *text);
gchar *ev_document_forms_form_field_choice_get_text (EvDocumentForms *document_forms,
EvFormField *field);
G_END_DECLS
......
......@@ -28,7 +28,7 @@ ev_document_images_default_init (EvDocumentImagesInterface *klass)
{
}
GList *
EvMappingList *
ev_document_images_get_image_mapping (EvDocumentImages *document_images,
EvPage *page)
{
......
......@@ -30,6 +30,7 @@
#include "ev-document.h"
#include "ev-image.h"
#include "ev-mapping-list.h"
G_BEGIN_DECLS
......@@ -47,17 +48,17 @@ struct _EvDocumentImagesInterface {
GTypeInterface base_iface;
/* Methods */
GList *(* get_image_mapping) (EvDocumentImages *document_images,
EvPage *page);
GdkPixbuf *(* get_image) (EvDocumentImages *document_images,
EvImage *image);
EvMappingList *(* get_image_mapping) (EvDocumentImages *document_images,
EvPage *page);
GdkPixbuf *(* get_image) (EvDocumentImages *document_images,
EvImage *image);
};
GType ev_document_images_get_type (void) G_GNUC_CONST;
GList *ev_document_images_get_image_mapping (EvDocumentImages *document_images,
EvPage *page);
GdkPixbuf *ev_document_images_get_image (EvDocumentImages *document_images,
EvImage *image);
GType ev_document_images_get_type (void) G_GNUC_CONST;
EvMappingList *ev_document_images_get_image_mapping (EvDocumentImages *document_images,
EvPage *page);
GdkPixbuf *ev_document_images_get_image (EvDocumentImages *document_images,
EvImage *image);
G_END_DECLS
......
......@@ -54,16 +54,13 @@ ev_document_links_get_links_model (EvDocumentLinks *document_links)
return retval;
}
GList *
EvMappingList *
ev_document_links_get_links (EvDocumentLinks *document_links,
EvPage *page)
{
EvDocumentLinksInterface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
GList *retval;
retval = iface->get_links (document_links, page);
return retval;
return iface->get_links (document_links, page);
}
EvLinkDest *
......
......@@ -34,6 +34,7 @@
#include "ev-document.h"
#include "ev-link.h"
#include "ev-mapping-list.h"
G_BEGIN_DECLS
......@@ -60,26 +61,26 @@ struct _EvDocumentLinksInterface
GTypeInterface base_iface;
/* Methods */
gboolean (* has_document_links) (EvDocumentLinks *document_links);
GtkTreeModel *(* get_links_model) (EvDocumentLinks *document_links);
GList *(* get_links) (EvDocumentLinks *document_links,
EvPage *page);
EvLinkDest *(* find_link_dest) (EvDocumentLinks *document_links,
const gchar *link_name);
gboolean (* has_document_links) (EvDocumentLinks *document_links);
GtkTreeModel *(* get_links_model) (EvDocumentLinks *document_links);
EvMappingList *(* get_links) (EvDocumentLinks *document_links,
EvPage *page);
EvLinkDest *(* find_link_dest) (EvDocumentLinks *document_links,
const gchar *link_name);
};
GType ev_document_links_get_type (void);
gboolean ev_document_links_has_document_links (EvDocumentLinks *document_links);
GtkTreeModel *ev_document_links_get_links_model (EvDocumentLinks *document_links);
GType ev_document_links_get_type (void) G_GNUC_CONST;
gboolean ev_document_links_has_document_links (EvDocumentLinks *document_links);
GtkTreeModel *ev_document_links_get_links_model (EvDocumentLinks *document_links);
GList *ev_document_links_get_links (EvDocumentLinks *document_links,
EvPage *page);
EvLinkDest *ev_document_links_find_link_dest (EvDocumentLinks *document_links,
const gchar *link_name);
gint ev_document_links_get_dest_page (EvDocumentLinks *document_links,
EvLinkDest *dest);
gchar *ev_document_links_get_dest_page_label(EvDocumentLinks *document_links,
EvLinkDest *dest);
EvMappingList *ev_document_links_get_links (EvDocumentLinks *document_links,
EvPage *page);
EvLinkDest *ev_document_links_find_link_dest (EvDocumentLinks *document_links,
const gchar *link_name);
gint ev_document_links_get_dest_page (EvDocumentLinks *document_links,
EvLinkDest *dest);
gchar *ev_document_links_get_dest_page_label (EvDocumentLinks *document_links,
EvLinkDest *dest);
G_END_DECLS
......
......@@ -18,15 +18,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "ev-mapping.h"
#include "ev-mapping-list.h"
struct _EvMappingList {
guint page;
GList *list;
GDestroyNotify data_destroy_func;
volatile gint ref_count;
};
EvMapping *
ev_mapping_list_find (GList *mapping_list,
ev_mapping_list_find (EvMappingList *mapping_list,
gconstpointer data)
{
GList *list;
for (list = mapping_list; list; list = list->next) {
for (list = mapping_list->list; list; list = list->next) {
EvMapping *mapping = list->data;
if (mapping->data == data)
......@@ -37,13 +44,13 @@ ev_mapping_list_find (GList *mapping_list,
}
EvMapping *
ev_mapping_list_find_custom (GList *mapping_list,
ev_mapping_list_find_custom (EvMappingList *mapping_list,
gconstpointer data,
GCompareFunc func)
{
GList *list;
for (list = mapping_list; list; list = list->next) {
for (list = mapping_list->list; list; list = list->next) {
EvMapping *mapping = list->data;
if (!func (mapping->data, data))
......@@ -54,13 +61,13 @@ ev_mapping_list_find_custom (GList *mapping_list,
}
gpointer
ev_mapping_list_get_data (GList *mapping_list,
gdouble x,
gdouble y)
ev_mapping_list_get_data (EvMappingList *mapping_list,
gdouble x,
gdouble y)
{
GList *list;
for (list = mapping_list; list; list = list->next) {
for (list = mapping_list->list; list; list = list->next) {
EvMapping *mapping = list->data;
if ((x >= mapping->area.x1) &&
......@@ -74,6 +81,47 @@ ev_mapping_list_get_data (GList *mapping_list,
return NULL;
}
GList *
ev_mapping_list_get_list (EvMappingList *mapping_list)
{
return mapping_list ? mapping_list->list : NULL;
}
guint
ev_mapping_list_get_page (EvMappingList *mapping_list)
{
return mapping_list->page;
}
EvMappingList *
ev_mapping_list_new (guint page,
GList *list,
GDestroyNotify data_destroy_func)
{
EvMappingList *mapping_list;
g_return_val_if_fail (data_destroy_func != NULL, NULL);
mapping_list = g_slice_new (EvMappingList);
mapping_list->page = page;
mapping_list->list = list;
mapping_list->data_destroy_func = data_destroy_func;
mapping_list->ref_count = 1;
return mapping_list;
}
EvMappingList *
ev_mapping_list_ref (EvMappingList *mapping_list)
{
g_return_val_if_fail (mapping_list != NULL, NULL);
g_return_val_if_fail (mapping_list->ref_count > 0, mapping_list);
g_atomic_int_add (&mapping_list->ref_count, 1);
return mapping_list;
}
static void
mapping_list_free_foreach (EvMapping *mapping,
GDestroyNotify destroy_func)
......@@ -83,11 +131,16 @@ mapping_list_free_foreach (EvMapping *mapping,
}
void
ev_mapping_list_free (GList *mapping_list,
GDestroyNotify destroy_func)
ev_mapping_list_unref (EvMappingList *mapping_list)
{
g_list_foreach (mapping_list,
(GFunc)mapping_list_free_foreach,
destroy_func);
g_list_free (mapping_list);
g_return_if_fail (mapping_list != NULL);
g_return_if_fail (mapping_list->ref_count > 0);
if (g_atomic_int_exchange_and_add (&mapping_list->ref_count, -1) - 1 == 0) {
g_list_foreach (mapping_list->list,
(GFunc)mapping_list_free_foreach,
mapping_list->data_destroy_func);
g_list_free (mapping_list->list);
g_slice_free (EvMappingList, mapping_list);
}
}
......@@ -22,24 +22,32 @@
#error "Only <evince-document.h> can be included directly."
#endif
#ifndef EV_MAPPING_H
#define EV_MAPPING_H
#ifndef EV_MAPPING_LIST_H
#define EV_MAPPING_LIST_H
#include "ev-document.h"
G_BEGIN_DECLS
EvMapping *ev_mapping_list_find (GList *mapping_list,
gconstpointer data);
EvMapping *ev_mapping_list_find_custom (GList *mapping_list,
gconstpointer data,
GCompareFunc func);
gpointer ev_mapping_list_get_data (GList *mapping_list,
gdouble x,
gdouble y);
void ev_mapping_list_free (GList *mapping_list,
GDestroyNotify destroy_func);
typedef struct _EvMappingList EvMappingList;
EvMappingList *ev_mapping_list_new (guint page,
GList *list,
GDestroyNotify data_destroy_func);
EvMappingList *ev_mapping_list_ref (EvMappingList *mapping_list);
void ev_mapping_list_unref (EvMappingList *mapping_list);
guint ev_mapping_list_get_page (EvMappingList *mapping_list);
GList *ev_mapping_list_get_list (EvMappingList *mapping_list);
EvMapping *ev_mapping_list_find (EvMappingList *mapping_list,
gconstpointer data);
EvMapping *ev_mapping_list_find_custom (EvMappingList *mapping_list,
gconstpointer data,
GCompareFunc func);
gpointer ev_mapping_list_get_data (EvMappingList *mapping_list,
gdouble x,
gdouble y);
G_END_DECLS
#endif /* EV_MAPPING_H */
#endif /* EV_MAPPING_LIST_H */
......@@ -243,10 +243,10 @@ struct _EvJobPageData
gint page;
EvJobPageDataFlags flags;
GList *link_mapping;
GList *image_mapping;
GList *form_field_mapping;
GList *annot_mapping;
EvMappingList *link_mapping;
EvMappingList *image_mapping;
EvMappingList *form_field_mapping;
EvMappingList *annot_mapping;
cairo_region_t *text_mapping;
gchar *text;
EvRectangle *text_layout;
......
......@@ -22,7 +22,7 @@
#include <glib.h>
#include "ev-jobs.h"
#include "ev-job-scheduler.h"
#include "ev-mapping.h"
#include "ev-mapping-list.h"
#include "ev-selection.h"
#include "ev-document-links.h"
#include "ev-document-forms.h"
......@@ -35,10 +35,10 @@ typedef struct _EvPageCacheData {
EvJob *job;
gboolean done : 1;
GList *link_mapping;
GList *image_mapping;
GList *form_field_mapping;
GList *annot_mapping;
EvMappingList *link_mapping;
EvMappingList *image_mapping;
EvMappingList *form_field_mapping;
EvMappingList *annot_mapping;
cairo_region_t *text_mapping;
EvRectangle *text_layout;
guint text_layout_length;
......@@ -72,22 +72,22 @@ ev_page_cache_data_free (EvPageCacheData *data)
}
if (data->link_mapping) {
ev_mapping_list_free (data->link_mapping, g_object_unref);
ev_mapping_list_unref (data->link_mapping);
data->link_mapping = NULL;
}
if (data->image_mapping) {
ev_mapping_list_free (data->image_mapping, g_object_unref);
ev_mapping_list_unref (data->image_mapping);
data->image_mapping = NULL;
}