diff options
author | Elliot Lee <sopwith@redhat.com> | 2000-08-09 02:37:44 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 2000-08-09 02:37:44 +0000 |
commit | 6d8b209bb67d3abd57de313548716710e7bfca87 (patch) | |
tree | a7332918d861405dce947e3c7e4c495564541de0 | |
parent | 0d0b47ba872c90fbad6312c77c12b7380f27ab6c (diff) | |
download | pango-6d8b209bb67d3abd57de313548716710e7bfca87.tar.gz |
Fix incorrect list rearrangement that caused some segfaults. Pay attention
2000-08-08 Elliot Lee <sopwith@redhat.com>
* pango/modules.c: Fix incorrect list rearrangement that caused some segfaults.
* pango/pango-layout.c (pango_layout_line_x_to_index): Pay attention to shape attributes
(not perfect since the layout of chars inside a shaped run is unknown, but gives start
index of the chars in the run).
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-0 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-2 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-4 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 6 | ||||
-rw-r--r-- | pango/modules.c | 9 | ||||
-rw-r--r-- | pango/pango-layout.c | 32 |
9 files changed, 68 insertions, 15 deletions
@@ -1,3 +1,9 @@ +2000-08-08 Elliot Lee <sopwith@redhat.com> + * pango/modules.c: Fix incorrect list rearrangement. + * pango/pango-layout.c (pango_layout_line_x_to_index): Pay attention to shape attributes + (not perfect since the layout of chars inside a shape is unknown, but gives start + index). + 2000-08-07 Elliot Lee <sopwith@redhat.com> * pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0 index 2d6092b9..61071e29 100644 --- a/ChangeLog.pre-1-0 +++ b/ChangeLog.pre-1-0 @@ -1,3 +1,9 @@ +2000-08-08 Elliot Lee <sopwith@redhat.com> + * pango/modules.c: Fix incorrect list rearrangement. + * pango/pango-layout.c (pango_layout_line_x_to_index): Pay attention to shape attributes + (not perfect since the layout of chars inside a shape is unknown, but gives start + index). + 2000-08-07 Elliot Lee <sopwith@redhat.com> * pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 2d6092b9..61071e29 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,9 @@ +2000-08-08 Elliot Lee <sopwith@redhat.com> + * pango/modules.c: Fix incorrect list rearrangement. + * pango/pango-layout.c (pango_layout_line_x_to_index): Pay attention to shape attributes + (not perfect since the layout of chars inside a shape is unknown, but gives start + index). + 2000-08-07 Elliot Lee <sopwith@redhat.com> * pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 2d6092b9..61071e29 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,9 @@ +2000-08-08 Elliot Lee <sopwith@redhat.com> + * pango/modules.c: Fix incorrect list rearrangement. + * pango/pango-layout.c (pango_layout_line_x_to_index): Pay attention to shape attributes + (not perfect since the layout of chars inside a shape is unknown, but gives start + index). + 2000-08-07 Elliot Lee <sopwith@redhat.com> * pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 2d6092b9..61071e29 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,9 @@ +2000-08-08 Elliot Lee <sopwith@redhat.com> + * pango/modules.c: Fix incorrect list rearrangement. + * pango/pango-layout.c (pango_layout_line_x_to_index): Pay attention to shape attributes + (not perfect since the layout of chars inside a shape is unknown, but gives start + index). + 2000-08-07 Elliot Lee <sopwith@redhat.com> * pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 2d6092b9..61071e29 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,9 @@ +2000-08-08 Elliot Lee <sopwith@redhat.com> + * pango/modules.c: Fix incorrect list rearrangement. + * pango/pango-layout.c (pango_layout_line_x_to_index): Pay attention to shape attributes + (not perfect since the layout of chars inside a shape is unknown, but gives start + index). + 2000-08-07 Elliot Lee <sopwith@redhat.com> * pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 2d6092b9..61071e29 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,9 @@ +2000-08-08 Elliot Lee <sopwith@redhat.com> + * pango/modules.c: Fix incorrect list rearrangement. + * pango/pango-layout.c (pango_layout_line_x_to_index): Pay attention to shape attributes + (not perfect since the layout of chars inside a shape is unknown, but gives start + index). + 2000-08-07 Elliot Lee <sopwith@redhat.com> * pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. diff --git a/pango/modules.c b/pango/modules.c index 5d3f9cb9..c1ab44a5 100644 --- a/pango/modules.c +++ b/pango/modules.c @@ -115,12 +115,9 @@ pango_find_map (const char *lang, * for speed next time around if we had to do * any failing strcmps. */ - if (tmp_list->next) - tmp_list->next->prev = tmp_list->prev; - tmp_list->prev->next = tmp_list->next; - tmp_list->next = maps; - tmp_list->prev = NULL; - maps = tmp_list; + maps = g_list_remove_link(maps, tmp_list); + maps = g_list_prepend(maps, tmp_list->data); + g_list_free_1(tmp_list); } return map_info->map; diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 7025083f..3aee5bfd 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -2234,21 +2234,35 @@ pango_layout_line_x_to_index (PangoLayoutLine *line, { PangoRectangle logical_rect; PangoLayoutRun *run = tmp_list->data; - - pango_glyph_string_extents (run->glyphs, run->item->analysis.font, NULL, &logical_rect); + gboolean shape_set; + + pango_layout_get_item_properties (run->item, NULL, NULL, &logical_rect, &shape_set); + + if (!shape_set) + pango_glyph_string_extents (run->glyphs, run->item->analysis.font, NULL, &logical_rect); if (x_pos >= start_pos && x_pos < start_pos + logical_rect.width) { int pos; - - pango_glyph_string_x_to_index (run->glyphs, - line->layout->text + run->item->offset, run->item->length, - &run->item->analysis, - x_pos - start_pos, - &pos, trailing); if (index) - *index = pos + run->item->offset; + *index = run->item->offset; + + if (shape_set) + { + *trailing = FALSE; + } + else + { + pango_glyph_string_x_to_index (run->glyphs, + line->layout->text + run->item->offset, run->item->length, + &run->item->analysis, + x_pos - start_pos, + &pos, trailing); + + if (index) + *index += pos; + } return; } |