Changeset 277 for trunk/src/DocumentPage.cxx
- Timestamp:
- 06/11/07 09:12:09 (18 months ago)
- Files:
-
- 1 modified
-
trunk/src/DocumentPage.cxx (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DocumentPage.cxx
r206 r277 18 18 #include <config.h> 19 19 #include <string.h> 20 #include <gdk/gdk.h> 20 21 #include "epdfview.h" 21 22 … … 29 30 DocumentPage::DocumentPage () 30 31 { 32 m_Selection = NULL; 31 33 m_Data = NULL; 32 34 m_HasSelection = FALSE; … … 50 52 } 51 53 g_list_free (m_LinkList); 54 55 if(m_Selection) 56 gdk_region_destroy(m_Selection); 52 57 } 53 58 … … 79 84 invertArea (m_SelectionX1, m_SelectionY1, m_SelectionX2, m_SelectionY2); 80 85 m_HasSelection = FALSE; 86 } 87 88 if(NULL != m_Selection){ 89 invertRegion(m_Selection); 90 gdk_region_destroy(m_Selection); 91 m_Selection = NULL; 81 92 } 82 93 } … … 196 207 } 197 208 209 void 210 DocumentPage::invertRegion (GdkRegion* region) 211 { 212 int count; 213 GdkRectangle *rectangles; 214 gdk_region_get_rectangles(region, &rectangles, &count); 215 while(count--){ 216 GdkRectangle r = rectangles[count]; 217 invertArea(r.x, r.y, r.x + r.width, r.y + r.height); 218 } 219 g_free(rectangles); 220 } 221 222 198 223 /// 199 224 /// @brief Allocates the memory for a new page. … … 254 279 m_HasSelection = TRUE; 255 280 } 281 282 void 283 DocumentPage::setSelection (GdkRegion *region) 284 { 285 clearSelection (); 286 287 invertRegion (region); 288 289 m_Selection = gdk_region_copy(region); 290 }
