diff options
author | Daniel Bankston <daniel.e.bankston@gmail.com> | 2012-06-19 16:42:54 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-20 11:01:25 +0200 |
commit | 7f3c614d2b7b63937bfedb465c86596997f358a6 (patch) | |
tree | 496058bb7a1a4b557cf7d462315b4c163e06ff50 /sc | |
parent | 2636b44b1d7148ebcbf678c3e01f06875164ac02 (diff) |
Clean up logic a bit for formula cell ODS import
Made Markus's recommended changes for logic clean up.
Change-Id: I8d2820558d1d68888414e19aa8d4e9034258c57e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 328b8ddbf423..1457033e65fd 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1012,6 +1012,11 @@ void ScXMLTableRowCellContext::AddNonMatrixFormulaCell( const ScAddress& rCellPo pDoc->IncXMLImportedFormulaCount( aText.getLength() ); pNewCell = new ScFormulaCell( pDoc, rCellPos, pCode, eGrammar, MM_NONE ); delete pCode; + + if( bFormulaTextResult && pOUTextValue && !pOUTextValue->isEmpty() ) + static_cast<ScFormulaCell*>(pNewCell)->SetHybridString( *pOUTextValue ); + else + static_cast<ScFormulaCell*>(pNewCell)->SetHybridDouble( fValue ); } else if ( aText[0] == '\'' && aText.getLength() > 1 ) { @@ -1025,26 +1030,14 @@ void ScXMLTableRowCellContext::AddNonMatrixFormulaCell( const ScAddress& rCellPo sal_uInt32 nEnglish = pFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US); double fVal; if ( pFormatter->IsNumberFormat( aText, nEnglish, fVal ) ) - { pNewCell = new ScValueCell( fVal ); - } + //the (english) number format will not be set + //search matching local format and apply it else pNewCell = ScBaseCell::CreateTextCell( aText, pDoc ); - // das (englische) Zahlformat wird nicht gesetzt - //! passendes lokales Format suchen und setzen??? } - if( pNewCell ) - pDoc->PutCell( rCellPos, pNewCell ); - - ScBaseCell* pCell = rXMLImport.GetDocument()->GetCell( rCellPos ); - if( pCell && pCell->GetCellType() == CELLTYPE_FORMULA ) - { - if( bFormulaTextResult && pOUTextValue && !pOUTextValue->isEmpty() ) - static_cast<ScFormulaCell*>(pCell)->SetHybridString( *pOUTextValue ); - else - static_cast<ScFormulaCell*>(pCell)->SetHybridDouble( fValue ); - } + pDoc->PutCell( rCellPos, pNewCell ); } } |