[evince] libview: Use prepend + reverse instead of append to create selections list



commit c30e9b193d0106058d8edce75d76cb849f918de0
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Fri Jun 21 20:55:05 2013 +0200

    libview: Use prepend + reverse instead of append to create selections list

 libview/ev-pixbuf-cache.c |    8 ++++----
 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 865cee6..82bd9b0 100644
--- a/libview/ev-pixbuf-cache.c
+++ b/libview/ev-pixbuf-cache.c
@@ -1200,7 +1200,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 ++;
@@ -1214,7 +1214,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 ++;
@@ -1230,13 +1230,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 5bdc38f..a27b6b4 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -7157,10 +7157,10 @@ compute_new_selection_text (EvView          *view,
                selection->rect.x2 -= border.right;
                selection->rect.y2 -= border.bottom;
 
-               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
@@ -7371,10 +7371,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));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]