diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-28 01:22:44 +0200 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-10-01 11:53:47 +0100 |
commit | 1ba25c3ada91963f095c976764d68db039be0fd8 (patch) | |
tree | 74a86937e6a0e1bd928f71eccdfe9e715071b35e | |
parent | 52b6ab689bbeb2611af84b694a98282e58426345 (diff) |
fix vell value import from ooxml with array formulas, fdo#54558
Change-Id: I3a7e30940caaaa543a178bba3008db2c6056b4d3
Signed-off-by: Noel Power <noel.power@suse.com>
-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 a82e19551792..f2b89a89ed04 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -112,23 +112,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; @@ -158,7 +158,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 ); |