summaryrefslogtreecommitdiff
path: root/sc/source/core/data/formulacell.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/formulacell.cxx')
-rw-r--r--sc/source/core/data/formulacell.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index de5fc6809355..7ca01dbcf1ab 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1299,7 +1299,7 @@ void ScFormulaCell::CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rPr
ScAddress aPreviousCell( aPos );
aPreviousCell.IncRow( -1 );
ScFormulaCell *pPreviousCell = pDocument->GetFormulaCell( aPreviousCell );
- if( pPreviousCell )
+ if (pPreviousCell && pPreviousCell->GetCode()->IsShareable())
{
// Build formula string using the tokens from the previous cell,
// but use the current cell position.
@@ -3827,6 +3827,9 @@ ScFormulaCell::CompareState ScFormulaCell::CompareByTokenArray( ScFormulaCell& r
if ( GetHash() != rOther.GetHash() )
return NotEqual;
+ if (!pCode->IsShareable() || !rOther.pCode->IsShareable())
+ return NotEqual;
+
FormulaToken **pThis = pCode->GetCode();
sal_uInt16 nThisLen = pCode->GetCodeLen();
FormulaToken **pOther = rOther.pCode->GetCode();