diff options
-rw-r--r-- | oox/source/xls/sheetdatacontext.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx index c6c68dd6897c..1a9847b2f0b8 100644 --- a/oox/source/xls/sheetdatacontext.cxx +++ b/oox/source/xls/sheetdatacontext.cxx @@ -227,9 +227,6 @@ void SheetDataContext::onCharacters( const OUString& rChars ) { if( rChars.getLength() > 0 ) getSharedFormulas().importSharedFmla( rChars, maCurrCell.maFormulaRef, maCurrCell.mnSharedId, maCurrCell.maAddress ); - Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY_THROW ); - ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress ); - getSharedFormulas().setSharedFormulaCell( aContext, maCurrCell.mnSharedId ); } break; @@ -279,6 +276,12 @@ void SheetDataContext::onEndElement() maCurrCell.mnCellType = XML_TOKEN_INVALID; } } + if( maCurrCell.mnSharedId >= 0 ) + { + Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY_THROW ); + ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress ); + getSharedFormulas().setSharedFormulaCell( aContext, maCurrCell.mnSharedId ); + } // store the cell formatting data setCellFormat( maCurrCell ); |