summaryrefslogtreecommitdiff
path: root/libview/ev-page-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'libview/ev-page-cache.c')
-rw-r--r--libview/ev-page-cache.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/libview/ev-page-cache.c b/libview/ev-page-cache.c
index a3a2b6fd..b7c5e8aa 100644
--- a/libview/ev-page-cache.c
+++ b/libview/ev-page-cache.c
@@ -342,8 +342,9 @@ ev_page_cache_set_flags (EvPageCache *cache,
}
void
-ev_page_cache_mark_dirty (EvPageCache *cache,
- gint page)
+ev_page_cache_mark_dirty (EvPageCache *cache,
+ gint page,
+ EvJobPageDataFlags flags)
{
EvPageCacheData *data;
@@ -352,6 +353,27 @@ ev_page_cache_mark_dirty (EvPageCache *cache,
data = &cache->page_list[page];
data->dirty = TRUE;
+ if (flags & EV_PAGE_DATA_INCLUDE_LINKS)
+ g_clear_pointer (&data->link_mapping, ev_mapping_list_unref);
+
+ if (flags & EV_PAGE_DATA_INCLUDE_IMAGES)
+ g_clear_pointer (&data->image_mapping, ev_mapping_list_unref);
+
+ if (flags & EV_PAGE_DATA_INCLUDE_FORMS)
+ g_clear_pointer (&data->form_field_mapping, ev_mapping_list_unref);
+
+ if (flags & EV_PAGE_DATA_INCLUDE_ANNOTS)
+ g_clear_pointer (&data->annot_mapping, ev_mapping_list_unref);
+
+ if (flags & EV_PAGE_DATA_INCLUDE_TEXT_MAPPING)
+ g_clear_pointer (&data->text_mapping, cairo_region_destroy);
+
+ if (flags & EV_PAGE_DATA_INCLUDE_TEXT)
+ g_clear_pointer (&data->text, g_free);
+
+ if (flags & EV_PAGE_DATA_INCLUDE_TEXT_LAYOUT)
+ g_clear_pointer (&data->text_layout, g_free);
+
/* Update the current range */
ev_page_cache_set_page_range (cache, cache->start_page, cache->end_page);
}