summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKatarina Behrens <bubli@bubli.org>2012-09-29 20:09:42 +0200
committerKatarina Behrens <bubli@bubli.org>2012-09-29 20:20:06 +0200
commit010e207039cc12bf7c688d978adeb16c0802333e (patch)
treecd4b47f8924215b290cdce3c6fa97c227a0fa9b8 /sc
parent898f54e72fc71d04c5090f3c7380e3bfce750adf (diff)
fdo #50343: Fixed crash on xlsx import of file with array formula
Follow-up of 7fff98724bc7e3. 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
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/sheetdatacontext.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/sc/source/filter/oox/sheetdatacontext.cxx b/sc/source/filter/oox/sheetdatacontext.cxx
index 7ca86d7adc93..c7db69c0e506 100644
--- a/sc/source/filter/oox/sheetdatacontext.cxx
+++ b/sc/source/filter/oox/sheetdatacontext.cxx
@@ -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;
- }
}
}