diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-18 17:23:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-18 22:11:28 +0200 |
commit | fc59a701cceb6e83c00fc3c9fab747987376c00f (patch) | |
tree | 8fbb56024d3a2430d9124e949a2ed2875b9f7c98 | |
parent | f7ceb1f805b45cbd4b322da2ca4039d56dd430b3 (diff) |
don't bother undoing the replacement of combobox if unparented
as seen in tdf#133098 example
Change-Id: I58bf5c5c931cbd1f002ff28f6844d0bebcdd1913
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94440
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 503da469aef5..530a115bd96b 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -1714,11 +1714,15 @@ namespace void replaceWidget(GtkWidget* pWidget, GtkWidget* pReplacement) { - g_object_ref(pWidget); - // remove the widget and replace it with pReplacement GtkWidget* pParent = gtk_widget_get_parent(pWidget); + // if pWidget was un-parented then don't bother + if (!pParent) + return; + + g_object_ref(pWidget); + gint nTopAttach(0), nLeftAttach(0), nHeight(1), nWidth(1); if (GTK_IS_GRID(pParent)) { |