sc/source/core/data/formulacell.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 90102d0832b2bc173b09188604aa311f17c19bbe
Author: Eike Rathke <er...@redhat.com>
Date:   Tue Dec 3 22:07:00 2013 +0100

    remove and reinsert formula cell from/to tree during CompileXML
    
    ... to keep the count updated, which actually silences the dbgutil
    warning of ScDocument::RemoveFromFormulaTree() when loading .ods
    
    Change-Id: I8453d688ca673a47fee15c84478262e1da53e408
    (cherry picked from commit bfd1909c87d0d645f1bbb74a142172ecc15100e8)

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 6144c09..1451f02 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -991,6 +991,11 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress )
         return ;
     }
 
+    // Compilation changes RPN count, remove and reinsert to FormulaTree if it
+    // was in to update its count.
+    bool bWasInFormulaTree = pDocument->IsInFormulaTree( this);
+    if (bWasInFormulaTree)
+        pDocument->RemoveFromFormulaTree( this);
     ScCompiler aComp( pDocument, aPos, *pCode);
     aComp.SetGrammar(eTempGrammar);
     OUString aFormula, aFormulaNmsp;
@@ -1041,6 +1046,8 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress )
         SetDirtyVar();
         pDocument->PutInFormulaTree(this);
     }
+    else if (bWasInFormulaTree)
+        pDocument->PutInFormulaTree(this);
 }
 
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to