diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-22 14:24:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-23 12:00:27 +0000 |
commit | c80fe3937b94df56d7f0dedc85ddf11b48b5e8b5 (patch) | |
tree | f51724ae3d3ca35a6b6e12faaba1401927a4beac /sc/qa/unit | |
parent | 8ab1fe71f546dd5f8d3ec8f53a0fb31e24d55adc (diff) |
convert ScMatrixMode to scoped enum
and fix a bug in ScChangeActionContent::SetValueString where it was
passing the grammar as the ScMatrixMode to the ScFormulaCell
constructor.
Change-Id: I7c1a174cdd8365dedc30cff0b26e3079bb8b84f3
Reviewed-on: https://gerrit.libreoffice.org/35552
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 9 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index b7a3be681357..8a0b48508017 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -94,6 +94,11 @@ #include <utility> #include <vector> +static std::ostream& operator<<(std::ostream& os, ScMatrixMode mode) +{ + os << (int) mode; return os; +} + struct TestImpl { ScDocShellRef m_xDocShell; @@ -1955,12 +1960,12 @@ void Test::testMatrixEditable() ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0,2,0)); CPPUNIT_ASSERT(pFC); CPPUNIT_ASSERT_EQUAL_MESSAGE("A3 should be matrix origin.", - MM_FORMULA, static_cast<ScMatrixMode>(pFC->GetMatrixFlag())); + ScMatrixMode::Formula, pFC->GetMatrixFlag()); pFC = m_pDoc->GetFormulaCell(ScAddress(0,3,0)); CPPUNIT_ASSERT(pFC); CPPUNIT_ASSERT_EQUAL_MESSAGE("A4 should be matrix reference.", - MM_REFERENCE, static_cast<ScMatrixMode>(pFC->GetMatrixFlag())); + ScMatrixMode::Reference, pFC->GetMatrixFlag()); // Check to make sure A3:A4 combined is editable. ScEditableTester aTester; diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index c11ecab06628..ea3eea69cc96 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -86,6 +86,11 @@ ScRange getCachedRange(const ScExternalRefCache::TableTypeRef& pCacheTab) } +static std::ostream& operator<<(std::ostream& os, ScMatrixMode mode) +{ + os << (int) mode; return os; +} + void Test::testFormulaCreateStringFromTokens() { // Insert sheets. @@ -3845,7 +3850,7 @@ void Test::testFuncMIN() // Formula cell in C1:C2 should be a 1x2 matrix array. ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(2,0,0)); CPPUNIT_ASSERT(pFC); - CPPUNIT_ASSERT_EQUAL_MESSAGE("This formula should be an array.", MM_FORMULA, static_cast<ScMatrixMode>(pFC->GetMatrixFlag())); + CPPUNIT_ASSERT_EQUAL_MESSAGE("This formula should be an array.", ScMatrixMode::Formula, pFC->GetMatrixFlag()); SCCOL nCols; SCROW nRows; @@ -4392,7 +4397,7 @@ void Test::testFuncLEN() ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0)); CPPUNIT_ASSERT(pFC); CPPUNIT_ASSERT_EQUAL_MESSAGE("This formula should be a matrix origin.", - MM_FORMULA, static_cast<ScMatrixMode>(pFC->GetMatrixFlag())); + ScMatrixMode::Formula, pFC->GetMatrixFlag()); // This should be a 1x3 matrix. SCCOL nCols = -1; |