[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Tue Dec 3 13:11:37 PST 2013


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

New commits:
commit bfd1909c87d0d645f1bbb74a142172ecc15100e8
Author: Eike Rathke <erack at 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

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 8c3471e..c15710f 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -989,6 +989,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;
@@ -1039,6 +1044,8 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress )
         SetDirtyVar();
         pDocument->PutInFormulaTree(this);
     }
+    else if (bWasInFormulaTree)
+        pDocument->PutInFormulaTree(this);
 }
 
 


More information about the Libreoffice-commits mailing list