diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-02-10 01:58:15 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-02-10 01:59:26 +0900 |
commit | e7e0455b0285f60ba999a0a6a831f3be271f5a37 (patch) | |
tree | 612248965d3b28720ae47d93c2ddf2dcd017e30e /sc | |
parent | ef09cbf45347f5f1ea34f35acedeea5aa3a7f6f6 (diff) |
Prefer equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("...")) to equalsAscii("...")
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 34 | ||||
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 20 | ||||
-rw-r--r-- | sc/source/filter/excel/xehelper.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/excel/xiescher.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun5.cxx | 2 |
7 files changed, 34 insertions, 34 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); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index ac4886cb6e3e..e1eb8bddff0e 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2330,11 +2330,11 @@ void ScInterpreter::ScCellExternal() ScCellKeywordTranslator::transKeyword(aInfoType, ScGlobal::GetLocale(), ocCell); ScExternalRefManager* pRefMgr = pDok->GetExternalRefManager(); - if (aInfoType.equalsAscii("COL")) + if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("COL"))) PushInt(nCol + 1); - else if (aInfoType.equalsAscii("ROW")) + else if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ROW"))) PushInt(nRow + 1); - else if (aInfoType.equalsAscii("SHEET")) + else if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SHEET"))) { // For SHEET, No idea what number we should set, but let's always set // 1 if the external sheet exists, no matter what sheet. Excel does @@ -2344,7 +2344,7 @@ void ScInterpreter::ScCellExternal() else SetError(errNoName); } - else if (aInfoType.equalsAscii("ADDRESS")) + else if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ADDRESS"))) { // ODF 1.2 says we need to always display address using the ODF A1 grammar. ScTokenArray aArray; @@ -2355,7 +2355,7 @@ void ScInterpreter::ScCellExternal() aComp.CreateStringFromTokenArray(aStr); PushString(aStr); } - else if (aInfoType.equalsAscii("FILENAME")) + else if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FILENAME"))) { // 'file URI'#$SheetName @@ -2374,7 +2374,7 @@ void ScInterpreter::ScCellExternal() aBuf.append(aTabName); PushString(aBuf.makeStringAndClear()); } - else if (aInfoType.equalsAscii("CONTENTS")) + else if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CONTENTS"))) { switch (pToken->GetType()) { @@ -2391,7 +2391,7 @@ void ScInterpreter::ScCellExternal() PushString(ScGlobal::GetEmptyString()); } } - else if (aInfoType.equalsAscii("TYPE")) + else if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TYPE"))) { sal_Unicode c = 'v'; switch (pToken->GetType()) @@ -2407,14 +2407,14 @@ void ScInterpreter::ScCellExternal() } PushString(rtl::OUString(c)); } - else if (aInfoType.equalsAscii("FORMAT")) + else if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FORMAT"))) { String aFmtStr; sal_uLong nFmt = aFmt.mbIsSet ? aFmt.mnIndex : 0; getFormatString(pFormatter, nFmt, aFmtStr); PushString(aFmtStr); } - else if (aInfoType.equalsAscii("COLOR")) + else if (aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("COLOR"))) { // 1 = negative values are colored, otherwise 0 int nVal = 0; @@ -2425,7 +2425,7 @@ void ScInterpreter::ScCellExternal() } PushInt(nVal); } - else if(aInfoType.equalsAscii("PARENTHESES")) + else if(aInfoType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PARENTHESES"))) { // 1 = format string contains a '(' character, otherwise 0 int nVal = 0; diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index c9146b7550dd..3e805feb4919 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -912,13 +912,13 @@ rtl::OUString lclEncodeDosUrl( rtl::OUString aOldUrl = rUrl; aBuf.append(EXC_URLSTART_ENCODED); - if (aOldUrl.getLength() > 2 && aOldUrl.copy(0,2).equalsAscii("\\\\")) + if (aOldUrl.getLength() > 2 && aOldUrl.copy(0,2).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("\\\\"))) { // UNC aBuf.append(EXC_URL_DOSDRIVE).append(sal_Unicode('@')); aOldUrl = aOldUrl.copy(2); } - else if (aOldUrl.getLength() > 2 && aOldUrl.copy(1,2).equalsAscii(":\\")) + else if (aOldUrl.getLength() > 2 && aOldUrl.copy(1,2).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(":\\"))) { // drive letter sal_Unicode cThisDrive = rBase.isEmpty() ? ' ' : rBase.getStr()[0]; @@ -935,7 +935,7 @@ rtl::OUString lclEncodeDosUrl( sal_Int32 nPos = -1; while((nPos = aOldUrl.indexOf('\\')) != -1) { - if (aOldUrl.copy(0,2).equalsAscii("..")) + if (aOldUrl.copy(0,2).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".."))) // parent dir (NOTE: the MS-XLS spec doesn't mention this, and // Excel seems confused by this token). aBuf.append(EXC_URL_PARENTDIR); diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index d953fc1bcbba..ee1a37eef178 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -2833,7 +2833,7 @@ void XclImpPictureObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal if( (rStrm.GetNextRecId() == EXC_ID3_IMGDATA) && rStrm.StartNextRecord() ) { // page background is stored as hidden picture with name "__BkgndObj" - if (IsHidden() && (GetObjName().equalsAscii("__BkgndObj"))) + if (IsHidden() && (GetObjName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("__BkgndObj")))) GetPageSettings().ReadImgData( rStrm ); else maGraphic = XclImpDrawing::ReadImgData( GetRoot(), rStrm ); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index fa102dd7d00c..5169b0144f14 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1405,7 +1405,7 @@ void ScInputHandler::PasteManualTip() // (wenn wir mal Matrix-Konstanten haben, kann das geaendert werden) sal_Int32 nTipLen = aManualTip.getLength(); - if ( nTipLen && ( nTipLen < 3 || !aManualTip.copy( nTipLen-3 ).equalsAscii("...") ) ) + if ( nTipLen && ( nTipLen < 3 || !aManualTip.copy( nTipLen-3 ).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("...")) ) ) { DataChanging(); // kann nicht neu sein diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 4c852db3d0ad..1fbc0678533d 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1291,7 +1291,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec nSelPos = pFilterBox->GetEntryPos(rQueryStr); } } - else if (rEntry.eOp == SC_TOPVAL && rQueryStr.equalsAscii("10")) + else if (rEntry.eOp == SC_TOPVAL && rQueryStr.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("10"))) nSelPos = SC_AUTOFILTER_TOP10; else nSelPos = SC_AUTOFILTER_CUSTOM; diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 08dc06228a2e..fa305a570ab7 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -698,7 +698,7 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r if (aStrs.size() > 3) pExtra = &aStrs[3]; - if (pExtra && pExtra->equalsAscii("calc:extref")) + if (pExtra && pExtra->equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("calc:extref"))) { // Paste this as an external reference. Note that paste link always // uses Calc A1 syntax even when another formula syntax is specified |