summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2012-02-10 01:58:15 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2012-02-10 01:59:26 +0900
commite7e0455b0285f60ba999a0a6a831f3be271f5a37 (patch)
tree612248965d3b28720ae47d93c2ddf2dcd017e30e /sc/qa/unit/ucalc.cxx
parentef09cbf45347f5f1ea34f35acedeea5aa3a7f6f6 (diff)
Prefer equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("...")) to equalsAscii("...")
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index a7bfe2cef5b4..37a8ee71193a 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -295,11 +295,11 @@ void Test::testInput()
m_pDoc->SetString(0, 0, 0, numstr);
m_pDoc->GetString(0, 0, 0, test);
- bool bTest = test.equalsAscii("10.5");
+ bool bTest = test.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("10.5"));
CPPUNIT_ASSERT_MESSAGE("String number should have the first apostrophe stripped.", bTest);
m_pDoc->SetString(0, 0, 0, str);
m_pDoc->GetString(0, 0, 0, test);
- bTest = test.equalsAscii("'apple'");
+ bTest = test.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("'apple'"));
CPPUNIT_ASSERT_MESSAGE("Text content should have retained the first apostrophe.", bTest);
m_pDoc->DeleteTab(0);
@@ -1832,7 +1832,7 @@ void Test::testPivotTableNamedSource()
m_pDoc->MoveTab(1, 0);
rtl::OUString aTabName;
m_pDoc->GetName(0, aTabName);
- CPPUNIT_ASSERT_MESSAGE("Wrong sheet name.", aTabName.equalsAscii("Table"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong sheet name.", aTabName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Table")));
CPPUNIT_ASSERT_MESSAGE("Pivot table output is on the wrong sheet!",
pDPObj->GetOutRange().aStart.Tab() == 0);
@@ -1915,7 +1915,7 @@ void Test::testSheetMove()
CPPUNIT_ASSERT_MESSAGE("copied sheet should also have all rows visible as the original.", !bHidden && nRow1 == 0 && nRow2 == MAXROW);
rtl::OUString aName;
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_MESSAGE("sheets should have changed places", aName.equalsAscii("TestTab1"));
+ CPPUNIT_ASSERT_MESSAGE("sheets should have changed places", aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TestTab1")));
m_pDoc->SetRowHidden(5, 10, 0, true);
bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2);
@@ -1935,7 +1935,7 @@ void Test::testSheetMove()
bHidden = m_pDoc->RowHidden(11, 1, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("rows 11 - maxrow should be visible", !bHidden && nRow1 == 11 && nRow2 == MAXROW);
m_pDoc->GetName(0, aName);
- CPPUNIT_ASSERT_MESSAGE("sheets should have changed places", aName.equalsAscii("TestTab2"));
+ CPPUNIT_ASSERT_MESSAGE("sheets should have changed places", aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TestTab2")));
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
}
@@ -2185,9 +2185,9 @@ void testExtRefFuncT(ScDocument* pDoc, ScDocument* pExtDoc)
pDoc->CalcAll();
rtl::OUString aRes = pDoc->GetString(0, 0, 0);
- CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.equalsAscii("1.2"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("1.2")));
aRes = pDoc->GetString(0, 1, 0);
- CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.equalsAscii("Foo"));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Foo")));
aRes = pDoc->GetString(0, 2, 0);
CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.isEmpty());
}
@@ -2959,22 +2959,22 @@ void Test::testToggleRefFlag()
// column relative / row relative -> column absolute / row absolute
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAscii("=$B$100"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("=$B$100")));
// column absolute / row absolute -> column relative / row absolute
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAscii("=B$100"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("=B$100")));
// column relative / row absolute -> column absolute / row relative
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAscii("=$B100"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("=$B100")));
// column absolute / row relative -> column relative / row relative
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAscii("=B100"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("=B100")));
}
{
@@ -2990,22 +2990,22 @@ void Test::testToggleRefFlag()
// column absolute / row absolute -> column relative / row absolute
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAscii("=R2C[-3]"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("=R2C[-3]")));
// column relative / row absolute - > column absolute / row relative
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAscii("=R[-4]C1"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("=R[-4]C1")));
// column absolute / row relative -> column relative / row relative
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAscii("=R[-4]C[-3]"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("=R[-4]C[-3]")));
// column relative / row relative -> column absolute / row absolute
aFinder.ToggleRel(0, aFormula.getLength());
aFormula = aFinder.GetText();
- CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAscii("=R2C1"));
+ CPPUNIT_ASSERT_MESSAGE("Wrong conversion.", aFormula.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("=R2C1")));
}
// TODO: Add more test cases esp. for 3D references, Excel A1 syntax, and
@@ -3186,13 +3186,13 @@ void Test::testCopyPaste()
m_pDoc->GetValue(1,1,1, aValue);
CPPUNIT_ASSERT_MESSAGE("after undo formula should return nothing", aValue == 0);
m_pDoc->GetString(2,1,1, aString);
- CPPUNIT_ASSERT_MESSAGE("after undo string should be removed", aString.equalsAscii(""));
+ CPPUNIT_ASSERT_MESSAGE("after undo string should be removed", aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("")));
pUndo->Redo();
m_pDoc->GetValue(1,1,1, aValue);
CPPUNIT_ASSERT_MESSAGE("formula should return 2 after redo", aValue == 2);
m_pDoc->GetString(2,1,1, aString);
- CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString.equalsAscii("test"));
+ CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("test")));
m_pDoc->GetFormula(1,1,1, aString);
CPPUNIT_ASSERT_MESSAGE("Formula should be correct again", aString == aFormulaString);