diff options
author | Rafael Lima <rafael.palma.lima@gmail.com> | 2024-07-19 23:03:12 +0200 |
---|---|---|
committer | Rafael Lima <rafael.palma.lima@gmail.com> | 2024-07-23 01:55:43 +0200 |
commit | a7de9cc5e89cd0d0c2f6363b2c0cc265c528b121 (patch) | |
tree | 29d158d2cd858ebbb968fb18d27962f1749f0bad /svx/source/tbxctrls | |
parent | 7c5cf7578eebd37918f4ea649f6b27f72883aa49 (diff) |
tdf#162104 Make sure the standard palette gets selected in a clear profile
Commit [1] introduced localization of color palette names. However, the name defined in Common.xcs is not localized, so we need to make sure that the standard palette gets selected on a clear profile.
[1] 5e45351c52584fb116d2cc54da969734e5effab9
Change-Id: I2f03b3ab4bdbb77327388a754e1fc6f9d7413ba7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170732
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 718759e4168f..95631463bd21 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2119,7 +2119,15 @@ ColorWindow::ColorWindow(OUString rCommand, for (const auto& rPalette : aPaletteList) mxPaletteListBox->append_text(rPalette); mxPaletteListBox->thaw(); - OUString aPaletteName( officecfg::Office::Common::UserColors::PaletteName::get() ); + + // tdf#162104 If the current palette does not exist, select the equivalent to the localized "Standard" palette + // This is required because the names are now localized and in Common.xcs the "Standard" (in English) + // palette is selected by default + OUString aPaletteName(officecfg::Office::Common::UserColors::PaletteName::get()); + auto it = std::find(aPaletteList.begin(), aPaletteList.end(), aPaletteName); + if (it == aPaletteList.end()) + aPaletteName = SvxResId(RID_SVXSTR_COLOR_PALETTE_STANDARD); + mxPaletteListBox->set_active_text(aPaletteName); const int nSelectedEntry(mxPaletteListBox->get_active()); if (nSelectedEntry != -1) |