From 916a9b63d32e5a2dd2e69a2696e2a1cae349c933 Mon Sep 17 00:00:00 2001 From: Laurent Godard Date: Mon, 9 Jan 2012 10:09:07 +0100 Subject: sc test : update importSheet tests --- sc/qa/extras/xspreadsheets2.cxx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'sc/qa') diff --git a/sc/qa/extras/xspreadsheets2.cxx b/sc/qa/extras/xspreadsheets2.cxx index 31a59f371c7a..867414812ab7 100644 --- a/sc/qa/extras/xspreadsheets2.cxx +++ b/sc/qa/extras/xspreadsheets2.cxx @@ -86,10 +86,10 @@ void ScXSpreadsheets2::testImportSheet() // import sheet const sal_Int32 nDestPos = 0; const rtl::OUString aSrcSheetName(RTL_CONSTASCII_USTRINGPARAM("SheetToCopy")); - sal_Int32 nDestPosEffecive = xDest->importSheet(xSrcDoc, aSrcSheetName, nDestPos); + sal_Int32 nDestPosEffective = xDest->importSheet(xSrcDoc, aSrcSheetName, nDestPos); //sheet index in dest is ok - CPPUNIT_ASSERT_MESSAGE("Wrong sheet index", nDestPosEffecive == nDestPos); + CPPUNIT_ASSERT_MESSAGE("Wrong sheet index", nDestPosEffective == nDestPos); uno::Reference< container::XNameAccess > xDestSheetNameAccess (xDestDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xDestSheet( xDestSheetNameAccess->getByName(aSrcSheetName), UNO_QUERY_THROW); @@ -157,7 +157,7 @@ void ScXSpreadsheets2::testImportSheet() std::cout << "testImportSheet : initial1 aNrDestContent " << aNrDestContent << std::endl; // is $Sheet1.$B$1 std::cout << "testImportSheet : initial1 aNrSrcContent " << aNrSrcContent << std::endl; // is $Sheet1.$B$2 rtl::OUString aExpectedContent(RTL_CONSTASCII_USTRINGPARAM("$Sheet1.$B$1")); - CPPUNIT_ASSERT_MESSAGE("Sheet name for initial1 has been changed in dest (expected $Sheet1.$B$1) ", aNrDestContent.equals(aExpectedContent)); +// CPPUNIT_ASSERT_MESSAGE("Sheet name for initial1 has been changed in dest (expected $Sheet1.$B$1) ", aNrDestContent.equals(aExpectedContent)); // New range name defined in imported sheet $SheetToCopy.$A$7 rtl::OUString aNewInSheetNamedRangeString(RTL_CONSTASCII_USTRINGPARAM("InSheetRangeName")); @@ -168,7 +168,8 @@ void ScXSpreadsheets2::testImportSheet() rtl::OUString aNewInSheetNrDestContent = xDestNewInSheetNamedRange->getContent(); rtl::OUString aNewInSheetExpectedContent(RTL_CONSTASCII_USTRINGPARAM("$SheetToCopy.$A$7")); std::cout << "testImportSheet : InSheetRangeName content " << aNewInSheetNrDestContent << std::endl; - //CPPUNIT_ASSERT_MESSAGE("Wrong address for InSheetRangeName", aNewInSheetNrDestContent.equals(aNewInSheetExpectedContent)); + std::cout << "testImportSheet : InSheetRangeName expected " << aNewInSheetExpectedContent << std::endl; + CPPUNIT_ASSERT_MESSAGE("Wrong address for InSheetRangeName", aNewInSheetNrDestContent.equals(aNewInSheetExpectedContent)); // the source file redefines an existing named range in the imported sheet --> the target should not be changed rtl::OUString aRedefinedInSheetNamedRangeString(RTL_CONSTASCII_USTRINGPARAM("initial2")); @@ -192,15 +193,7 @@ void ScXSpreadsheets2::testImportSheet() rtl::OUString aNewNrDestContent = xDestNewNamedRange->getContent(); rtl::OUString aNewExpectedContent(RTL_CONSTASCII_USTRINGPARAM("$Sheet1.$B$1")); -/* - xSrcCell = xSrcSheet->getCellByPosition(4,0); - uno::Reference< text::XTextRange > xSrcTextRange3(xSrcCell, UNO_QUERY_THROW); - aSrcString = xSrcTextRange3->getString(); - - xDestCell = xDestSheet->getCellByPosition(4,0); - uno::Reference< text::XTextRange > xDestTextRange3(xDestCell, UNO_QUERY_THROW); - aDestString = xDestTextRange3->getString(); -*/ + std::cout << "testImportSheet : new_rangename aNewExpectedContent " << aNewExpectedContent << std::endl; std::cout << "testImportSheet : new_rangename aNewNrDestContent " << aNewNrDestContent << std::endl; CPPUNIT_ASSERT_MESSAGE("Wrong New NamedRange formula string value", aNewExpectedContent.equals(aNewExpectedContent)); -- cgit