Bug 397337 – Use is_ellipsized and is_wrapped to optimize property
authorBehdad Esfahbod <behdad@gnome.org>
Tue, 16 Jan 2007 20:44:05 +0000 (20:44 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Tue, 16 Jan 2007 20:44:05 +0000 (20:44 +0000)
2007-01-16  Behdad Esfahbod  <behdad@gnome.org>

        Bug 397337 – Use is_ellipsized and is_wrapped to optimize property
        changes

        * pango/pango-layout.c (pango_layout_set_wrap),
        (pango_layout_set_ellipsize): Using is_ellipsized and is_wrapped,
        only clear lines if wrap/ellipsize change has any effect on the lines.

svn path=/trunk/; revision=2168

ChangeLog
pango/pango-layout.c

index e7313de..0650b2d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2007-01-16  Behdad Esfahbod  <behdad@gnome.org>
 
+       Bug 397337 – Use is_ellipsized and is_wrapped to optimize property
+       changes
+
+       * pango/pango-layout.c (pango_layout_set_wrap),
+       (pango_layout_set_ellipsize): Using is_ellipsized and is_wrapped, 
+       only clear lines if wrap/ellipsize change has any effect on the lines.
+
+2007-01-16  Behdad Esfahbod  <behdad@gnome.org>
+
        *.c, *.h: Removed spaces followed b tabs.
 
 2007-01-16  Behdad Esfahbod  <behdad@gnome.org>
index 5988e83..18b67e1 100644 (file)
@@ -388,8 +388,10 @@ pango_layout_set_wrap (PangoLayout  *layout,
 
   if (layout->wrap != wrap)
     {
-      pango_layout_clear_lines (layout);
       layout->wrap = wrap;
+
+      if (layout->is_wrapped)
+       pango_layout_clear_lines (layout);
     }
 }
 
@@ -856,7 +858,8 @@ pango_layout_set_ellipsize (PangoLayout        *layout,
     {
       layout->ellipsize = ellipsize;
 
-      pango_layout_clear_lines (layout);
+      if (layout->is_ellipsized || layout->is_wrapped)
+       pango_layout_clear_lines (layout);
     }
 }