diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-01-10 10:32:10 +0000 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-01-12 08:22:13 +0000 |
commit | 34789a2a7678435b142165647aba20b55c086fcb (patch) | |
tree | 298d014e1ac754b12ab849980f70be92ed0eaba9 /sc | |
parent | c617aafc370209b8807ba6e0eba2762595595a0f (diff) |
Resolves: tdf#152950 don't set_active while frozen
Change-Id: I7db73e37ed426aae2282a6bf1564e5d3843442cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145230
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 3455f11006cf..35a24e633058 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -813,6 +813,8 @@ void ScTabPageSortOptions::EdOutPosModHdl() void ScTabPageSortOptions::FillAlgor() { + tools::Long nCount = 0; + m_xLbAlgorithm->freeze(); m_xLbAlgorithm->clear(); @@ -830,18 +832,19 @@ void ScTabPageSortOptions::FillAlgor() lang::Locale aLocale( LanguageTag::convertToLocale( eLang )); const uno::Sequence<OUString> aAlgos = m_xColWrap->listCollatorAlgorithms( aLocale ); - tools::Long nCount = aAlgos.getLength(); + nCount = aAlgos.getLength(); for (const OUString& sAlg : aAlgos) { OUString sUser = m_xColRes->GetTranslation( sAlg ); m_xLbAlgorithm->append_text(sUser); } - m_xLbAlgorithm->set_active(0); // first entry is default - m_xFtAlgorithm->set_sensitive(nCount > 1); // enable only if there is a choice - m_xLbAlgorithm->set_sensitive(nCount > 1); // enable only if there is a choice } m_xLbAlgorithm->thaw(); + + m_xLbAlgorithm->set_active(nCount ? 0 : -1); // first entry is default + m_xFtAlgorithm->set_sensitive(nCount > 1); // enable only if there is a choice + m_xLbAlgorithm->set_sensitive(nCount > 1); // enable only if there is a choice } IMPL_LINK_NOARG(ScTabPageSortOptions, FillAlgorHdl, weld::ComboBox&, void) |