From 9ad516a00cabba1383bc5c53b133ecc33b1c71ff Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 2 Oct 2015 13:25:47 +0300 Subject: Revert "Make fewer calls to officecfg::...::UseOpenCL::get()" Was not liked. This reverts commit e4ddba2b5f8ff32dd35e8c8f66f145597407be42. This reverts commit ab092bdc0f8c45e174cad403de9d2342adc01fb6. Change-Id: If2e9e032a135530da92b5bd166f5b559b10b0b91 --- sc/inc/formulacell.hxx | 2 +- sc/source/core/data/colorscale.cxx | 3 +-- sc/source/core/data/column.cxx | 24 +++++------------------- sc/source/core/data/column3.cxx | 10 +--------- sc/source/core/data/documen4.cxx | 12 +++++------- sc/source/core/data/documen7.cxx | 6 ++---- sc/source/core/data/formulacell.cxx | 11 +++++++---- sc/source/core/data/validat.cxx | 3 +-- sc/source/core/tool/detfunc.cxx | 11 +++++------ sc/source/ui/docshell/docfunc.cxx | 3 +-- 10 files changed, 29 insertions(+), 56 deletions(-) (limited to 'sc') diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index df13660e7daa..3deb9e30583d 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -228,7 +228,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 bUseOpenCL); + void Interpret(); bool IsIterCell() const { return bIsIterCell; } sal_uInt16 GetSeenInIteration() const { return nSeenInIteration; } diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 0822d45aeceb..897737ec5b65 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -17,7 +17,6 @@ #include "refupdatecontext.hxx" #include -#include #include @@ -220,7 +219,7 @@ double ScColorScaleEntry::GetValue() const { if(mpCell) { - mpCell->Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); + mpCell->Interpret(); if(mpCell->IsValue()) return mpCell->GetValue(); diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 151fcfe606dd..04eedf75b24b 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -46,7 +46,6 @@ #include #include -#include #include #include #include @@ -868,7 +867,6 @@ class CopyToClipHandler sc::ColumnBlockPosition maDestPos; sc::ColumnBlockPosition* mpDestPos; bool mbCopyNotes; - bool mbUseOpenCL; void setDefaultAttrsToDest(size_t nRow, size_t nSize) { @@ -884,11 +882,7 @@ class CopyToClipHandler public: CopyToClipHandler(const ScColumn& rSrcCol, ScColumn& rDestCol, sc::ColumnBlockPosition* pDestPos, bool bCopyNotes) : - mrSrcCol(rSrcCol), - mrDestCol(rDestCol), - mpDestPos(pDestPos), - mbCopyNotes(bCopyNotes), - mbUseOpenCL(officecfg::Office::Common::Misc::UseOpenCL::get()) + mrSrcCol(rSrcCol), mrDestCol(rDestCol), mpDestPos(pDestPos), mbCopyNotes(bCopyNotes) { if (mpDestPos) maDestPos = *mpDestPos; @@ -959,7 +953,7 @@ public: { const ScFormulaCell& rOld = **it; if (rOld.GetDirty() && mrSrcCol.GetDoc().GetAutoCalc()) - const_cast(rOld).Interpret(mbUseOpenCL); + const_cast(rOld).Interpret(); aCloned.push_back(new ScFormulaCell(rOld, mrDestCol.GetDoc(), aDestPos)); } @@ -1063,7 +1057,6 @@ void ScColumn::CopyStaticToDocument( size_t nOffset = aPos.second; size_t nDataSize = 0; size_t nCurRow = nRow1; - const bool bUseOpenCL(officecfg::Office::Common::Misc::UseOpenCL::get()); for (; it != maCells.end() && nCurRow <= static_cast(nRow2); ++it, nOffset = 0, nCurRow += nDataSize) { @@ -1129,7 +1122,7 @@ void ScColumn::CopyStaticToDocument( ScFormulaCell& rFC = const_cast(**itData); if (rFC.GetDirty() && pDocument->GetAutoCalc()) - rFC.Interpret(bUseOpenCL); + rFC.Interpret(); if (rFC.GetErrCode()) // Skip cells with error. @@ -1194,7 +1187,7 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDes { ScFormulaCell* p = sc::formula_block::at(*it->data, aPos.second); if (p->GetDirty() && pDocument->GetAutoCalc()) - p->Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); + p->Interpret(); ScAddress aDestPos = p->aPos; aDestPos.SetRow(nDestRow); @@ -2784,13 +2777,6 @@ struct SetDirtyIfPostponedHandler struct CalcAllHandler { - bool mbUseOpenCL; - - CalcAllHandler() : - mbUseOpenCL(officecfg::Office::Common::Misc::UseOpenCL::get()) - { - } - void operator() (size_t /*nRow*/, ScFormulaCell* pCell) { #if OSL_DEBUG_LEVEL > 1 @@ -2798,7 +2784,7 @@ struct CalcAllHandler double nOldVal, nNewVal; nOldVal = pCell->GetValue(); #endif - pCell->Interpret(mbUseOpenCL); + pCell->Interpret(); #if OSL_DEBUG_LEVEL > 1 if (pCell->GetCode()->IsRecalcModeNormal()) nNewVal = pCell->GetValue(); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 099328f6aaae..c4d2e4ef3061 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -54,7 +54,6 @@ #include -#include #include #include #include @@ -93,17 +92,10 @@ void ScColumn::BroadcastCells( const std::vector& rRows, sal_uLong nHint struct DirtyCellInterpreter { - bool mbUseOpenCL; - - DirtyCellInterpreter() : - mbUseOpenCL(officecfg::Office::Common::Misc::UseOpenCL::get()) - { - } - void operator() (size_t, ScFormulaCell* p) { if (p->GetDirty()) - p->Interpret(mbUseOpenCL); + p->Interpret(); } }; diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 9a9a7eb308a9..48319bad94a8 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include #include #include #include @@ -86,7 +85,6 @@ bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, ScFormulaCell* pFormula = NULL; double fTargetVal = 0.0; sal_uInt32 nFIndex = 0; - const bool bUseOpenCL(officecfg::Office::Common::Misc::UseOpenCL::get()); if ( eFType == CELLTYPE_FORMULA && eVType == CELLTYPE_VALUE && GetFormatTable()->IsNumberFormat( sValStr, nFIndex, fTargetVal ) ) { @@ -111,7 +109,7 @@ bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, double fBestF, fFPrev; fBestX = fXPrev = fSaveVal; - pFormula->Interpret( bUseOpenCL ); + pFormula->Interpret(); bool bError = ( pFormula->GetErrCode() != 0 ); // bError always corresponds with fF @@ -133,7 +131,7 @@ bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, { *pVCell = fX; SetDirty( aVRange, false ); - pFormula->Interpret( bUseOpenCL ); + pFormula->Interpret(); bError = ( pFormula->GetErrCode() != 0 ); fF = pFormula->GetValue() - fTargetVal; @@ -167,7 +165,7 @@ bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, *pVCell = fHorX; SetDirty( aVRange, false ); - pFormula->Interpret( bUseOpenCL ); + pFormula->Interpret(); bHorMoveError = ( pFormula->GetErrCode() != 0 ); if ( bHorMoveError ) break; @@ -231,7 +229,7 @@ bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, { *pVCell = nX; SetDirty( aVRange, false ); - pFormula->Interpret( bUseOpenCL ); + pFormula->Interpret(); if ( fabs( pFormula->GetValue() - fTargetVal ) > fabs( fF ) ) nX = fBestX; bRet = true; @@ -242,7 +240,7 @@ bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, } *pVCell = fSaveVal; SetDirty( aVRange, false ); - pFormula->Interpret( bUseOpenCL ); + pFormula->Interpret(); if ( !bDoneIteration ) { SetError( nVCol, nVRow, nVTab, NOTAVAILABLE ); diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 2f8a2d773457..864a77b757b6 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include #include #include "document.hxx" @@ -457,7 +456,6 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet pCell = pFormulaTree; ScFormulaCell* pLastNoGood = 0; - const bool bUseOpenCL(officecfg::Office::Common::Misc::UseOpenCL::get()); while ( pCell ) { // Interpret resets bDirty and calls Remove, also the referenced! @@ -465,11 +463,11 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet if ( bOnlyForced ) { if ( pCell->GetCode()->IsRecalcModeForced() ) - pCell->Interpret( bUseOpenCL ); + pCell->Interpret(); } else { - pCell->Interpret( bUseOpenCL ); + pCell->Interpret(); } if ( pCell->GetPrevious() || pCell == pFormulaTree ) { // (IsInFormulaTree(pCell)) no Remove was called => next diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 90b4adca3359..06f6439fafc3 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1485,7 +1485,7 @@ bool ScFormulaCell::MarkUsedExternalReferences() return pCode && pDocument->MarkUsedExternalReferences(*pCode, aPos); } -void ScFormulaCell::Interpret(bool bUseOpenCL) +void ScFormulaCell::Interpret() { #if DEBUG_CALCULATION static bool bDebugCalculationInit = true; @@ -1541,7 +1541,7 @@ void ScFormulaCell::Interpret(bool bUseOpenCL) } else { - if ( !bUseOpenCL || !InterpretFormulaGroup() ) + if ( ! InterpretFormulaGroup() ) InterpretTail( SCITP_NORMAL); } @@ -2435,7 +2435,7 @@ bool ScFormulaCell::NeedsInterpret() const void ScFormulaCell::MaybeInterpret() { if (NeedsInterpret()) - Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); + Interpret(); } bool ScFormulaCell::IsHyperLinkCell() const @@ -2522,7 +2522,7 @@ const ScMatrix* ScFormulaCell::GetMatrix() if( IsDirtyOrInTableOpDirty() // Was stored !bDirty but an accompanying matrix cell was bDirty? || (!bDirty && cMatrixFlag == MM_FORMULA && !aResult.GetMatrix())) - Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); + Interpret(); } return aResult.GetMatrix().get(); } @@ -3891,6 +3891,9 @@ bool ScFormulaCell::InterpretFormulaGroup() return false; } + if (!officecfg::Office::Common::Misc::UseOpenCL::get()) + return false; + // TODO : Disable invariant formula group interpretation for now in order // to get implicit intersection to work. if (mxGroup->mbInvariant && false) diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 82763275a8b3..e168ec6110f1 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -634,7 +633,7 @@ bool ScValidationData::GetSelectionFromFormula( // Make sure the formula gets interpreted and a result is delivered, // regardless of the AutoCalc setting. - aValidationSrc.Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); + aValidationSrc.Interpret(); ScMatrixRef xMatRef; const ScMatrix *pValues = aValidationSrc.GetMatrix(); diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 1b640bbd7b0d..be0c53cf5c7b 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -18,7 +18,6 @@ */ #include "scitems.hxx" -#include #include #include #include @@ -812,7 +811,7 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetective return DET_INS_CIRCULAR; if (pFCell->GetDirty()) - pFCell->Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); // can't be called after SetRunning + pFCell->Interpret(); // can't be called after SetRunning pFCell->SetRunning(true); sal_uInt16 nResult = DET_INS_EMPTY; @@ -901,7 +900,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL return nLevel; if (pFCell->GetDirty()) - pFCell->Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); // can't be called after SetRunning + pFCell->Interpret(); // can't be called after SetRunning pFCell->SetRunning(true); sal_uInt16 nResult = nLevel; @@ -959,7 +958,7 @@ sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiv return DET_INS_CIRCULAR; if (pFCell->GetDirty()) - pFCell->Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); // can't be called after SetRunning + pFCell->Interpret(); // can't be called after SetRunning pFCell->SetRunning(true); sal_uInt16 nResult = DET_INS_EMPTY; @@ -1011,7 +1010,7 @@ sal_uInt16 ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCo bool bRunning = pFCell->IsRunning(); if (pFCell->GetDirty()) - pFCell->Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); // can't be called after SetRunning + pFCell->Interpret(); // can't be called after SetRunning pFCell->SetRunning(true); ScDetectiveRefIter aIter(pFCell); @@ -1099,7 +1098,7 @@ sal_uInt16 ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2 bool bRunning = pFCell->IsRunning(); if (pFCell->GetDirty()) - pFCell->Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); // can't be called after SetRunning + pFCell->Interpret(); // can't be called after SetRunning pFCell->SetRunning(true); ScDetectiveRefIter aIter(pFCell); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 9592a71ac4b3..15fa0ece667a 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -19,7 +19,6 @@ #include "scitems.hxx" -#include #include #include #include @@ -1009,7 +1008,7 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo if (bInteraction && !rDoc.GetAutoCalc() && pCell) { // calculate just the cell once and set Dirty again - pCell->Interpret(officecfg::Office::Common::Misc::UseOpenCL::get()); + pCell->Interpret(); pCell->SetDirtyVar(); rDoc.PutInFormulaTree( pCell); } -- cgit