diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-19 15:58:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-20 10:07:31 +0200 |
commit | 3af99e4d59d89c343965a928681a30f36b1007d2 (patch) | |
tree | 2389765131bdb92817e98bc922ffecbf0184d69b /sc/source | |
parent | d665e058246631c8a838c3a731bdd0c56be27903 (diff) |
convert equalsAsciiL calls to startsWith calls
Convert code like:
aStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ActiveConnection" ) )
to
aStr.startsWith( "ActiveConnection" )
which compiles down to the same machine code.
Change-Id: Id4b0c5e0f9afe716a468d3afc70374699848dc33
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/appoptio.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/foptmgr.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/nameuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/styleuno.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworkbook.cxx | 6 |
7 files changed, 12 insertions, 14 deletions
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 92612eed480c..7479c45705d3 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -176,8 +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].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "NULL" ) ) ); + sal_Bool bDefault = ( nCount == 1 && pArray[0].startsWith( "NULL" ) ); if (!bDefault) { diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index 5f1e81b8da93..82a9e02117a3 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -159,7 +159,7 @@ void ScFilterOptionsMgr::Init() } } - if ( !theDbName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_DB_LOCAL_NONAME)) ) + if ( !theDbName.startsWith(STR_DB_LOCAL_NONAME) ) { theDbArea.appendAscii(RTL_CONSTASCII_STRINGPARAM(" (")); theDbArea.append(theDbName).append(')'); diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 4dcdc59dc9bc..13588ff0c523 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().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_DB_LOCAL_NONAME))) + if (rNewData.GetName().startsWith(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 88ac86500c06..1057fb562b3b 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.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("categories")) ) + aRole.startsWith("categories") ) bThisIsCategories = bHasCategories = true; } diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index 38936d70ba3c..ef920d230295 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.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SCNAMEDRANGEOBJ_SERVICE ) ) || - rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SCLINKTARGET_SERVICE ) ); + return rServiceName.startsWith( SCNAMEDRANGEOBJ_SERVICE ) || + rServiceName.startsWith( 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 24a74901c3a4..82cd940027c6 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.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_DISPNAME ) ) ) // read-only + if ( aPropertyName.startsWith( SC_UNONAME_DISPNAME ) ) // read-only { // core always has the display name SfxStyleSheetBase* pStyle = GetStyle_Impl(); @@ -1987,9 +1987,8 @@ sal_Bool SAL_CALL ScStyleObj::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { bool bPage = ( eFamily == SFX_STYLE_FAMILY_PAGE ); - return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SCSTYLE_SERVICE ) )|| - rServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM ( bPage ? SCPAGESTYLE_SERVICE : SCCELLSTYLE_SERVICE )); + return rServiceName.startsWith( SCSTYLE_SERVICE ) || + ( bPage ? rServiceName.startsWith( SCPAGESTYLE_SERVICE ) : rServiceName.startsWith( 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 e486087d4139..0dbaef67a9cf 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.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Text - txt - csv (StarCalc)"))) { + if (aFilterName.startsWith("Text - txt - csv (StarCalc)")) { aFileFormat = excel::XlFileFormat::xlCSV; //xlFileFormat. } @@ -179,7 +179,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException) aFileFormat = excel::XlFileFormat::xlExcel9795; } - if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HTML (StarCalc)"))) { + if (aFilterName.startsWith("HTML (StarCalc)")) { aFileFormat = excel::XlFileFormat::xlHtml; } @@ -187,7 +187,7 @@ ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException) aFileFormat = excel::XlFileFormat::xlTemplate; } - if (aFilterName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StarOffice XML (Calc)"))) { + if (aFilterName.startsWith("StarOffice XML (Calc)")) { aFileFormat = excel::XlFileFormat::xlWorkbookNormal; } if ( aFilterName == "calc8" ) { |