From 3346947b7e102384dfc6cd98dbf7da81936f8fd6 Mon Sep 17 00:00:00 2001 From: Dennis Francis Date: Tue, 15 Jan 2019 21:34:46 +0530 Subject: Allow computing spans of formula-groups Includes unit tests for correctness of the new functionality. Change-Id: I35f7449006d973de006a756664ae468b9a0dcb31 Reviewed-on: https://gerrit.libreoffice.org/66841 Tested-by: Jenkins Reviewed-by: Dennis Francis --- sc/inc/formulacell.hxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'sc/inc/formulacell.hxx') diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index b6959c74d6cd..ec7c61171ae7 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -143,10 +143,12 @@ private: ScFormulaCell( const ScFormulaCell& ) = delete; - bool CheckComputeDependencies(sc::FormulaLogger::GroupScope& rScope, bool fromFirstRow = false); + bool CheckComputeDependencies(sc::FormulaLogger::GroupScope& rScope, bool fromFirstRow, + SCROW nStartOffset, SCROW nEndOffset); bool InterpretFormulaGroupThreading(sc::FormulaLogger::GroupScope& aScope, bool& bDependencyComputed, - bool& bDependencyCheckFailed); + bool& bDependencyCheckFailed, + SCROW nStartOffset, SCROW nEndOffset); bool InterpretFormulaGroupOpenCL(sc::FormulaLogger::GroupScope& aScope, bool& bDependencyComputed, bool& bDependencyCheckFailed); @@ -248,7 +250,7 @@ public: void CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rProgress ); // compile temporary string tokens void CalcAfterLoad( sc::CompileFormulaContext& rCxt, bool bStartListening ); bool MarkUsedExternalReferences(); - void Interpret(); + bool Interpret(SCROW nStartOffset = -1, SCROW nEndOffset = -1); bool IsIterCell() const { return bIsIterCell; } sal_uInt16 GetSeenInIteration() const { return nSeenInIteration; } @@ -433,13 +435,15 @@ public: return (pDocument->GetAutoCalc() || (cMatrixFlag != ScMatrixMode::NONE)); } - void MaybeInterpret() + bool MaybeInterpret() { if (NeedsInterpret()) { assert(!pDocument->IsThreadedGroupCalcInProgress()); Interpret(); + return true; } + return false; } /** @@ -451,7 +455,7 @@ public: CompareState CompareByTokenArray( const ScFormulaCell& rOther ) const; - bool InterpretFormulaGroup(); + bool InterpretFormulaGroup(SCROW nStartOffset = -1, SCROW nEndOffset = -1); // nOnlyNames may be one or more of SC_LISTENING_NAMES_* void StartListeningTo( ScDocument* pDoc ); -- cgit