summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/column.hxx5
-rw-r--r--sc/inc/dociter.hxx11
-rw-r--r--sc/inc/document.hxx9
-rw-r--r--sc/inc/formulacell.hxx4
-rw-r--r--sc/inc/interpretercontext.hxx39
-rw-r--r--sc/inc/table.hxx5
6 files changed, 60 insertions, 13 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 67bc6c348c5e..44bee716bf18 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -106,6 +106,7 @@ class ScDocumentImport;
class ScHint;
enum class ScMF;
struct ScFilterEntries;
+struct ScInterpreterContext;
struct ScNeededSizeOptions
{
@@ -447,7 +448,7 @@ public:
const ScPatternAttr* GetPattern( SCROW nRow ) const;
const ScPatternAttr* GetMostUsedPattern( SCROW nStartRow, SCROW nEndRow ) const;
- sal_uInt32 GetNumberFormat( SCROW nRow ) const;
+ sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext, SCROW nRow ) const;
sal_uInt32 GetNumberFormat( SCROW nStartRow, SCROW nEndRow ) const;
void MergeSelectionPattern( ScMergePatternState& rState, const ScMarkData& rMark, bool bDeep ) const;
@@ -582,7 +583,7 @@ public:
void SetFormulaResults( SCROW nRow, const double* pResults, size_t nLen );
void SetFormulaResults( SCROW nRow, const formula::FormulaConstTokenRef* pResults, size_t nLen );
- void CalculateInThread( SCROW nRow, size_t nLen, unsigned nThisThread, unsigned nThreadsTotal);
+ void CalculateInThread( const ScInterpreterContext& rContext, SCROW nRow, size_t nLen, unsigned nThisThread, unsigned nThreadsTotal );
void HandleStuffAfterParallelCalculation( SCROW nRow, size_t nLen );
void SetNumberFormat( SCROW nRow, sal_uInt32 nNumberFormat );
diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx
index 544e64ebc9c1..904f471c3c4f 100644
--- a/sc/inc/dociter.hxx
+++ b/sc/inc/dociter.hxx
@@ -45,6 +45,7 @@ struct ScQueryParam;
struct ScDBQueryParamInternal;
struct ScDBQueryParamMatrix;
class ScFormulaCell;
+struct ScInterpreterContext;
class ScValueIterator // walk through all values in an area
{
@@ -84,7 +85,7 @@ public:
ScDocument* pDocument, const ScRange& rRange, SubtotalFlags nSubTotalFlags = SubtotalFlags::NONE,
bool bTextAsZero = false );
- void GetCurNumFmtInfo( short& nType, sal_uLong& nIndex );
+ void GetCurNumFmtInfo( const ScInterpreterContext& rContext, short& nType, sal_uLong& nIndex );
/// Does NOT reset rValue if no value found!
bool GetFirst( double& rValue, FormulaError& rErr );
@@ -125,7 +126,7 @@ private:
{
typedef std::pair<sc::CellStoreType::const_iterator,size_t> PositionType;
public:
- DataAccessInternal(ScDBQueryParamInternal* pParam, ScDocument* pDoc);
+ DataAccessInternal(ScDBQueryParamInternal* pParam, ScDocument* pDoc, const ScInterpreterContext& rContext);
virtual ~DataAccessInternal() override;
virtual bool getCurrent(Value& rValue) override;
virtual bool getFirst(Value& rValue) override;
@@ -139,6 +140,7 @@ private:
PositionType maCurPos;
ScDBQueryParamInternal* mpParam;
ScDocument* mpDoc;
+ const ScInterpreterContext& mrContext;
const ScAttrArray* pAttrArray;
sal_uLong nNumFormat; // for CalcAsShown
sal_uLong nNumFmtIndex;
@@ -171,7 +173,7 @@ private:
::std::unique_ptr<DataAccess> mpData;
public:
- ScDBQueryDataIterator(ScDocument* pDocument, ScDBQueryParamBase* pParam);
+ ScDBQueryDataIterator(ScDocument* pDocument, const ScInterpreterContext& rContext, ScDBQueryParamBase* pParam);
/// Does NOT reset rValue if no value found!
bool GetFirst(Value& rValue);
/// Does NOT reset rValue if no value found!
@@ -266,6 +268,7 @@ class ScQueryCellIterator // walk through all non-empty cells in an ar
std::unique_ptr<ScQueryParam> mpParam;
ScDocument* pDoc;
+ const ScInterpreterContext& mrContext;
SCTAB nTab;
SCCOL nCol;
SCROW nRow;
@@ -292,7 +295,7 @@ class ScQueryCellIterator // walk through all non-empty cells in an ar
bool BinarySearch();
public:
- ScQueryCellIterator(ScDocument* pDocument, SCTAB nTable,
+ ScQueryCellIterator(ScDocument* pDocument, const ScInterpreterContext& rContext, SCTAB nTable,
const ScQueryParam& aParam, bool bMod);
// when !bMod, the QueryParam has to be filled
// (bIsString)
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index eef7c4c8df07..f37e8e7d856e 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <vcl/vclptr.hxx>
#include "scdllapi.h"
+#include "interpretercontext.hxx"
#include "rangelst.hxx"
#include "rangenam.hxx"
#include "tabopparams.hxx"
@@ -559,6 +560,8 @@ public:
SC_DLLPUBLIC void InitDrawLayer( SfxObjectShell* pDocShell = nullptr );
+ SC_DLLPUBLIC ScInterpreterContext GetNonThreadedContext() const;
+
SC_DLLPUBLIC sfx2::LinkManager* GetLinkManager();
SC_DLLPUBLIC const sfx2::LinkManager* GetLinkManager() const;
@@ -1111,10 +1114,10 @@ public:
SC_DLLPUBLIC void GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
sal_uInt32& rFormat ) const;
sal_uInt32 GetNumberFormat( const ScRange& rRange ) const;
- SC_DLLPUBLIC sal_uInt32 GetNumberFormat( const ScAddress& ) const;
+ SC_DLLPUBLIC sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext, const ScAddress& ) const;
void SetNumberFormat( const ScAddress& rPos, sal_uInt32 nNumberFormat );
- void GetNumberFormatInfo( short& nType, sal_uLong& nIndex, const ScAddress& rPos ) const;
+ void GetNumberFormatInfo( const ScInterpreterContext& rContext, short& nType, sal_uLong& nIndex, const ScAddress& rPos ) const;
SC_DLLPUBLIC const ScFormulaCell* GetFormulaCell( const ScAddress& rPos ) const;
SC_DLLPUBLIC ScFormulaCell* GetFormulaCell( const ScAddress& rPos );
SC_DLLPUBLIC void GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rFormula ) const;
@@ -2049,7 +2052,7 @@ public:
void SC_DLLPUBLIC SetFormulaResults( const ScAddress& rTopPos, const double* pResults, size_t nLen );
void SC_DLLPUBLIC SetFormulaResults( const ScAddress& rTopPos, const formula::FormulaConstTokenRef* pResults, size_t nLen );
- ScDocumentThreadSpecific CalculateInColumnInThread( const ScAddress& rTopPos, size_t nLen, unsigned nThisThread, unsigned nThreadsTotal);
+ ScDocumentThreadSpecific CalculateInColumnInThread( const ScInterpreterContext& rContext, const ScAddress& rTopPos, size_t nLen, unsigned nThisThread, unsigned nThreadsTotal);
void HandleStuffAfterParallelCalculation( const ScAddress& rTopPos, size_t nLen );
/**
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 40fe21598e28..0185e2629010 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -30,7 +30,7 @@
#include <svl/listener.hxx>
#include "types.hxx"
-
+#include "interpretercontext.hxx"
#include "formularesult.hxx"
namespace sc {
@@ -150,7 +150,7 @@ public:
SCITP_FROM_ITERATION,
SCITP_CLOSE_ITERATION_CIRCLE
};
- void InterpretTail( ScInterpretTailParameter );
+ void InterpretTail( const ScInterpreterContext&, ScInterpretTailParameter );
void HandleStuffAfterParallelCalculation();
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx
new file mode 100644
index 000000000000..cbf05349ca5f
--- /dev/null
+++ b/sc/inc/interpretercontext.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX
+#define INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX
+
+class ScDocument;
+class SvNumberFormatter;
+
+struct ScInterpreterContext
+{
+ const ScDocument& mrDoc;
+ SvNumberFormatter* mpFormatter;
+
+ ScInterpreterContext(const ScDocument& rDoc, SvNumberFormatter* pFormatter) :
+ mrDoc(rDoc),
+ mpFormatter(pFormatter)
+ {
+ }
+
+ ~ScInterpreterContext()
+ {
+ }
+
+ SvNumberFormatter* GetFormatTable() const
+ {
+ return mpFormatter;
+ }
+};
+
+#endif // INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 9b04a4d019a4..1f77ae4d2e39 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -116,6 +116,7 @@ class ScRangeName;
class ScDBData;
class ScDocumentImport;
class ScHint;
+struct ScInterpreterContext;
class ScColumnsRange final
{
@@ -672,7 +673,7 @@ public:
const ScPatternAttr* GetPattern( SCCOL nCol, SCROW nRow ) const;
const ScPatternAttr* GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const;
- sal_uInt32 GetNumberFormat( const ScAddress& rPos ) const;
+ sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext, const ScAddress& rPos ) const;
sal_uInt32 GetNumberFormat( SCCOL nCol, SCROW nRow ) const;
sal_uInt32 GetNumberFormat( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const;
@@ -997,7 +998,7 @@ public:
void SetFormulaResults( SCCOL nCol, SCROW nRow, const double* pResults, size_t nLen );
void SetFormulaResults( SCCOL nCol, SCROW nRow, const formula::FormulaConstTokenRef* pResults, size_t nLen );
- void CalculateInColumnInThread( SCCOL nCol, SCROW nRow, size_t nLen, unsigned nThisThread, unsigned nThreadsTotal);
+ void CalculateInColumnInThread( const ScInterpreterContext& rContext, SCCOL nCol, SCROW nRow, size_t nLen, unsigned nThisThread, unsigned nThreadsTotal);
void HandleStuffAfterParallelCalculation( SCCOL nCol, SCROW nRow, size_t nLen);
/**