sc/source/filter/inc/condformatbuffer.hxx | 2 +- sc/source/filter/oox/condformatbuffer.cxx | 1 - sc/source/filter/oox/condformatcontext.cxx | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-)
New commits: commit b8e42c36558b8d5f8b2556033b9b5a279d32b5d3 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Tue Mar 28 17:48:19 2023 -0400 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Jun 19 09:10:29 2023 +0200 sc: filter: oox: do not insert rule too early The </cfRule> tag is a good place to do a post check the conditional format sanity. Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: Id6e99c81011040ec47034e993490fae5c71d7e04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149719 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151977 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153159 Tested-by: Jenkins (cherry picked from commit cc483a88a03f9ee847f3cb5fac83fb5dd49d0ba1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153139 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx index cdc8d4727baf..fd4268773313 100644 --- a/sc/source/filter/inc/condformatbuffer.hxx +++ b/sc/source/filter/inc/condformatbuffer.hxx @@ -219,9 +219,9 @@ public: const ScRangeList& getRanges() const { return maModel.maRanges; } void setReadyForFinalize() { mbReadyForFinalize = true; } + void insertRule( CondFormatRuleRef const & xRule ); private: CondFormatRuleRef createRule(); - void insertRule( CondFormatRuleRef const & xRule ); private: typedef RefMap< sal_Int32, CondFormatRule > CondFormatRuleMap; diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 3095879cc244..4f0531a18faa 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -1110,7 +1110,6 @@ CondFormatRuleRef CondFormat::importCfRule( const AttributeList& rAttribs ) { CondFormatRuleRef xRule = createRule(); xRule->importCfRule( rAttribs ); - insertRule( xRule ); return xRule; } diff --git a/sc/source/filter/oox/condformatcontext.cxx b/sc/source/filter/oox/condformatcontext.cxx index 2f3ae391ab71..845d105b7605 100644 --- a/sc/source/filter/oox/condformatcontext.cxx +++ b/sc/source/filter/oox/condformatcontext.cxx @@ -202,6 +202,12 @@ void CondFormatContext::onEndElement() if(mxCondFmt) mxCondFmt->setReadyForFinalize(); break; + case XLS_TOKEN( cfRule ): + if (mxCondFmt && mxRule) + { + mxCondFmt->insertRule(mxRule); + } + break; } }