Kaydet (Commit) 010e2070 authored tarafından Katarina Behrens's avatar Katarina Behrens

fdo #50343: Fixed crash on xlsx import of file with array formula

Follow-up of 7fff9872. Buffer only cell formula values via
setCellFormulaValue. Otherwise we get crash in
FormulaBuffer::applyCellFormulaValues() as array/shared/datatable
formulas are treated differently

Change-Id: Ie344b273ec662e8af1bf9fa54e79614393634974
üst 898f54e7
......@@ -184,7 +184,13 @@ void SheetDataContext::onEndElement()
case XML_normal:
setCellFormula( maCellData.maCellAddr, maFormulaStr );
mrSheetData.setCellFormat( maCellData );
// If a number cell has some preloaded value, stick it into the buffer
// but do this only for real cell formulas (not array, shared etc.)
if( !( maCellValue.isEmpty() ) && ( maCellData.mnCellType == XML_n ) )
setCellFormulaValue( maCellData.maCellAddr, maCellValue.toDouble() );
break;
case XML_shared:
if( maFmlaData.mnSharedId >= 0 )
{
......@@ -249,13 +255,6 @@ void SheetDataContext::onEndElement()
mrSheetData.setBlankCell( maCellData );
}
}
else if( !maCellValue.isEmpty() ) switch( maCellData.mnCellType )
{
case XML_n:
/* Set the pre-loaded value */
setCellFormulaValue( maCellData.maCellAddr, maCellValue.toDouble() );
break;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment