]> www.fi.muni.cz Git - evince.git/commitdiff
Clamp top/bottom values of destinations to make sure they are not bigger
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 1 Feb 2009 10:12:10 +0000 (10:12 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 1 Feb 2009 10:12:10 +0000 (10:12 +0000)
2009-02-01  Carlos Garcia Campos  <carlosgc@gnome.org>

* backend/pdf/ev-poppler.cc: (ev_link_dest_from_dest):

Clamp top/bottom values of destinations to make sure they are not
bigger than the page height. Fixes bug #569327.

svn path=/trunk/; revision=3396

ChangeLog
backend/pdf/ev-poppler.cc

index f14fa1b96d7324ff15fde03348f32af6f817b9b4..4215dc3758fb595e9076503f8b6d6525b2584408 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-01  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * backend/pdf/ev-poppler.cc: (ev_link_dest_from_dest):
+
+       Clamp top/bottom values of destinations to make sure they are not
+       bigger than the page height. Fixes bug #569327.
+       
 2009-02-01  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * libdocument/ev-debug.h:
index bdce0b528695bab193c071867190c4c24df51796..a0c0f8973911534a619704eecdd961eb29c66fab 100644 (file)
@@ -883,7 +883,7 @@ ev_link_dest_from_dest (PdfDocument *pdf_document,
                        poppler_page_get_size (poppler_page, NULL, &height);
                        ev_dest = ev_link_dest_new_xyz (dest->page_num - 1,
                                                        dest->left,
-                                                       height - dest->top,
+                                                       height - MIN (height, dest->top),
                                                        dest->zoom,
                                                        dest->change_left,
                                                        dest->change_top,
@@ -902,7 +902,7 @@ ev_link_dest_from_dest (PdfDocument *pdf_document,
                                                                  MAX (0, dest->page_num - 1));
                        poppler_page_get_size (poppler_page, NULL, &height);
                        ev_dest = ev_link_dest_new_fith (dest->page_num - 1,
-                                                        height - dest->top,
+                                                        height - MIN (height, dest->top),
                                                         dest->change_top);
                        g_object_unref (poppler_page);
                }
@@ -921,9 +921,9 @@ ev_link_dest_from_dest (PdfDocument *pdf_document,
                        poppler_page_get_size (poppler_page, NULL, &height);
                        ev_dest = ev_link_dest_new_fitr (dest->page_num - 1,
                                                         dest->left,
-                                                        height - dest->bottom,
+                                                        height - MIN (height, dest->bottom),
                                                         dest->right,
-                                                        height - dest->top);
+                                                        height - MIN (height, dest->top));
                        g_object_unref (poppler_page);
                }
                        break;