sc/source/core/data/conditio.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
New commits: commit ed62e272ecc5a5642fe6e1c9e8b7575a02f5f521 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Jan 15 17:25:04 2024 +0600 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Jan 15 16:09:04 2024 +0100 Simplify a bit Change-Id: Icdaaed6710593d8082239d14e03b71ad82165658 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162085 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 13859539f385..7c78669d8a3f 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -638,25 +638,25 @@ bool ScConditionEntry::IsEqual( const ScFormatEntry& rOther, bool bIgnoreSrcPos const ScConditionEntry& r = static_cast<const ScConditionEntry&>(rOther); - bool bEq = (eOp == r.eOp && nOptions == r.nOptions && - lcl_IsEqual( pFormula1, r.pFormula1 ) && - lcl_IsEqual( pFormula2, r.pFormula2 )); + if (eOp != r.eOp || nOptions != r.nOptions + || !lcl_IsEqual(pFormula1, r.pFormula1) || !lcl_IsEqual(pFormula2, r.pFormula2)) + return false; if (!bIgnoreSrcPos) { // for formulas, the reference positions must be compared, too // (including aSrcString, for inserting the entries during XML import) - if ( bEq && ( pFormula1 || pFormula2 ) && ( aSrcPos != r.aSrcPos || aSrcString != r.aSrcString ) ) - bEq = false; + if ( ( pFormula1 || pFormula2 ) && ( aSrcPos != r.aSrcPos || aSrcString != r.aSrcString ) ) + return false; } // If not formulas, compare values - if ( bEq && !pFormula1 && ( nVal1 != r.nVal1 || aStrVal1 != r.aStrVal1 || bIsStr1 != r.bIsStr1 ) ) - bEq = false; - if ( bEq && !pFormula2 && ( nVal2 != r.nVal2 || aStrVal2 != r.aStrVal2 || bIsStr2 != r.bIsStr2 ) ) - bEq = false; + if ( !pFormula1 && ( nVal1 != r.nVal1 || aStrVal1 != r.aStrVal1 || bIsStr1 != r.bIsStr1 ) ) + return false; + if ( !pFormula2 && ( nVal2 != r.nVal2 || aStrVal2 != r.aStrVal2 || bIsStr2 != r.bIsStr2 ) ) + return false; - return bEq; + return true; } void ScConditionEntry::Interpret( const ScAddress& rPos )