summaryrefslogtreecommitdiff
path: root/gtk/gtktextlayout.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-08-30 19:09:09 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-08-30 19:09:09 +0000
commit5137409a90489e025372aadae92334d8f6267a6f (patch)
tree4737707665489c9255c6744db043d6f0dfaf31ab /gtk/gtktextlayout.c
parent181cacbfea03dc41f3c45b6e0ef60a261d52b9ad (diff)
downloadgdk-pixbuf-5137409a90489e025372aadae92334d8f6267a6f.tar.gz
handle NULL shaped object from the empty-child-anchor case by drawing a
2001-08-30 Havoc Pennington <hp@redhat.com> * gtk/gtktextdisplay.c (render_layout_line): handle NULL shaped object from the empty-child-anchor case by drawing a little box. * gtk/gtktextlayout.c (add_child_attrs): Still set shape attribute if the child anchor has no anchored widgets - fixes #59328. Also, remove bizarre deletion of preedit string that seems to have gotten in here somehow.
Diffstat (limited to 'gtk/gtktextlayout.c')
-rw-r--r--gtk/gtktextlayout.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index 26bd73e25..c1aba56b1 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -1411,23 +1411,19 @@ add_child_attrs (GtkTextLayout *layout,
if (tmp_list == NULL)
{
- /* No widget at this anchor in this display;
- * not an error.
+ /* If tmp_list == NULL then there is no widget at this anchor in
+ * this display; not an error. We make up an arbitrary size
+ * to use, just so the programmer can see the blank spot.
+ * We also put a NULL in the shaped objects list, to keep
+ * the correspondence between the list and the shaped chars in
+ * the layout. A bad hack, yes.
*/
- return;
- }
-
- if (layout->preedit_string)
- {
- g_free (layout->preedit_string);
- layout->preedit_string = NULL;
- }
+ width = 30;
+ height = 20;
- if (layout->preedit_attrs)
- {
- pango_attr_list_unref (layout->preedit_attrs);
- layout->preedit_attrs = NULL;
+ display->shaped_objects =
+ g_slist_append (display->shaped_objects, NULL);
}
logical_rect.x = 0;
@@ -1540,7 +1536,10 @@ allocate_child_widgets (GtkTextLayout *text_layout,
GObject *shaped_object = shaped->data;
shaped = shaped->next;
- if (GTK_IS_WIDGET (shaped_object))
+ /* shaped_object is NULL for child anchors with no
+ * widgets stored at them
+ */
+ if (shaped_object && GTK_IS_WIDGET (shaped_object))
{
PangoRectangle extents;