diff options
-rw-r--r-- | sc/source/filter/oox/formulabuffer.cxx | 1 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheetfragment.cxx | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index cc8a50a8492e..21e383fe97b7 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -65,7 +65,6 @@ void FormulaBuffer::finalizeImport() FormulaDataMap::iterator cellIt = maCellFormulas.find( nTab ); if ( cellIt != maCellFormulas.end() ) { - compileOpenCLKernels(); applyCellFormulas( cellIt->second ); } diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx index b8ad65832889..93cacd77d971 100644 --- a/sc/source/filter/oox/worksheetfragment.cxx +++ b/sc/source/filter/oox/worksheetfragment.cxx @@ -511,7 +511,16 @@ void WorksheetFragment::importDimension( const AttributeList& rAttribs ) be set. If the cell A1 exists, the used area will be updated while importing the cell. */ if( (aRange.EndColumn > 0) || (aRange.EndRow > 0) ) + { extendUsedArea( aRange ); + + // Start pre-compiling OpenCL kernels if we have a large number of + // cells to import. The current threshold is 100,000. + double fCellCount = aRange.EndColumn - aRange.StartColumn + 1.0; + fCellCount *= aRange.EndRow - aRange.StartRow + 1.0; + if (fCellCount > 100000.0) + compileOpenCLKernels(); + } } void WorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs ) |