diff options
author | Kevin Suo <suokunlong@126.com> | 2021-11-03 14:16:52 +0800 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-11-08 22:13:05 +0100 |
commit | c274eeaa46206a42b3356d18f7a0d6dc5fb92cda (patch) | |
tree | b1adcf8f70629ffd3b658be866cf495a75deca48 /sc/source | |
parent | b3dace9c22b08f4660ac7c2e1d28db69f044afe6 (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/source')
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 7bf9bd059def..a42b71f46ee6 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -47,6 +47,7 @@ #include <stylesbuffer.hxx> #include <orcus/exception.hpp> +#include <stylehelper.hxx> using namespace com::sun::star; @@ -2179,7 +2180,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]; |