diff options
author | Daniel Glöckner <[email protected]> | 2011-08-29 16:41:29 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2015-08-31 15:01:32 +0200 |
commit | bacfeddeb91279f9c87d9c1b95b2ad6ea37de59d (patch) | |
tree | b084649f14847f5c9a79af74739bfa3bc8cdd71d /backend/pdf | |
parent | f5d201e518d84019826c24255ff945ff78caa7d0 (diff) | |
download | atril-bacfeddeb91279f9c87d9c1b95b2ad6ea37de59d.tar.bz2 atril-bacfeddeb91279f9c87d9c1b95b2ad6ea37de59d.tar.xz |
pdf: Fix saving annotations added to different pages
Fixes bug #628378.
Diffstat (limited to 'backend/pdf')
-rw-r--r-- | backend/pdf/ev-poppler.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 0edc83c6..c3d64ab6 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -2891,16 +2891,21 @@ pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotat if (pdf_document->annots) { mapping_list = (EvMappingList *)g_hash_table_lookup (pdf_document->annots, GINT_TO_POINTER (page->index)); + } else { + pdf_document->annots = g_hash_table_new_full (g_direct_hash, + g_direct_equal, + (GDestroyNotify)NULL, + (GDestroyNotify)ev_mapping_list_unref); + mapping_list = NULL; + } + + if (mapping_list) { list = ev_mapping_list_get_list (mapping_list); name = g_strdup_printf ("annot-%d-%d", page->index, g_list_length (list) + 1); ev_annotation_set_name (annot, name); g_free (name); list = g_list_append (list, annot_mapping); } else { - pdf_document->annots = g_hash_table_new_full (g_direct_hash, - g_direct_equal, - (GDestroyNotify)NULL, - (GDestroyNotify)ev_mapping_list_unref); name = g_strdup_printf ("annot-%d-0", page->index); ev_annotation_set_name (annot, name); g_free (name); |