diff options
author | Carlos Garcia Campos <[email protected]> | 2013-06-21 20:55:05 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-09-06 18:25:34 +0200 |
commit | ddffd24448f50daf94b1cc86152fbe77eecec044 (patch) | |
tree | b0fb6b2bff097e0a75470d9f425718199094a6c7 | |
parent | ac8e6d76c49514be24ff6aa3e2db76b862483371 (diff) | |
download | atril-ddffd24448f50daf94b1cc86152fbe77eecec044.tar.bz2 atril-ddffd24448f50daf94b1cc86152fbe77eecec044.tar.xz |
libview: Use prepend + reverse instead of append to create selections list
origin commit:
https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=c30e9b1
-rw-r--r-- | libview/ev-pixbuf-cache.c | 8 | ||||
-rw-r--r-- | libview/ev-view.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c index 89225d08..875bdb71 100644 --- a/libview/ev-pixbuf-cache.c +++ b/libview/ev-pixbuf-cache.c @@ -1236,7 +1236,7 @@ ev_pixbuf_cache_get_selection_list (EvPixbufCache *pixbuf_cache) selection->rect = pixbuf_cache->prev_job[i].selection_points; if (pixbuf_cache->prev_job[i].selection_region) selection->covered_region = cairo_region_reference (pixbuf_cache->prev_job[i].selection_region); - retval = g_list_append (retval, selection); + retval = g_list_prepend (retval, selection); } page ++; @@ -1250,7 +1250,7 @@ ev_pixbuf_cache_get_selection_list (EvPixbufCache *pixbuf_cache) selection->rect = pixbuf_cache->job_list[i].selection_points; if (pixbuf_cache->job_list[i].selection_region) selection->covered_region = cairo_region_reference (pixbuf_cache->job_list[i].selection_region); - retval = g_list_append (retval, selection); + retval = g_list_prepend (retval, selection); } page ++; @@ -1266,13 +1266,13 @@ ev_pixbuf_cache_get_selection_list (EvPixbufCache *pixbuf_cache) selection->rect = pixbuf_cache->next_job[i].selection_points; if (pixbuf_cache->next_job[i].selection_region) selection->covered_region = cairo_region_reference (pixbuf_cache->next_job[i].selection_region); - retval = g_list_append (retval, selection); + retval = g_list_prepend (retval, selection); } page ++; } - return retval; + return g_list_reverse (retval); } void diff --git a/libview/ev-view.c b/libview/ev-view.c index 0c452237..0c3bb9f9 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -7471,10 +7471,10 @@ compute_new_selection_text (EvView *view, selection->rect.y2 = MAX (selection->rect.y2 - border.bottom, 0); } - list = g_list_append (list, selection); + list = g_list_prepend (list, selection); } - return list; + return g_list_reverse (list); } /* This function takes the newly calculated list, and figures out which regions @@ -7674,10 +7674,10 @@ ev_view_select_all (EvView *view) selection->rect.x2 = width; selection->rect.y2 = height; - selections = g_list_append (selections, selection); + selections = g_list_prepend (selections, selection); } - merge_selection_region (view, selections); + merge_selection_region (view, g_list_reverse (selections)); gtk_widget_queue_draw (GTK_WIDGET (view)); } |