summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-11 10:04:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-11 16:45:32 +0200
commit0c50447a94d092d1c19edb1bdebf9bf6dde3ae0f (patch)
tree791ff61098728aad8b12ac43d87fdbe0a736a731 /vcl
parenta24b27986dfedd4566cf4081090bac8bd2f63e2a (diff)
Resolves: tdf#132902 restore original hierarchy in dtor
so a repeated weld will result in the same layout each time Change-Id: I9ba41e70c29046b84392280d4bd95f8141b24251 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93953 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 7e05280bbc46..1620077aa79e 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -14304,6 +14304,23 @@ public:
g_signal_handler_disconnect(m_pTreeView, m_nRowActivatedSignalId);
g_signal_handler_disconnect(m_pToggleButton, m_nPopupShownSignalId);
+ gtk_combo_box_set_model(m_pComboBox, m_pTreeModel);
+ gtk_tree_view_set_model(m_pTreeView, nullptr);
+
+ // restore original hierarchy in dtor so a new GtkInstanceComboBox will
+ // result in the same layout each time
+ {
+ g_object_ref(m_pComboBox);
+
+ GtkContainer* pContainer = getContainer();
+
+ gtk_container_remove(pContainer, GTK_WIDGET(m_pComboBox));
+
+ replaceWidget(GTK_WIDGET(pContainer), GTK_WIDGET(m_pComboBox));
+
+ g_object_unref(m_pComboBox);
+ }
+
g_object_unref(m_pComboBuilder);
}
};