diff options
Diffstat (limited to 'sc/source/filter/oox')
-rw-r--r-- | sc/source/filter/oox/formulabuffer.cxx | 1 | ||||
-rw-r--r-- | sc/source/filter/oox/workbookhelper.cxx | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index 21e383fe97b7..cc8a50a8492e 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -65,6 +65,7 @@ void FormulaBuffer::finalizeImport() FormulaDataMap::iterator cellIt = maCellFormulas.find( nTab ); if ( cellIt != maCellFormulas.end() ) { + compileOpenCLKernels(); applyCellFormulas( cellIt->second ); } diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 7a9a58f21ee7..9ae6fea6deaf 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -71,6 +71,8 @@ #include "dbdata.hxx" #include "datauno.hxx" #include "globalnames.hxx" +#include "clkernelthread.hxx" +#include "rtl/ref.hxx" #include "formulabuffer.hxx" #include "vcl/mapmod.hxx" @@ -223,6 +225,8 @@ public: /** Returns the codec helper that stores the encoder/decoder object. */ inline BiffCodecHelper& getCodecHelper() { return *mxCodecHelper; } + void compileOpenCLKernels(); + private: /** Initializes some basic members and sets needed document properties. */ void initialize( bool bWorkbookFile ); @@ -253,6 +257,8 @@ private: typedef ::std::auto_ptr< PageSettingsConverter > PageSettConvPtr; typedef ::std::auto_ptr< BiffCodecHelper > BiffCodecHelperPtr; + rtl::Reference<sc::CLBuildKernelThread> mxCLKernelThread; + OUString maCellStyles; /// Style family name for cell styles. OUString maPageStyles; /// Style family name for page styles. OUString maCellStyleServ; /// Service name for a cell style. @@ -504,6 +510,15 @@ void WorkbookGlobals::useInternalChartDataTable( bool bInternal ) // private -------------------------------------------------------------------- +void WorkbookGlobals::compileOpenCLKernels() +{ + if (mxCLKernelThread.is()) + return; + + mxCLKernelThread.set(new sc::CLBuildKernelThread); + mxCLKernelThread->launch(); +} + void WorkbookGlobals::initialize( bool bWorkbookFile ) { maCellStyles = "CellStyles"; @@ -634,6 +649,9 @@ void WorkbookGlobals::finalize() //ScDocShell::AfterXMLLoading() for ods getScDocument().SetInsertingFromOtherDoc(false); getScDocument().RebuildFormulaGroups(); + + if (mxCLKernelThread.is()) + mxCLKernelThread->join(); } } @@ -949,6 +967,11 @@ BiffCodecHelper& WorkbookHelper::getCodecHelper() const return mrBookGlob.getCodecHelper(); } +void WorkbookHelper::compileOpenCLKernels() +{ + mrBookGlob.compileOpenCLKernels(); +} + // ============================================================================ } // namespace xls |