summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermán Poo-Caamaño <[email protected]>2014-05-02 23:08:53 -0700
committerraveit65 <[email protected]>2017-08-28 16:04:00 +0200
commitcd5aaa1eabf27936c8a348d4712d711800bdd67f (patch)
tree5395f9c488f2228cbd80f635d918567b03cb2b88
parent0f5c79f2e03bd71b91d2fbf3aa48f4ffbf1dd1b1 (diff)
downloadatril-cd5aaa1eabf27936c8a348d4712d711800bdd67f.tar.bz2
atril-cd5aaa1eabf27936c8a348d4712d711800bdd67f.tar.xz
libdocument: add ev_mapping_list_remove
Needed to remove annotations from a mapping list https://bugzilla.gnome.org/show_bug.cgi?id=649044 origin commit: https://git.gnome.org/browse/evince/commit/?id=5aac9ac
-rw-r--r--libdocument/ev-mapping-list.c19
-rw-r--r--libdocument/ev-mapping-list.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/libdocument/ev-mapping-list.c b/libdocument/ev-mapping-list.c
index 8c639e8e..6745d1d9 100644
--- a/libdocument/ev-mapping-list.c
+++ b/libdocument/ev-mapping-list.c
@@ -156,6 +156,25 @@ ev_mapping_list_get_list (EvMappingList *mapping_list)
return mapping_list ? mapping_list->list : NULL;
}
+/**
+ * ev_mapping_list_remove:
+ * @mapping_list: an #EvMappingList
+ * @mapping: #EvMapping to remove
+ *
+ * Returns: an #EvMappingList
+ *
+ * Since: 3.14
+ */
+EvMappingList *
+ev_mapping_list_remove (EvMappingList *mapping_list,
+ EvMapping *mapping)
+{
+ mapping_list->list = g_list_remove (mapping_list->list, mapping);
+ mapping_list->data_destroy_func (mapping->data);
+ g_free (mapping);
+ return mapping_list;
+}
+
guint
ev_mapping_list_get_page (EvMappingList *mapping_list)
{
diff --git a/libdocument/ev-mapping-list.h b/libdocument/ev-mapping-list.h
index e4cb5a80..bb9494fa 100644
--- a/libdocument/ev-mapping-list.h
+++ b/libdocument/ev-mapping-list.h
@@ -42,6 +42,8 @@ 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);
+EvMappingList *ev_mapping_list_remove (EvMappingList *mapping_list,
+ EvMapping *mapping);
EvMapping *ev_mapping_list_find (EvMappingList *mapping_list,
gconstpointer data);
EvMapping *ev_mapping_list_find_custom (EvMappingList *mapping_list,