From 844bba4bb44966a1d27f55c4e511eb7f5887d147 Mon Sep 17 00:00:00 2001 From: Daniel Bankston Date: Fri, 11 May 2012 12:04:14 -0500 Subject: Replace extra XFormulaTokens call with direct ScDocument Change-Id: Ib7469c4214687021efdcfb9bbf162ee6eb6404c4 --- sc/source/filter/oox/worksheethelper.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sc/source') diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 835324b2c13c..84b167848e1f 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -69,6 +69,7 @@ #include "sharedstringsbuffer.hxx" #include "sheetdatabuffer.hxx" #include "stylesbuffer.hxx" +#include "tokenuno.hxx" #include "unitconverter.hxx" #include "viewsettings.hxx" #include "workbooksettings.hxx" @@ -1587,9 +1588,13 @@ void WorksheetHelper::putRichString( const CellAddress& rAddress, const RichStri void WorksheetHelper::putFormulaTokens( const CellAddress& rAddress, const ApiTokenSequence& rTokens ) const { - Reference< XFormulaTokens > xTokens( getCell( rAddress ), UNO_QUERY ); - OSL_ENSURE( xTokens.is(), "WorksheetHelper::putFormulaTokens - missing token interface" ); - if( xTokens.is() ) xTokens->setTokens( rTokens ); + ScDocument& rDoc = getScDocument(); + ScTokenArray aTokenArray; + ScAddress aCellPos; + ScUnoConversion::FillScAddress( aCellPos, rAddress ); + ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens ); + ScBaseCell* pNewCell = new ScFormulaCell( &rDoc, aCellPos, &aTokenArray ); + rDoc.PutCell( aCellPos, pNewCell, sal_True ); } void WorksheetHelper::initializeWorksheetImport() -- cgit