diff options
author | Kevin Suo <suokunlong@126.com> | 2021-11-03 14:16:52 +0800 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2021-11-08 21:40:35 +0100 |
commit | 4024673d69475191ba221fd0db2e595bf796d4fd (patch) | |
tree | f4cf5ebb9b28842e6c9cadd01275c5f97cea1a7d /sc | |
parent | 5e9c2677e8fcd19b289d947b94ceba52b138728b (diff) |
tdf#139205: Keep hierarchical structure of localized default styles in Calc
The default cell styles (when creating a new Calc document), as returned by orcus
parsing, are built-in English names, as defined in sc/res/xml/styles.xml. These
names can be localized. On non-English UI, all these (localized) styles names
will be forced to use the localized "Default" as their parent because there is
no such non-localized parents in the localized style tree on UI.
In this patch, I added SC_DLLPUBLIC to ScStyleNameConversion::ProgrammaticToDisplayName,
then used this function to convert the parent style name to the (localized) UI name.
Change-Id: I3689211a10c60a5e7b2b273b6c15a4da92f0d633
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124556
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/stylehelper.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sc/inc/stylehelper.hxx b/sc/inc/stylehelper.hxx index 63189ccd6c77..e11fcef97c8e 100644 --- a/sc/inc/stylehelper.hxx +++ b/sc/inc/stylehelper.hxx @@ -20,6 +20,7 @@ #pragma once #include <rtl/ustring.hxx> +#include "scdllapi.h" // conversion programmatic <-> display (visible) name // currently, the core always has the visible names @@ -46,7 +47,8 @@ class ScStyleNameConversion { public: static OUString DisplayToProgrammaticName(const OUString& rDispName, SfxStyleFamily nType); - static OUString ProgrammaticToDisplayName(const OUString& rProgName, SfxStyleFamily nType); + static SC_DLLPUBLIC OUString ProgrammaticToDisplayName(const OUString& rProgName, + SfxStyleFamily nType); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 63926a72fc59..1bcc914a0ada 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -49,6 +49,7 @@ #include <stylesbuffer.hxx> #include <orcus/exception.hpp> +#include <stylehelper.hxx> using namespace com::sun::star; @@ -2176,7 +2177,9 @@ size_t ScOrcusStyles::commit_cell_style() ScStyleSheetPool* pPool = mrFactory.getDoc().getDoc().GetStyleSheetPool(); SfxStyleSheetBase& rBase = pPool->Make(maCurrentCellStyle.maName, SfxStyleFamily::Para); - rBase.SetParent(maCurrentCellStyle.maParentName); + // Need to convert the parent name to localized UI name, see tdf#139205. + rBase.SetParent(ScStyleNameConversion::ProgrammaticToDisplayName(maCurrentCellStyle.maParentName, + SfxStyleFamily::Para)); SfxItemSet& rSet = rBase.GetItemSet(); xf& rXf = maCellStyleXfs[maCurrentCellStyle.mnXFId]; |