diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-12-11 15:46:59 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-12-11 15:57:10 -0500 |
commit | be1b35346d2870033b1156ee1e307bcf66d0fd23 (patch) | |
tree | e55ca836951341742f85f421a1b04b750b797932 /sc/qa | |
parent | 71b4551ab80bd4f420b6284379bb9174fc93382c (diff) |
fdo#58149: Recalculate HYPERLINK formula cells on load.
The current implementation of HYPERLINK relies on its result being
1x2 matrix while only the first element is displayed visibly. The
second element stores the URL which is only used when querying for
the URL (tooltip or launch URL event).
Starting with 4.0 we load cached formula results to avoid full
recalculation on load. That unfortuntely ended up breaking the
HYPERLINK because the result was a simple string value rather than
a matrix; hence the need to recalculate it on load.
But unlike volatile formula cells, cells with HYPERLINK don't need
to be recalculated on every cell input change; only once when the file
is loaded.
P.S. This commit also reverses the logic of bNoProgressBar flag for
CalcFormulaTree(), to make it easier for human brain to process what
it means.
Change-Id: I7a24d96d225910b88071a8fe6320f59bf7a47163
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 250940016321..842a13cc19ff 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -1060,7 +1060,7 @@ void Test::testSheetsFunc() m_pDoc->InsertTab (SC_TAB_APPEND, aTabName1)); m_pDoc->SetString(0, 0, 0, OUString("=SHEETS()")); - m_pDoc->CalcFormulaTree(false, true); + m_pDoc->CalcFormulaTree(false, false); double original; m_pDoc->GetValue(0, 0, 0, original); @@ -1100,14 +1100,14 @@ void Test::testVolatileFunc() val = 0; m_pDoc->SetValue(0, 0, 0, val); - m_pDoc->CalcFormulaTree(false, true); + m_pDoc->CalcFormulaTree(false, false); double zero; m_pDoc->GetValue(0, 1, 0, zero); CPPUNIT_ASSERT_MESSAGE("Result should equal the 3rd parameter of IF, which is zero.", zero == 0.0); val = 1; m_pDoc->SetValue(0, 0, 0, val); - m_pDoc->CalcFormulaTree(false, true); + m_pDoc->CalcFormulaTree(false, false); double now2; m_pDoc->GetValue(0, 1, 0, now2); CPPUNIT_ASSERT_MESSAGE("Result should be the value of NOW() again.", (now2 - now1) >= 0.0); @@ -1231,7 +1231,7 @@ void Test::testFuncParam() // First, the normal case, with no missing parameters. m_pDoc->SetString(0, 0, 0, OUString("=AVERAGE(1;2;3)")); - m_pDoc->CalcFormulaTree(false, true); + m_pDoc->CalcFormulaTree(false, false); double val; m_pDoc->GetValue(0, 0, 0, val); CPPUNIT_ASSERT_MESSAGE("incorrect result", val == 2); @@ -1239,7 +1239,7 @@ void Test::testFuncParam() // Now function with missing parameters. Missing values should be treated // as zeros. m_pDoc->SetString(0, 0, 0, OUString("=AVERAGE(1;;;)")); - m_pDoc->CalcFormulaTree(false, true); + m_pDoc->CalcFormulaTree(false, false); m_pDoc->GetValue(0, 0, 0, val); CPPUNIT_ASSERT_MESSAGE("incorrect result", val == 0.25); |