diff options
author | Benjamin Ni <benjaminniri@hotmail.com> | 2015-07-06 17:35:27 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-06 17:38:08 +0200 |
commit | 6a01844a9f504c40758daa570724f1983ab1be79 (patch) | |
tree | 41c3b3f0315d666e252918a46810d37de5296871 /sc | |
parent | 1745af7d0a4157ce370d5ef2243f766bd28b6155 (diff) |
tdf#92547 - incorrect input values shown in formula wizard
Change-Id: I55dd98b1613376c8e1c83af8ffdc66a58e022cb1
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/simpleformulacalc.hxx | 1 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/simpleformulacalc.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/formdlg/formula.cxx | 2 |
4 files changed, 13 insertions, 1 deletions
diff --git a/sc/inc/simpleformulacalc.hxx b/sc/inc/simpleformulacalc.hxx index b70146851c93..340c9d8b958a 100644 --- a/sc/inc/simpleformulacalc.hxx +++ b/sc/inc/simpleformulacalc.hxx @@ -41,6 +41,7 @@ public: void Calculate(); bool IsValue(); + bool IsMatrix(); sal_uInt16 GetErrCode(); double GetValue(); svl::SharedString GetString(); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 190f522023cc..7c8171cab93e 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -6483,6 +6483,12 @@ void Test::testFormulaWizardSubformula() if ( aFCell.GetErrCode() == 0 ) CPPUNIT_ASSERT_EQUAL( OUString("{1, #DIV/0!, #NAME!}"), aFCell.GetString().getString() ); + m_pDoc->SetString(ScAddress(0,1,0), "=NA()"); // B0 + m_pDoc->SetString(ScAddress(1,1,0), "2"); // B1 + m_pDoc->SetString(ScAddress(2,1,0), "=1+2"); // B2 + if ( aFCell.GetErrCode() == 0 ) + CPPUNIT_ASSERT_EQUAL(OUString("{#N/A, 2, 3}"), aFCell.GetString().getString()); + m_pDoc->DeleteTab(0); } diff --git a/sc/source/core/data/simpleformulacalc.cxx b/sc/source/core/data/simpleformulacalc.cxx index 5a08e68a3a9c..d35966768bbe 100644 --- a/sc/source/core/data/simpleformulacalc.cxx +++ b/sc/source/core/data/simpleformulacalc.cxx @@ -70,6 +70,11 @@ bool ScSimpleFormulaCalculator::IsValue() return maResult.IsValue(); } +bool ScSimpleFormulaCalculator::IsMatrix() +{ + return bIsMatrix; +} + sal_uInt16 ScSimpleFormulaCalculator::GetErrCode() { Calculate(); diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 23023b554982..41606193c66a 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -330,7 +330,7 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult } sal_uInt16 nErrCode = pFCell->GetErrCode(); - if ( nErrCode == 0 ) + if ( nErrCode == 0 || pFCell->IsMatrix() ) { SvNumberFormatter& aFormatter = *(pDoc->GetFormatTable()); Color* pColor; |