sc/source/ui/dbgui/tpsort.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 9476a2c29baf8dc7880fc1ae7657a3a69df8b429
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Jan 10 10:32:10 2023 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jan 11 10:09:39 2023 +0000

    Resolves: tdf#152950 don't set_active while frozen
    
    Change-Id: I7db73e37ed426aae2282a6bf1564e5d3843442cf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145231
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

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)

Reply via email to