summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-07-03 21:28:46 +0200
committerEike Rathke <erack@redhat.com>2012-07-03 21:30:53 +0200
commitb6dcf00472b8f9573ff23ae8cadadeaad58ea4bb (patch)
treea04947fa7a339da069e828ed6f68e7fcf1c67f72
parent3286e849e5b5f8809e92219bdf07e737c81cf42c (diff)
do not attempt to compile running formula cell (fdo#51601 related)
2fb377c19f8ae38e7ec649af1343bbd64b70a16b introduced compilation of a formula cell while it is interpreted, ignoring the comment just above why that does NOT work ... This removes the portion that was responsible for the crash. Though import changed and 3-6 did not crash on opening the testcase documents anymore, the questionable code is still wrong and therefor removed.
-rw-r--r--sc/source/core/data/cell.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 5fbcbb9f42af..2a3d80717248 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1444,7 +1444,9 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
// #i11719# no UPN and no error and no token code but result string present
// => interpretation of this cell during name-compilation and unknown names
// => can't exchange underlying code array in CompileTokenArray() /
- // Compile() because interpreter's token iterator would crash.
+ // Compile() because interpreter's token iterator would crash or pCode
+ // would be deleted twice if this cell was interpreted during
+ // compilation.
// This should only be a temporary condition and, since we set an
// error, if ran into it again we'd bump into the dirty-clearing
// condition further down.
@@ -1453,12 +1455,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
pCode->SetCodeError( errNoCode );
// This is worth an assertion; if encountered in daily work
// documents we might need another solution. Or just confirm correctness.
- OSL_FAIL( "ScFormulaCell::Interpret: no UPN, no error, no token, but string -> Try compiling it." );
- // Force Compilation
- rtl::OUString aFormula = aResult.GetHybridFormula();
- aResult.SetHybridFormula( rtl::OUString() );
- Compile( aFormula );
- InterpretTail( eTailParam );
+ OSL_FAIL( "ScFormulaCell::Interpret: no UPN, no error, no token, but hybrid formula string" );
return;
}
CompileTokenArray();