summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-02-05 22:44:12 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-02-05 22:44:12 +0000
commit19a87cc237b77b86dda507b72ca4be09666ea235 (patch)
tree3637ad13d9def58883f346b370ffd39052faf120
parent3517707a6c8b8e31c57ce45722a9ff6a937702f0 (diff)
downloadpango-19a87cc237b77b86dda507b72ca4be09666ea235.tar.gz
Fix problem with empty markup tags (#128102, Christian Persch)
Thu Feb 5 16:30:46 2004 Owen Taylor <otaylor@redhat.com> Fix problem with empty markup tags (#128102, Christian Persch) * pango/pango-context.c (itemize_state_process_run): Assert that the run is non-empty. * pango/pango-attributes.c (pango_attr_list_change): Just ignore empty attributes. * pango/pango-attributes.c (pango_attr_iterator_next): Skip empty attributes.
-rw-r--r--ChangeLog13
-rw-r--r--ChangeLog.pre-1-1013
-rw-r--r--ChangeLog.pre-1-413
-rw-r--r--ChangeLog.pre-1-613
-rw-r--r--ChangeLog.pre-1-813
-rw-r--r--pango/pango-attributes.c14
-rw-r--r--pango/pango-context.c3
7 files changed, 78 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1aa1b56f..004ddbe9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Thu Feb 5 16:30:46 2004 Owen Taylor <otaylor@redhat.com>
+
+ Fix problem with empty markup tags (#128102, Christian Persch)
+
+ * pango/pango-context.c (itemize_state_process_run): Assert
+ that the run is non-empty.
+
+ * pango/pango-attributes.c (pango_attr_list_change):
+ Just ignore empty attributes.
+
+ * pango/pango-attributes.c (pango_attr_iterator_next):
+ Skip empty attributes.
+
Thu Feb 5 15:28:44 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-layout.c (pango_layout_set_font_description):
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 1aa1b56f..004ddbe9 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,16 @@
+Thu Feb 5 16:30:46 2004 Owen Taylor <otaylor@redhat.com>
+
+ Fix problem with empty markup tags (#128102, Christian Persch)
+
+ * pango/pango-context.c (itemize_state_process_run): Assert
+ that the run is non-empty.
+
+ * pango/pango-attributes.c (pango_attr_list_change):
+ Just ignore empty attributes.
+
+ * pango/pango-attributes.c (pango_attr_iterator_next):
+ Skip empty attributes.
+
Thu Feb 5 15:28:44 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-layout.c (pango_layout_set_font_description):
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
index 1aa1b56f..004ddbe9 100644
--- a/ChangeLog.pre-1-4
+++ b/ChangeLog.pre-1-4
@@ -1,3 +1,16 @@
+Thu Feb 5 16:30:46 2004 Owen Taylor <otaylor@redhat.com>
+
+ Fix problem with empty markup tags (#128102, Christian Persch)
+
+ * pango/pango-context.c (itemize_state_process_run): Assert
+ that the run is non-empty.
+
+ * pango/pango-attributes.c (pango_attr_list_change):
+ Just ignore empty attributes.
+
+ * pango/pango-attributes.c (pango_attr_iterator_next):
+ Skip empty attributes.
+
Thu Feb 5 15:28:44 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-layout.c (pango_layout_set_font_description):
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index 1aa1b56f..004ddbe9 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,16 @@
+Thu Feb 5 16:30:46 2004 Owen Taylor <otaylor@redhat.com>
+
+ Fix problem with empty markup tags (#128102, Christian Persch)
+
+ * pango/pango-context.c (itemize_state_process_run): Assert
+ that the run is non-empty.
+
+ * pango/pango-attributes.c (pango_attr_list_change):
+ Just ignore empty attributes.
+
+ * pango/pango-attributes.c (pango_attr_iterator_next):
+ Skip empty attributes.
+
Thu Feb 5 15:28:44 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-layout.c (pango_layout_set_font_description):
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 1aa1b56f..004ddbe9 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,16 @@
+Thu Feb 5 16:30:46 2004 Owen Taylor <otaylor@redhat.com>
+
+ Fix problem with empty markup tags (#128102, Christian Persch)
+
+ * pango/pango-context.c (itemize_state_process_run): Assert
+ that the run is non-empty.
+
+ * pango/pango-attributes.c (pango_attr_list_change):
+ Just ignore empty attributes.
+
+ * pango/pango-attributes.c (pango_attr_iterator_next):
+ Skip empty attributes.
+
Thu Feb 5 15:28:44 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-layout.c (pango_layout_set_font_description):
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 6dd070d7..2fb187c9 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -941,8 +941,11 @@ pango_attr_list_change (PangoAttrList *list,
GSList *tmp_list, *prev, *link;
gint start_index = attr->start_index;
gint end_index = attr->end_index;
-
+
g_return_if_fail (list != NULL);
+
+ if (start_index == end_index) /* empty, nothing to do */
+ return;
tmp_list = list->attributes;
prev = NULL;
@@ -1274,9 +1277,12 @@ pango_attr_iterator_next (PangoAttrIterator *iterator)
while (iterator->next_attribute &&
((PangoAttribute *)iterator->next_attribute->data)->start_index == iterator->start_index)
{
- iterator->attribute_stack = g_list_prepend (iterator->attribute_stack, iterator->next_attribute->data);
- iterator->end_index = MIN (iterator->end_index, ((PangoAttribute *)iterator->next_attribute->data)->end_index);
- iterator->next_attribute = iterator->next_attribute->next;
+ if (((PangoAttribute *)iterator->next_attribute->data)->end_index > iterator->start_index)
+ {
+ iterator->attribute_stack = g_list_prepend (iterator->attribute_stack, iterator->next_attribute->data);
+ iterator->end_index = MIN (iterator->end_index, ((PangoAttribute *)iterator->next_attribute->data)->end_index);
+ iterator->next_attribute = iterator->next_attribute->next;
+ }
}
if (iterator->next_attribute)
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 3bd7fd28..fd55a20c 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -941,6 +941,9 @@ itemize_state_process_run (ItemizeState *state)
itemize_state_update_for_new_run (state);
+ /* We should never get an empty run */
+ g_assert (state->run_end != state->run_start);
+
for (p = state->run_start;
p < state->run_end;
p = g_utf8_next_char (p))