summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-10 10:32:10 +0000
committerXisco Fauli <xiscofauli@libreoffice.org>2023-01-12 08:22:13 +0000
commit34789a2a7678435b142165647aba20b55c086fcb (patch)
tree298d014e1ac754b12ab849980f70be92ed0eaba9
parenttdf#146248 sw: fix crash at Undo of hiding page header/footer (diff)
downloadcore-34789a2a7678435b142165647aba20b55c086fcb.tar.gz
core-34789a2a7678435b142165647aba20b55c086fcb.zip
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>
-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)