[Libreoffice-commits] core.git: cui/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Nov 27 20:47:50 UTC 2019
cui/source/options/optgdlg.cxx | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
New commits:
commit 9a2bd7d71b004accae50c44b573a108140ab0678
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 27 16:06:27 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Nov 27 21:45:21 2019 +0100
Resolves: tdf#128979 crash/freeze on selecting last theme in list
Change-Id: Ie47feb34cfbd6af0788a679ca2b5985ad6f9cbbf
Reviewed-on: https://gerrit.libreoffice.org/83927
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 549513e7a69c..cb6b53a08176 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -795,13 +795,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);
@@ -918,15 +918,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;
}
More information about the Libreoffice-commits
mailing list