From 257cc7a0027ce4338210fddd50a3d3e5badb0c0b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 4 Oct 2017 00:12:31 +0300 Subject: Introduce ScInterpreterContext Possibly later things that need to be thread-local can be handled through the ScInterpreterContext. Why handle some thread-local things through the ScDocument::maNonThreaded and ScDocument::maThreadSpecific mechanism, and others through this ScInterpreterContext? Good question. Share SvNumberFormatter across worker threads and use mutex to protect SvNumberFormatter::IsNumberFormat() Change-Id: I372e5fbd9a19785f55f0faf4a4bedc5fc1ef3e03 --- sc/inc/document.hxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sc/inc/document.hxx') 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 #include #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 ); /** -- cgit