diff options
author | Eike Rathke <erack@redhat.com> | 2019-10-26 23:00:20 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-10-27 00:00:16 +0200 |
commit | 2b0626161d3ef7c4a51007018d13ec391d3a2b04 (patch) | |
tree | c7db2342f6de8d38e966475f2f161f32894089e3 | |
parent | e5874d6a72629ae298c97172f3c06137ed3dcab0 (diff) |
Resolves: tdf#117715 Conditional format takes precedence; reverts tdf#93300
Change-Id: I635ca58961ae5ae315bdd77c4fff9f3f41bebd15
Reviewed-on: https://gerrit.libreoffice.org/81550
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
-rw-r--r-- | sc/source/core/data/patattr.cxx | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 9d18777d9c77..f7e4010d5518 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -1254,27 +1254,13 @@ sal_uInt32 ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter, if (!pCondSet) return GetNumberFormat(pFormatter); - /* In the case of a conditional format we need to overwrite a cell style - * but leave a hard cell formatting alone. So check first if the number - * format is set in the cell format, then the conditional format and - * finally in the style. - * - * The style is represented here if the name is empty. - */ + // Conditional format takes precedence over style and even hard format. const SfxPoolItem* pFormItem; sal_uInt32 nFormat; const SfxPoolItem* pLangItem; LanguageType eLang; - if (GetItemSet().GetItemState(ATTR_VALUE_FORMAT, false, &pFormItem) == SfxItemState::SET) - { - nFormat = static_cast<const SfxUInt32Item*>(pFormItem)->GetValue(); - if (GetItemSet().GetItemState(ATTR_LANGUAGE_FORMAT, false, &pLangItem) == SfxItemState::SET) - eLang = static_cast<const SvxLanguageItem*>(pLangItem)->GetLanguage(); - else - eLang = getLanguageType(GetItemSet()); - } - else if (pCondSet->GetItemState(ATTR_VALUE_FORMAT, true, &pFormItem) == SfxItemState::SET ) + if (pCondSet->GetItemState(ATTR_VALUE_FORMAT, true, &pFormItem) == SfxItemState::SET ) { nFormat = getNumberFormatKey(*pCondSet); if (pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT, true, &pLangItem) == SfxItemState::SET) |