diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-11-25 17:29:09 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-11-27 22:06:36 +0000 |
commit | 5db3eff8bea4b4d907251c46bc30d1114daba3bc (patch) | |
tree | cb9048ef95ebe7114292ae4d30ffb0dc43318099 /svx | |
parent | 065b4d6813ee308f819cce962da8944021b945c6 (diff) |
Handle cases where last-used palette disappeared
...so PaletteManager::SetPalette(LISTBOX_ENTRY_NOTFOUND) would set
PaletteManager::mnCurrentPalette to 65535, and
PaletteManager::GetSelectedPalettePath would do out-of-bounds access into
PaletteManage::m_Palettes.
That the last-used palette (as stored under in the configuration under
/org.openoffice.Office.Common/UserColors/PaletteName) may become more common
with pending changes like <https://gerrit.libreoffice.org/#/c/31199/>
"tdf#104047 Remove dispensable palettes".
Change-Id: I5641bae04f50fea8aa69027a75de08c22394c281
(cherry picked from commit 8b718e3774f1ffb69f9aad565216556c798e95f4)
Reviewed-on: https://gerrit.libreoffice.org/31209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index aa725a740cb7..36b57a84d31b 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1354,7 +1354,10 @@ SvxColorWindow::SvxColorWindow(const OUString& rCommand, } OUString aPaletteName( officecfg::Office::Common::UserColors::PaletteName::get() ); mpPaletteListBox->SelectEntry( aPaletteName ); - SelectPaletteHdl( *mpPaletteListBox ); + if (mpPaletteListBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) + { + SelectPaletteHdl( *mpPaletteListBox ); + } mpButtonAutoColor->SetClickHdl( LINK( this, SvxColorWindow, AutoColorClickHdl ) ); mpButtonNoneColor->SetClickHdl( LINK( this, SvxColorWindow, AutoColorClickHdl ) ); |