[Libreoffice-commits] core.git: svx/source vcl/unx
Caolán McNamara
caolanm at redhat.com
Tue Jun 26 08:00:18 UTC 2018
svx/source/dialog/langbox.cxx | 6 ++++++
vcl/unx/gtk3/gtk3gtkinst.cxx | 18 ++++++++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
New commits:
commit 96c43a21da48e9ef50f199b9418e089da42a8ebb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 25 17:20:37 2018 +0100
Resolves: tdf#118356 freeze/thaw mass language additions
Change-Id: Ifdc2247594d3ddeea0ca7b3b97eb6e392c54f95b
Reviewed-on: https://gerrit.libreoffice.org/56409
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 9ccee3b41728..94b2aeccd0fa 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -654,6 +654,8 @@ void LanguageBox::SetLanguageList( SvxLanguageListFlags nLangList,
{
nCount = SvtLanguageTable::GetLanguageEntryCount();
}
+
+ m_xControl->freeze();
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
LanguageType nLangType;
@@ -691,6 +693,8 @@ void LanguageBox::SetLanguageList( SvxLanguageListFlags nLangList,
if (bHasLangNone)
InsertLanguage( LANGUAGE_NONE );
+
+ m_xControl->thaw();
}
int LanguageBox::ImplTypeToPos(LanguageType eType) const
@@ -758,6 +762,7 @@ LanguageBox::LanguageBox(weld::ComboBoxText* pControl)
m_xControl->make_sorted();
m_xControl->connect_changed(LINK(this, LanguageBox, ChangeHdl));
+ m_xControl->freeze();
sal_uInt32 nCount = SvtLanguageTable::GetLanguageEntryCount();
for (sal_uInt32 i = 0; i < nCount; ++i)
{
@@ -774,6 +779,7 @@ LanguageBox::LanguageBox(weld::ComboBoxText* pControl)
InsertLanguage(nLangType);
}
+ m_xControl->thaw();
}
SvxLanguageBox::SvxLanguageBox( vcl::Window* pParent, WinBits nBits )
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 8a7fef26c304..15e0f6612b7a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3708,6 +3708,7 @@ public:
{
disable_notify_events();
g_object_ref(m_pListStore);
+ gtk_widget_freeze_child_notify(GTK_WIDGET(m_pTreeView));
gtk_tree_view_set_model(m_pTreeView, nullptr);
enable_notify_events();
}
@@ -3716,6 +3717,7 @@ public:
{
disable_notify_events();
gtk_tree_view_set_model(m_pTreeView, GTK_TREE_MODEL(m_pListStore));
+ gtk_widget_thaw_child_notify(GTK_WIDGET(m_pTreeView));
g_object_unref(m_pListStore);
enable_notify_events();
}
@@ -4723,12 +4725,24 @@ public:
virtual void freeze() override
{
- //do nothing for now
+ gtk_widget_freeze_child_notify(GTK_WIDGET(m_pComboBoxText));
+ if (m_xSorter)
+ {
+ GtkTreeModel* pModel = gtk_combo_box_get_model(GTK_COMBO_BOX(m_pComboBoxText));
+ GtkTreeSortable* pSortable = GTK_TREE_SORTABLE(pModel);
+ gtk_tree_sortable_set_sort_column_id(pSortable, GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, GTK_SORT_ASCENDING);
+ }
}
virtual void thaw() override
{
- //do nothing for now
+ if (m_xSorter)
+ {
+ GtkTreeModel* pModel = gtk_combo_box_get_model(GTK_COMBO_BOX(m_pComboBoxText));
+ GtkTreeSortable* pSortable = GTK_TREE_SORTABLE(pModel);
+ gtk_tree_sortable_set_sort_column_id(pSortable, 0, GTK_SORT_ASCENDING);
+ }
+ gtk_widget_thaw_child_notify(GTK_WIDGET(m_pComboBoxText));
}
virtual ~GtkInstanceComboBoxText() override
More information about the Libreoffice-commits
mailing list