summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-01-16 20:44:05 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-01-16 20:44:05 +0000
commite1181d9a4c6f49586dfb96a837cde2846cbbb06e (patch)
tree367017a182ec4ff080222623dc34d70ede98d400
parent5d65122f8a714e04b05c52947cedaab090345d37 (diff)
downloadpango-e1181d9a4c6f49586dfb96a837cde2846cbbb06e.tar.gz
Bug 397337 – Use is_ellipsized and is_wrapped to optimize property
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
-rw-r--r--ChangeLog9
-rw-r--r--pango/pango-layout.c7
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e7313de1..0650b2d5 100644
--- 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>
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 5988e839..18b67e1e 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -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);
}
}