From 50cedfaadd7cc87d8c74fdff330c45f637c89e0b Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Sat, 27 Jan 2001 03:39:24 +0000 Subject: Try a control before an embeddable instead of an embeddable before a control when embedding something in the mail display. svn path=/trunk/; revision=7845 --- mail/ChangeLog | 5 +++++ mail/mail-display.c | 35 ++++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 15 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index ff11955455..f8e6a86b14 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2001-01-26 Ettore Perazzoli + + * mail-display.c (get_embedded_for_component): Try a control + first, instead of an embeddable. + 2001-01-26 Jeffrey Stedfast * subscribe-dialog.c (populate_store_foreach): Check for a NULL diff --git a/mail/mail-display.c b/mail/mail-display.c index 28587fe1a3..7d2cff4a8b 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -557,24 +557,29 @@ get_embedded_for_component (const char *iid, MailDisplay *md) BonoboControlFrame *control_frame; Bonobo_PropertyBag prop_bag; - embedded = bonobo_widget_new_subdoc (iid, NULL); - if (embedded) { - /* FIXME: as of bonobo 0.18, there's an extra - * client_site dereference in the BonoboWidget - * destruction path that we have to balance out to - * prevent problems. - */ - bonobo_object_ref (BONOBO_OBJECT(bonobo_widget_get_client_site ( - BONOBO_WIDGET (embedded)))); - - return embedded; - } - /* - * Try a control now + * First try a control. */ embedded = bonobo_widget_new_control (iid, NULL); - if (!embedded) + if (embedded == NULL) { + /* + * No control, try an embeddable instead. + */ + embedded = bonobo_widget_new_subdoc (iid, NULL); + if (embedded != NULL) { + /* FIXME: as of bonobo 0.18, there's an extra + * client_site dereference in the BonoboWidget + * destruction path that we have to balance out to + * prevent problems. + */ + bonobo_object_ref (BONOBO_OBJECT(bonobo_widget_get_client_site ( + BONOBO_WIDGET (embedded)))); + + return embedded; + } + } + + if (embedded == NULL) return NULL; control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (embedded)); -- cgit v1.2.3