sc/source/filter/inc/condformatbuffer.hxx | 3 +-- sc/source/filter/oox/condformatbuffer.cxx | 2 +- sc/source/filter/oox/condformatcontext.cxx | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit f92f1d9972d57c7030e0e9548835d1747d5ebbf4 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Fri Apr 14 14:26:32 2023 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Wed May 3 15:16:25 2023 +0200 sc: filter: oxx: insert more rules same range If there are rules with the same range to preserve priority order. <conditionalFormatting sqref="I4:I5"> <cfRule type="cellIs" dxfId="5587" priority="1500" operator="equal"> <formula>"GO"</formula> </cfRule> </conditionalFormatting> <conditionalFormatting sqref="E11:I12 E15:I16"> <cfRule type="containsText" dxfId="5586" priority="1457" operator="containsText" text="R"> <formula>NOT(ISERROR(SEARCH("R",E11)))</formula> </cfRule> </conditionalFormatting> <conditionalFormatting sqref="I4:I5"> <cfRule type="containsText" dxfId="5585" priority="1501" operator="containsText" text="R"> <formula>NOT(ISERROR(SEARCH("R",E11)))</formula> </cfRule> </conditionalFormatting> Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: Ibb98953f0a50140dbde4d52a79fde968095881d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150436 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx index 17ef8e7621be..dfb665befe39 100644 --- a/sc/source/filter/inc/condformatbuffer.hxx +++ b/sc/source/filter/inc/condformatbuffer.hxx @@ -168,7 +168,6 @@ public: /** Returns the priority of this rule. */ sal_Int32 getPriority() const { return maModel.mnPriority; } - ColorScaleRule* getCurColorScale() const { return mpColor.get(); } ColorScaleRule* getColorScale(); DataBarRule* getDataBar(); @@ -313,7 +312,7 @@ public: static sal_Int32 convertToApiOperator( sal_Int32 nToken ); static ScConditionMode convertToInternalOperator( sal_Int32 nToken ); void finalizeImport(); - bool insertColorScale(CondFormatRef const & xCondFmt, CondFormatRuleRef const & xRule); + bool insertRule(CondFormatRef const & xCondFmt, CondFormatRuleRef const & xRule); private: CondFormatRef createCondFormat(); diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 64180b16d390..568a4197b070 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -1218,7 +1218,7 @@ void CondFormatBuffer::updateImport(const ScDataBarFormatData* pTarget) } } -bool CondFormatBuffer::insertColorScale(CondFormatRef const & xCondFmt, CondFormatRuleRef const & xRule) +bool CondFormatBuffer::insertRule(CondFormatRef const & xCondFmt, CondFormatRuleRef const & xRule) { CondFormatRef xFoundFmt; ScRangeList aRanges = xCondFmt->getRanges(); diff --git a/sc/source/filter/oox/condformatcontext.cxx b/sc/source/filter/oox/condformatcontext.cxx index f2b5fc899813..e298538847e8 100644 --- a/sc/source/filter/oox/condformatcontext.cxx +++ b/sc/source/filter/oox/condformatcontext.cxx @@ -204,8 +204,9 @@ void CondFormatContext::onEndElement() case XLS_TOKEN( cfRule ): if (mxCondFmt && mxRule) { - if (!mxRule->getCurColorScale() || - !getCondFormats().insertColorScale(mxCondFmt, mxRule)) + ScRangeList aRanges = mxCondFmt->getRanges(); + if ((aRanges.size() == 1 && aRanges.GetCellCount() == 1) || + !getCondFormats().insertRule(mxCondFmt, mxRule)) mxCondFmt->insertRule(mxRule); } break;