sc/source/filter/xml/xmlcelli.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-)
New commits: commit cb1b6e89995196e3dc61dc46d3207d410058638e Author: Daniel Bankston <daniel.e.banks...@gmail.com> Date: Tue Jun 19 16:42:54 2012 -0500 Clean up logic a bit for formula cell ODS import Made Markus's recommended changes for logic clean up. Change-Id: I8d2820558d1d68888414e19aa8d4e9034258c57e diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 841c85c..c34f720 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1017,6 +1017,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 ) { @@ -1030,26 +1035,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 ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits