sc/source/core/data/patattr.cxx | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)
New commits: commit 2b0626161d3ef7c4a51007018d13ec391d3a2b04 Author: Eike Rathke <er...@redhat.com> AuthorDate: Sat Oct 26 23:00:20 2019 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Sun Oct 27 00:00:16 2019 +0200 Resolves: tdf#117715 Conditional format takes precedence; reverts tdf#93300 Change-Id: I635ca58961ae5ae315bdd77c4fff9f3f41bebd15 Reviewed-on: https://gerrit.libreoffice.org/81550 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins 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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits