diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-11-23 03:41:26 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-11-23 06:25:36 +0100 |
commit | 9e8ae1d56076474e4673a953d8ebd726cb5daa18 (patch) | |
tree | 9fa98ed589c4484bfc2b72a520e7f195f561c0f2 /sc/qa | |
parent | f3c7c1e4ceddc6f778de89c1e75dbb126247c787 (diff) |
remove ScRangeName::findByName
this method was mmisused and is the source for some "bugs"
we don't allow case sensitive storage of range names and therefore it
does not amke sense to search by case sensitive names, use
ScRangeName::findByUpperName instead
Especially the uno implementation did behave wrongly and allowed to
create two names that were identicall for the model
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 6 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index cb99cd12fe20..587b71e2f550 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -341,16 +341,16 @@ void testRangeNameImpl(ScDocument* pDoc) { //check one range data per sheet and one global more detailed //add some more checks here - ScRangeData* pRangeData = pDoc->GetRangeName()->findByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Global1"))); + ScRangeData* pRangeData = pDoc->GetRangeName()->findByUpperName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GLOBAL1"))); CPPUNIT_ASSERT_MESSAGE("range name Global1 not found", pRangeData); double aValue; pDoc->GetValue(1,0,0,aValue); CPPUNIT_ASSERT_MESSAGE("range name Global1 should reference Sheet1.A1", aValue == 1); - pRangeData = pDoc->GetRangeName(0)->findByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local1"))); + pRangeData = pDoc->GetRangeName(0)->findByUpperName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOCAL1"))); CPPUNIT_ASSERT_MESSAGE("range name Sheet1.Local1 not found", pRangeData); pDoc->GetValue(1,2,0,aValue); CPPUNIT_ASSERT_MESSAGE("range name Sheet1.Local1 should reference Sheet1.A3", aValue == 3); - pRangeData = pDoc->GetRangeName(1)->findByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local2"))); + pRangeData = pDoc->GetRangeName(1)->findByUpperName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOCAL2"))); CPPUNIT_ASSERT_MESSAGE("range name Sheet2.Local2 not found", pRangeData); pDoc->GetValue(1,1,1,aValue); CPPUNIT_ASSERT_MESSAGE("range name Sheet2.Local2 should reference Sheet2.A2", aValue == 7); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index d5111b221e13..9b0cbcc7962a 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2709,12 +2709,12 @@ void Test::testCopyPaste() CPPUNIT_ASSERT_MESSAGE("copied value should be 1", aValue == 1); //chack local range name after copying - pLocal1 = m_pDoc->GetRangeName(1)->findByName(OUString(RTL_CONSTASCII_USTRINGPARAM("local1"))); + pLocal1 = m_pDoc->GetRangeName(1)->findByUpperName(OUString(RTL_CONSTASCII_USTRINGPARAM("LOCAL1"))); CPPUNIT_ASSERT_MESSAGE("local range name 1 should be copied", pLocal1); ScRange aRangeLocal1; pLocal1->IsValidReference(aRangeLocal1); CPPUNIT_ASSERT_MESSAGE("local range 1 should still point to Sheet1.A1",aRangeLocal1 == ScRange(0,0,0,0,0,0)); - pLocal2 = m_pDoc->GetRangeName(1)->findByName(OUString(RTL_CONSTASCII_USTRINGPARAM("local2"))); + pLocal2 = m_pDoc->GetRangeName(1)->findByUpperName(OUString(RTL_CONSTASCII_USTRINGPARAM("LOCAL2"))); CPPUNIT_ASSERT_MESSAGE("local2 should not be copied", pLocal2 == NULL); |