[Libreoffice-commits] core.git: Branch 'feature/fixes10' - sc/inc sc/source

Tor Lillqvist tml at collabora.com
Fri Oct 2 03:30:24 PDT 2015


 sc/inc/formulacell.hxx              |    2 +-
 sc/source/core/data/colorscale.cxx  |    2 +-
 sc/source/core/data/column.cxx      |   23 +++++------------------
 sc/source/core/data/column3.cxx     |    9 +--------
 sc/source/core/data/documen4.cxx    |   11 +++++------
 sc/source/core/data/documen7.cxx    |    5 ++---
 sc/source/core/data/formulacell.cxx |   11 +++++++----
 sc/source/core/data/validat.cxx     |    2 +-
 sc/source/core/tool/detfunc.cxx     |   10 +++++-----
 sc/source/ui/docshell/docfunc.cxx   |    2 +-
 10 files changed, 29 insertions(+), 48 deletions(-)

New commits:
commit 6f5961806793fc980129c7e119708001a9c944d8
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Oct 2 13:29:47 2015 +0300

    Revert "Make less calls to officecfg::...::UseOpenCL::get()"
    
    Was not liked.
    
    This reverts commit 565232aa89889b373d487d77fcba826abaf875f1.

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index bb97160..c017dbe 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -242,7 +242,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 9bd845f..9be59b7 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -219,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 7529043..9accde9 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -867,7 +867,6 @@ class CopyToClipHandler
     sc::ColumnBlockPosition maDestPos;
     sc::ColumnBlockPosition* mpDestPos;
     bool mbCopyNotes;
-    bool mbUseOpenCL;
 
     void setDefaultAttrsToDest(size_t nRow, size_t nSize)
     {
@@ -883,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;
@@ -958,7 +953,7 @@ public:
                 {
                     const ScFormulaCell& rOld = **it;
                     if (rOld.GetDirty() && mrSrcCol.GetDoc().GetAutoCalc())
-                        const_cast<ScFormulaCell&>(rOld).Interpret(mbUseOpenCL);
+                        const_cast<ScFormulaCell&>(rOld).Interpret();
 
                     aCloned.push_back(new ScFormulaCell(rOld, mrDestCol.GetDoc(), aDestPos));
                 }
@@ -1062,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<size_t>(nRow2); ++it, nOffset = 0, nCurRow += nDataSize)
     {
@@ -1128,7 +1122,7 @@ void ScColumn::CopyStaticToDocument(
 
                     ScFormulaCell& rFC = const_cast<ScFormulaCell&>(**itData);
                     if (rFC.GetDirty() && pDocument->GetAutoCalc())
-                        rFC.Interpret(bUseOpenCL);
+                        rFC.Interpret();
 
                     if (rFC.GetErrCode())
                         // Skip cells with error.
@@ -1193,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);
@@ -2783,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
@@ -2797,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 9dc95c1..40ec240 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -92,17 +92,10 @@ void ScColumn::BroadcastCells( const std::vector<SCROW>& 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 b0a2af8..6d0c89d 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -85,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 ) )
         {
@@ -110,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
 
@@ -132,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;
 
@@ -166,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;
@@ -230,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;
@@ -241,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 3d89773..795e93c 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -460,7 +460,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!
@@ -468,11 +467,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 7f91492..f38e7da 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1434,7 +1434,7 @@ bool ScFormulaCell::MarkUsedExternalReferences()
     return pCode && pDocument->MarkUsedExternalReferences(*pCode, aPos);
 }
 
-void ScFormulaCell::Interpret(bool bUseOpenCL)
+void ScFormulaCell::Interpret()
 {
     if (!IsDirtyOrInTableOpDirty() || pDocument->GetRecursionHelper().IsInReturn())
         return;     // no double/triple processing
@@ -1479,7 +1479,7 @@ void ScFormulaCell::Interpret(bool bUseOpenCL)
     }
     else
     {
-        if ( !bUseOpenCL || !InterpretFormulaGroup() )
+        if ( ! InterpretFormulaGroup() )
             InterpretTail( SCITP_NORMAL);
     }
 
@@ -2369,7 +2369,7 @@ bool ScFormulaCell::NeedsInterpret() const
 void ScFormulaCell::MaybeInterpret()
 {
     if (NeedsInterpret())
-        Interpret(officecfg::Office::Common::Misc::UseOpenCL::get());
+        Interpret();
 }
 
 bool ScFormulaCell::IsHyperLinkCell() const
@@ -2456,7 +2456,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();
 }
@@ -3829,6 +3829,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 25b7f94..bb19d02 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -634,7 +634,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 2958827..d21476f 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -811,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;
@@ -900,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;
@@ -958,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;
@@ -1010,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);
@@ -1098,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 a575f71..1245ef5 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1014,7 +1014,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);
     }


More information about the Libreoffice-commits mailing list