summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-21 15:53:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-01-21 16:01:07 +0000
commit523ad9696c9135a29393a0c4d147ab206b6de4f5 (patch)
treefe30ff35cc11890a2345d75495c455f792a4bf56 /sc
parent7713dfc9b50b88cf2548d49e65b099a6a81e9d65 (diff)
Fix bogus mass-conversion equalsAsciiL -> startsWith
3af99e4d59d89c343965a928681a30f36b1007d2 "convert equalsAsciiL calls to startsWith calls" should rather have converted to oprator ==. (cherry picked from commit a3f32769fc4bb23c64168b412dd10ec769a3854d) Conflicts: sc/source/ui/unoobj/nameuno.cxx sc/source/ui/unoobj/styleuno.cxx sfx2/source/appl/sfxhelp.cxx stoc/source/security/permissions.cxx sw/source/core/unocore/unocrsrhelper.cxx (None of those bogus startsWith calls seem problematic enough to warrant backporting also to libreoffice-4-2-0.) Change-Id: Id4a8836c5d6d570e54661c40be7214632e202b21 Reviewed-on: https://gerrit.libreoffice.org/7578 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc.cxx10
-rw-r--r--sc/source/core/tool/appoptio.cxx2
-rw-r--r--sc/source/ui/dbgui/foptmgr.cxx2
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx2
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx2
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx4
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx6
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx6
8 files changed, 17 insertions, 17 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index d6320ecaff2a..e993a9b8e385 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3340,7 +3340,7 @@ void Test::testCopyPaste()
fValue = m_pDoc->GetValue(ScAddress(1,1,1));
ASSERT_DOUBLES_EQUAL_MESSAGE("formula should return 2 after redo", fValue, 2);
aString = m_pDoc->GetString(2, 1, 1);
- CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString.startsWith("test"));
+ CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString == "test");
m_pDoc->GetFormula(1,1,1, aString);
CPPUNIT_ASSERT_MESSAGE("Formula should be correct again", aString == aFormulaString);
@@ -3440,13 +3440,13 @@ void Test::testCopyPasteTranspose()
//check cell content after transposed copy/paste
OUString aString = m_pDoc->GetString(3, 3, 1);
- CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.D4 should contain: test", aString.startsWith("test"));
+ CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.D4 should contain: test", aString == "test");
double fValue = m_pDoc->GetValue(ScAddress(3,1,1));
ASSERT_DOUBLES_EQUAL_MESSAGE("transposed copied cell should return 1", fValue, 1);
fValue = m_pDoc->GetValue(ScAddress(3,2,1));
ASSERT_DOUBLES_EQUAL_MESSAGE("transposed copied formula should return 2", fValue, 2);
m_pDoc->GetFormula(3, 2, 1, aString);
- CPPUNIT_ASSERT_MESSAGE("transposed formula should point on Sheet2.D2", aString.startsWith("=D2+1"));
+ CPPUNIT_ASSERT_MESSAGE("transposed formula should point on Sheet2.D2", aString == "=D2+1");
// check notes after transposed copy/paste
CPPUNIT_ASSERT_MESSAGE("There should be a note on Sheet2.D2", m_pDoc->HasNote(ScAddress(3, 1, 1)));
@@ -3505,9 +3505,9 @@ void Test::testMoveBlock()
//check cell content
OUString aString = m_pDoc->GetString(3, 0, 0);
- CPPUNIT_ASSERT_MESSAGE("Cell D1 should contain: test", aString.startsWith("test"));
+ CPPUNIT_ASSERT_MESSAGE("Cell D1 should contain: test", aString == "test");
m_pDoc->GetFormula(2, 0, 0, aString);
- CPPUNIT_ASSERT_MESSAGE("Cell C1 should contain an updated formula", aString.startsWith("=B1+1"));
+ CPPUNIT_ASSERT_MESSAGE("Cell C1 should contain an updated formula", aString == "=B1+1");
double fValue = m_pDoc->GetValue(aAddrB1);
ASSERT_DOUBLES_EQUAL_MESSAGE("Cell B1 should contain 1", fValue, 1);
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index 7479c45705d3..39cada0f106b 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -176,7 +176,7 @@ static void lcl_SetSortList( const Any& rValue )
// if setting is "default", keep default values from ScUserList ctor
//! mark "default" in a safe way
- sal_Bool bDefault = ( nCount == 1 && pArray[0].startsWith( "NULL" ) );
+ sal_Bool bDefault = ( nCount == 1 && pArray[0] == "NULL" );
if (!bDefault)
{
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index bdf57025a2d6..3471246db22d 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -159,7 +159,7 @@ void ScFilterOptionsMgr::Init()
}
}
- if ( !theDbName.startsWith(STR_DB_LOCAL_NONAME) )
+ if ( theDbName != STR_DB_LOCAL_NONAME )
{
theDbArea.append(" (");
theDbArea.append(theDbName).append(')');
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 13588ff0c523..13f42cabf304 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -199,7 +199,7 @@ bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData )
bool bUndo = pDoc->IsUndoEnabled();
ScDBData* pData = NULL;
- if (rNewData.GetName().startsWith(STR_DB_LOCAL_NONAME))
+ if (rNewData.GetName() == STR_DB_LOCAL_NONAME)
{
ScRange aRange;
rNewData.GetArea(aRange);
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 1057fb562b3b..8754057dc893 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1796,7 +1796,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
Reference< beans::XPropertySet > xSeqProp( xLS->getValues(), uno::UNO_QUERY );
OUString aRole;
if( xSeqProp.is() && (xSeqProp->getPropertyValue("Role") >>= aRole) &&
- aRole.startsWith("categories") )
+ aRole == "categories" )
bThisIsCategories = bHasCategories = true;
}
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index ef920d230295..c67e577d6156 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -430,8 +430,8 @@ OUString SAL_CALL ScNamedRangeObj::getImplementationName() throw(uno::RuntimeExc
sal_Bool SAL_CALL ScNamedRangeObj::supportsService( const OUString& rServiceName )
throw(uno::RuntimeException)
{
- return rServiceName.startsWith( SCNAMEDRANGEOBJ_SERVICE ) ||
- rServiceName.startsWith( SCLINKTARGET_SERVICE );
+ return rServiceName == SCNAMEDRANGEOBJ_SERVICE ||
+ rServiceName == SCLINKTARGET_SERVICE;
}
uno::Sequence<OUString> SAL_CALL ScNamedRangeObj::getSupportedServiceNames()
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 82cd940027c6..52733b9175a9 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -1842,7 +1842,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName )
SolarMutexGuard aGuard;
uno::Any aAny;
- if ( aPropertyName.startsWith( SC_UNONAME_DISPNAME ) ) // read-only
+ if ( aPropertyName == SC_UNONAME_DISPNAME ) // read-only
{
// core always has the display name
SfxStyleSheetBase* pStyle = GetStyle_Impl();
@@ -1987,8 +1987,8 @@ sal_Bool SAL_CALL ScStyleObj::supportsService( const OUString& rServiceName )
throw(uno::RuntimeException)
{
bool bPage = ( eFamily == SFX_STYLE_FAMILY_PAGE );
- return rServiceName.startsWith( SCSTYLE_SERVICE ) ||
- ( bPage ? rServiceName.startsWith( SCPAGESTYLE_SERVICE ) : rServiceName.startsWith( SCCELLSTYLE_SERVICE ) );
+ return rServiceName == SCSTYLE_SERVICE ||
+ ( bPage ? rServiceName == SCPAGESTYLE_SERVICE : rServiceName == SCCELLSTYLE_SERVICE );
}
uno::Sequence<OUString> SAL_CALL ScStyleObj::getSupportedServiceNames()
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 0dbaef67a9cf..db401bd118f2 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -151,7 +151,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException)
aArgs[1].Value >>= aFilterName;
}
- if (aFilterName.startsWith("Text - txt - csv (StarCalc)")) {
+ if (aFilterName == "Text - txt - csv (StarCalc)") {
aFileFormat = excel::XlFileFormat::xlCSV; //xlFileFormat.
}
@@ -179,7 +179,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException)
aFileFormat = excel::XlFileFormat::xlExcel9795;
}
- if (aFilterName.startsWith("HTML (StarCalc)")) {
+ if (aFilterName == "HTML (StarCalc)") {
aFileFormat = excel::XlFileFormat::xlHtml;
}
@@ -187,7 +187,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException)
aFileFormat = excel::XlFileFormat::xlTemplate;
}
- if (aFilterName.startsWith("StarOffice XML (Calc)")) {
+ if (aFilterName == "StarOffice XML (Calc)") {
aFileFormat = excel::XlFileFormat::xlWorkbookNormal;
}
if ( aFilterName == "calc8" ) {