summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/xmlcelli.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/xml/xmlcelli.cxx')
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index b09f90c34e61..4e4c5526b092 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1362,7 +1362,6 @@ void ScXMLTableRowCellContext::PutFormulaCell( const ScAddress& rCellPos )
ScDocumentImport& rDoc = rXMLImport.GetDoc();
OUString aText = maFormula->first;
- OUString aFormulaNmsp = maFormula->second;
::boost::scoped_ptr<ScExternalRefManager::ApiGuard> pExtRefGuard (
new ScExternalRefManager::ApiGuard(pDoc));
@@ -1372,13 +1371,15 @@ void ScXMLTableRowCellContext::PutFormulaCell( const ScAddress& rCellPos )
if ( aText[0] == '=' && aText.getLength() > 1 )
{
// temporary formula string as string tokens
- boost::scoped_ptr<ScTokenArray> pCode(new ScTokenArray);
- pCode->AddStringXML( aText );
- if( (eGrammar == formula::FormulaGrammar::GRAM_EXTERNAL) && !aFormulaNmsp.isEmpty() )
- pCode->AddStringXML( aFormulaNmsp );
+ ScTokenArray *pCode = new ScTokenArray();
+
+ OUString aFormulaNmsp = maFormula->second;
+ if( eGrammar != formula::FormulaGrammar::GRAM_EXTERNAL )
+ aFormulaNmsp = OUString();
+ pCode->AssignXMLString( aText, aFormulaNmsp );
rDoc.getDoc().IncXMLImportedFormulaCount( aText.getLength() );
- ScFormulaCell* pNewCell = new ScFormulaCell(pDoc, rCellPos, *pCode, eGrammar, MM_NONE);
+ ScFormulaCell* pNewCell = new ScFormulaCell(pDoc, rCellPos, pCode, eGrammar, MM_NONE);
SetFormulaCell(pNewCell);
rDoc.setFormulaCell(rCellPos, pNewCell);