officecfg/registry/schema/org/openoffice/Office/Common.xcs | 2 +- svx/source/tbxctrls/tbcontrl.cxx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-)
New commits: commit a7de9cc5e89cd0d0c2f6363b2c0cc265c528b121 Author: Rafael Lima <[email protected]> AuthorDate: Fri Jul 19 23:03:12 2024 +0200 Commit: Rafael Lima <[email protected]> CommitDate: Tue Jul 23 01:55:43 2024 +0200 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 <[email protected]> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index a6c5c6e631fe..01482b557274 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -3253,7 +3253,7 @@ <info> <desc>Name of selected palette</desc> </info> - <value>standard</value> + <value>Standard</value> </prop> <prop oor:name="CustomColor" oor:type="oor:int-list" oor:nillable="false"> <info> 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)
