Resolves: tdf#126661 unexpected sort between freeze+thaw
Change-Id: Ibb6b404d32e38c72fb1ff4be73f3a5f116d55692
Reviewed-on: https://gerrit.libreoffice.org/76809
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index fde159c..ac93f0b 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -493,8 +493,8 @@ IMPL_LINK_NOARG(MacroChooser, BasicSelectHdl, weld::TreeView&, void)
m_xMacroBox->freeze();
for (auto const& macro : aMacros)
m_xMacroBox->append_text(macro.second->GetName());
m_xMacroBox->make_sorted();
m_xMacroBox->thaw();
m_xMacroBox->make_sorted();
if (m_xMacroBox->get_iter_first(*m_xMacroBoxIter))
m_xMacroBox->set_cursor(*m_xMacroBoxIter);
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 6db8e91..9228281 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3799,6 +3799,7 @@ public:
virtual void make_sorted() override
{
assert(m_xTreeView->IsUpdateMode() && "don't sort when frozen");
m_xTreeView->SetStyle(m_xTreeView->GetStyle() | WB_SORT);
m_xTreeView->GetModel()->SetCompareHdl(LINK(this, SalInstanceTreeView, CompareHdl));
set_sort_order(true);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index f06f818..57ba84a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7157,6 +7157,8 @@ public:
virtual void make_sorted() override
{
// thaw wants to restore sort state of freeze
assert(gtk_tree_view_get_model(m_pTreeView) && "don't select when frozen");
m_xSorter.reset(new comphelper::string::NaturalStringSorter(
::comphelper::getProcessComponentContext(),
Application::GetSettings().GetUILanguageTag().getLocale()));