summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@novell.com>2011-07-19 13:24:03 +0200
committerDavid Tardon <dtardon@redhat.com>2011-07-19 14:53:45 +0200
commita53c10a5b3c3c30dbfff580d9af4953e4c0a4d3d (patch)
treebdecf98de5b32845f93e8f3ec33f3112199c6c08
parente0f8c48ae79a5a7fbed156f2a30dc5095c0d56c1 (diff)
related fdo#39023: correct import of shared formulas
Signed-off-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Signed-off-by: Katarina Machalkova <kmachalkova@suse.cz> Signed-off-by: David Tardon <dtardon@redhat.com>
-rw-r--r--oox/source/xls/sheetdatacontext.cxx9
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 );