[Libreoffice-commits] core.git: sc/inc sc/source

Tor Lillqvist tml at collabora.com
Fri Oct 2 03:29:21 PDT 2015


 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(-)

New commits:
commit 9ad516a00cabba1383bc5c53b133ecc33b1c71ff
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Oct 2 13:25:47 2015 +0300

    Revert "Make fewer calls to officecfg::...::UseOpenCL::get()"
    
    Was not liked.
    
    This reverts commit e4ddba2b5f8ff32dd35e8c8f66f145597407be42.
    This reverts commit ab092bdc0f8c45e174cad403de9d2342adc01fb6.
    
    Change-Id: If2e9e032a135530da92b5bd166f5b559b10b0b91

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index df13660..3deb9e3 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 0822d45..897737e 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -17,7 +17,6 @@
 #include "refupdatecontext.hxx"
 
 #include <formula/token.hxx>
-#include <officecfg/Office/Common.hxx>
 
 #include <algorithm>
 
@@ -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 151fcfe..04eedf7 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -46,7 +46,6 @@
 #include <stlalgorithm.hxx>
 #include <formulagroup.hxx>
 
-#include <officecfg/Office/Common.hxx>
 #include <svl/poolcach.hxx>
 #include <svl/zforlist.hxx>
 #include <svl/sharedstringpool.hxx>
@@ -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<ScFormulaCell&>(rOld).Interpret(mbUseOpenCL);
+                        const_cast<ScFormulaCell&>(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<size_t>(nRow2); ++it, nOffset = 0, nCurRow += nDataSize)
     {
@@ -1129,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.
@@ -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 099328f..c4d2e4e 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -54,7 +54,6 @@
 
 #include <mdds/flat_segment_tree.hpp>
 
-#include <officecfg/Office/Common.hxx>
 #include <sfx2/objsh.hxx>
 #include <svl/zforlist.hxx>
 #include <svl/zformat.hxx>
@@ -93,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 9a9a7eb..48319ba 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 <officecfg/Office/Common.hxx>
 #include <svl/intitem.hxx>
 #include <svl/zforlist.hxx>
 #include <formula/token.hxx>
@@ -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 2f8a2d7..864a77b 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 <officecfg/Office/Common.hxx>
 #include <vcl/svapp.hxx>
 
 #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 90b4adc..06f6439 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 8276327..e168ec6 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -30,7 +30,6 @@
 #include <basic/basmgr.hxx>
 
 #include <basic/sbx.hxx>
-#include <officecfg/Office/Common.hxx>
 #include <svl/zforlist.hxx>
 #include <svl/sharedstringpool.hxx>
 #include <vcl/layout.hxx>
@@ -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 1b640bb..be0c53c 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -18,7 +18,6 @@
  */
 
 #include "scitems.hxx"
-#include <officecfg/Office/Common.hxx>
 #include <svtools/colorcfg.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/outlobj.hxx>
@@ -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 9592a71..15fa0ec 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -19,7 +19,6 @@
 
 #include "scitems.hxx"
 
-#include <officecfg/Office/Common.hxx>
 #include <sfx2/app.hxx>
 #include <editeng/editobj.hxx>
 #include <sfx2/linkmgr.hxx>
@@ -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);
     }


More information about the Libreoffice-commits mailing list