summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-27 16:06:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-27 21:51:13 +0100
commita83759f4909190974ed07291c6a3a9ef837e834d (patch)
treea79ee6278584d0afa76d6047c6493a5e6c365895 /cui
parent1134b97b3daed1b79c9ee721cdfb415359c4461c (diff)
Resolves: tdf#128979 crash/freeze on selecting last theme in list
Change-Id: Ie47feb34cfbd6af0788a679ca2b5985ad6f9cbbf Reviewed-on: https://gerrit.libreoffice.org/83928 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optgdlg.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 3079b2c92c2c..809e8f8ba68a 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -664,13 +664,13 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p
OUString entryForAuto = sAutoStr + " (" +
autoIconTheme.GetDisplayName() +
")";
- m_xIconStyleLB->append_text(entryForAuto);
+ m_xIconStyleLB->append("auto", entryForAuto); // index 0 means choose style automatically
// separate auto and other icon themes
m_xIconStyleLB->append_separator("");
for (auto const& installIconTheme : mInstalledIconThemes)
- m_xIconStyleLB->append_text(installIconTheme.GetDisplayName());
+ m_xIconStyleLB->append(installIconTheme.GetThemeId(), installIconTheme.GetDisplayName());
m_xIconStyleLB->set_active(0);
@@ -773,15 +773,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
const sal_Int32 nStyleLB_NewSelection = m_xIconStyleLB->get_active();
if( nStyleLB_InitialSelection != nStyleLB_NewSelection )
{
- // 0 means choose style automatically
- if (nStyleLB_NewSelection == 0)
- aMiscOptions.SetIconTheme("auto");
- else
- {
- const sal_Int32 pos = m_xIconStyleLB->get_active();
- const vcl::IconThemeInfo& iconThemeId = mInstalledIconThemes.at(pos-1);
- aMiscOptions.SetIconTheme(iconThemeId.GetThemeId());
- }
+ aMiscOptions.SetIconTheme(m_xIconStyleLB->get_active_id());
nStyleLB_InitialSelection = nStyleLB_NewSelection;
}