From 4944bd81ed056b5002ea36718ab4e953ba77c171 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 26 Aug 2015 18:07:10 +0200 Subject: Revert "do not parse range fragments as valid ranges" This reverts commit ed6209f572bad38bdb066be668163fe8acf52056, plus follow-up 18a2a642c4a8848e2a2cb0df29c6463db8428ef9 "unit test that parsing range fragments should fail." Breaks CppunitTest_sc_subsequent_filters_test Change-Id: Ic4663d79bf4bc017094bc37779f74f30630d79bd --- sc/qa/unit/ucalc_formula.cxx | 33 --------------------------------- sc/source/core/tool/address.cxx | 2 +- 2 files changed, 1 insertion(+), 34 deletions(-) (limited to 'sc') diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 0e379f125edc..8a5d76622c79 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -321,39 +321,6 @@ void Test::testFormulaParseReference() CPPUNIT_ASSERT_MESSAGE("This is not an external address.", !aExtInfo.mbExternal); ScRange aRange; - - aRange.aStart.SetTab(0); - nRes = aRange.Parse(":B", m_pDoc, formula::FormulaGrammar::CONV_OOO); - CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); - - aRange.aStart.SetTab(0); - nRes = aRange.Parse("B:", m_pDoc, formula::FormulaGrammar::CONV_OOO); - CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); - - aRange.aStart.SetTab(0); - nRes = aRange.Parse(":B2", m_pDoc, formula::FormulaGrammar::CONV_OOO); - CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); - - aRange.aStart.SetTab(0); - nRes = aRange.Parse("B2:", m_pDoc, formula::FormulaGrammar::CONV_OOO); - CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); - - aRange.aStart.SetTab(0); - nRes = aRange.Parse(":2", m_pDoc, formula::FormulaGrammar::CONV_OOO); - CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); - - aRange.aStart.SetTab(0); - nRes = aRange.Parse("2:", m_pDoc, formula::FormulaGrammar::CONV_OOO); - CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); - - aRange.aStart.SetTab(0); - nRes = aRange.Parse(":2B", m_pDoc, formula::FormulaGrammar::CONV_OOO); - CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); - - aRange.aStart.SetTab(0); - nRes = aRange.Parse("2B:", m_pDoc, formula::FormulaGrammar::CONV_OOO); - CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", (nRes & SCA_VALID) == 0); - aRange.aStart.SetTab(0); nRes = aRange.Parse("B:B", m_pDoc, formula::FormulaGrammar::CONV_OOO); CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & SCA_VALID) != 0); diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index da7a195d4917..81e4047ff0d3 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1505,7 +1505,7 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange& rRange, nRes2 |= SCA_COL_ABSOLUTE; } } - if ((nRes1 & SCA_VALID) && (nRes2 & SCA_VALID)) + if (nRes1 && nRes2) { // PutInOrder / Justify sal_uInt16 nMask, nBits1, nBits2; -- cgit