summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-10 10:32:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-01-10 19:57:09 +0000
commit13810281fe1297833a849bf5adea0be8ea77ca88 (patch)
tree114cfa99ea656a1b32d90b8ebbee3abd461a970d /sc/source
parent4a050ed9e8f5fc0a6df35adfcda5698af1e81d47 (diff)
Resolves: tdf#152950 don't set_active while frozen
Change-Id: I7db73e37ed426aae2282a6bf1564e5d3843442cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145261 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx11
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)