X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=libview%2Fev-pixbuf-cache.c;h=ee68354575168a54437cece64cab3de726573f20;hb=5fcba8b181f9a741832a292d0dd8874479ae764b;hp=4eb5c0e0e06b9dddc66a776136250e56389223fc;hpb=9c77b69d6ece7df775fd326f0afcc5a752b7a3bf;p=evince.git diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c index 4eb5c0e0..ee683545 100644 --- a/libview/ev-pixbuf-cache.c +++ b/libview/ev-pixbuf-cache.c @@ -1,10 +1,6 @@ #include #include "ev-pixbuf-cache.h" #include "ev-job-scheduler.h" -#include "ev-mapping.h" -#include "ev-document-forms.h" -#include "ev-document-images.h" -#include "ev-document-annotations.h" #include "ev-view-private.h" typedef struct _CacheJobInfo @@ -781,11 +777,11 @@ ev_pixbuf_cache_set_inverted_colors (EvPixbufCache *pixbuf_cache, CacheJobInfo *job_info; job_info = pixbuf_cache->prev_job + i; - if (job_info->surface) + if (job_info && job_info->surface) ev_document_misc_invert_surface (job_info->surface); job_info = pixbuf_cache->next_job + i; - if (job_info->surface) + if (job_info && job_info->surface) ev_document_misc_invert_surface (job_info->surface); } @@ -793,7 +789,7 @@ ev_pixbuf_cache_set_inverted_colors (EvPixbufCache *pixbuf_cache, CacheJobInfo *job_info; job_info = pixbuf_cache->job_list + i; - if (job_info->surface) + if (job_info && job_info->surface) ev_document_misc_invert_surface (job_info->surface); } } @@ -1039,6 +1035,9 @@ ev_pixbuf_cache_set_selection_list (EvPixbufCache *pixbuf_cache, if (!EV_IS_SELECTION (pixbuf_cache->document)) return; + if (pixbuf_cache->start_page == -1 || pixbuf_cache->end_page == -1) + return; + /* We check each area to see what needs updating, and what needs freeing; */ page = pixbuf_cache->start_page - pixbuf_cache->preload_cache_size; for (i = 0; i < pixbuf_cache->preload_cache_size; i++) { @@ -1118,6 +1117,9 @@ ev_pixbuf_cache_get_selection_list (EvPixbufCache *pixbuf_cache) g_return_val_if_fail (EV_IS_PIXBUF_CACHE (pixbuf_cache), NULL); + if (pixbuf_cache->start_page == -1 || pixbuf_cache->end_page == -1) + return NULL; + /* We check each area to see what needs updating, and what needs freeing; */ page = pixbuf_cache->start_page - pixbuf_cache->preload_cache_size; for (i = 0; i < pixbuf_cache->preload_cache_size; i++) {