diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-28 01:22:44 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-28 01:57:10 +0200 |
commit | 6ed264ffca065ed2aa36624ba29d9764ff042a72 (patch) | |
tree | cf2fd92f579f58ed8f157d109f25a332f4b712c6 /sc | |
parent | fcd85be5d5e44b00c6fa5717c7ec13ea657483d4 (diff) |
fix vell value import from ooxml with array formulas, fdo#54559
Change-Id: I3a7e30940caaaa543a178bba3008db2c6056b4d3
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/oox/formulabuffer.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index f2f1d69023ac..70efcaf39b9d 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -99,23 +99,23 @@ void FormulaBuffer::finalizeImport() applyCellFormulas( cellIt->second ); } + ArrayFormulaDataMap::iterator itArray = cellArrayFormulas.find( nTab ); + if ( itArray != cellArrayFormulas.end() ) + { + applyArrayFormulas( itArray->second ); + } + FormulaValueMap::iterator itValues = cellFormulaValues.find( nTab ); if ( itValues != cellFormulaValues.end() ) { std::vector< ValueAddressPair > & rVector = itValues->second; applyCellFormulaValues( rVector ); } - - ArrayFormulaDataMap::iterator itArray = cellArrayFormulas.find( nTab ); - - if ( itArray != cellArrayFormulas.end() ) - { - applyArrayFormulas( itArray->second ); - } } rDoc.SetAutoNameCache( NULL ); xFormulaBar->setPosition( 1.0 ); } + void FormulaBuffer::applyCellFormula( ScDocument& rDoc, const ApiTokenSequence& rTokens, const ::com::sun::star::table::CellAddress& rAddress ) { ScTokenArray aTokenArray; @@ -145,7 +145,8 @@ void FormulaBuffer::applyCellFormulaValues( const std::vector< ValueAddressPair ScAddress aCellPos; ScUnoConversion::FillScAddress( aCellPos, it->first ); ScBaseCell* pBaseCell = rDoc.GetCell( aCellPos ); - if ( pBaseCell->GetCellType() == CELLTYPE_FORMULA ) + SAL_WARN_IF( !pBaseCell, "sc", "why is the formula not imported? bug?"); + if ( pBaseCell && pBaseCell->GetCellType() == CELLTYPE_FORMULA ) { ScFormulaCell* pCell = static_cast< ScFormulaCell* >( pBaseCell ); pCell->SetHybridDouble( it->second ); |