From dd5a050770d1e0d53c3280356af5ff6ddf383567 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 3 Feb 2004 15:24:40 +0000 Subject: it's possible to get to this function without the EText ever being 2004-02-03 Chris Toshok * gal/e-text/e-text.c (e_text_command): it's possible to get to this function without the EText ever being realized. Since we create the layout in realize(), let's just create it here too. Fixes crash bug 46165 (aka "The Bug with a million dups"). svn path=/trunk/; revision=24579 --- widgets/text/e-text.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'widgets/text/e-text.c') diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 45d43ac523..93fd9d0120 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -3255,6 +3255,13 @@ e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gp break; } + /* it's possible to get here without ever having been realized + by our canvas (if the e-text started completely obscured.) + so let's create our layout object if we don't already have + one. */ + if (!text->layout) + create_layout (text); + if (scroll && !text->button_down) { /* XXX do we really need the @trailing logic here? if we don't we can scrap the loop and just use -- cgit v1.2.3