summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-19 15:58:58 +0200
committerNoel Grandin <noel@peralex.com>2013-11-20 10:07:31 +0200
commit3af99e4d59d89c343965a928681a30f36b1007d2 (patch)
tree2389765131bdb92817e98bc922ffecbf0184d69b /framework
parentd665e058246631c8a838c3a731bdd0c56be27903 (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 'framework')
-rw-r--r--framework/source/fwe/xml/menudocumenthandler.cxx22
-rw-r--r--framework/source/jobs/jobexecutor.cxx8
-rw-r--r--framework/source/services/autorecovery.cxx22
-rw-r--r--framework/source/uielement/newmenucontroller.cxx2
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx2
-rw-r--r--framework/source/uielement/statusbarmerger.cxx40
6 files changed, 48 insertions, 48 deletions
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx
index 212025822712..b8d7a8bc6ed4 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -294,7 +294,7 @@ void SAL_CALL OReadMenuDocumentHandler::endElement( const OUString& aName )
m_xReader->endDocument();
m_xReader.clear();
m_bMenuBarMode = sal_False;
- if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUBAR )))
+ if ( !aName.startsWith( ELEMENT_MENUBAR ))
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menubar expected!";
@@ -442,7 +442,7 @@ void OReadMenuBarHandler::endElement( const OUString& aName )
m_xReader->endDocument();
m_xReader.clear();
m_bMenuMode = sal_False;
- if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU )))
+ if ( !aName.startsWith( ELEMENT_MENU ))
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menu expected!";
@@ -528,7 +528,7 @@ void SAL_CALL OReadMenuHandler::endElement( const OUString& aName )
m_xReader->endDocument();
m_xReader.clear();
m_bMenuPopupMode = sal_False;
- if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUPOPUP )))
+ if ( !aName.startsWith( ELEMENT_MENUPOPUP ))
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menupopup expected!";
@@ -732,7 +732,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName )
m_xReader->endDocument();
m_xReader.clear();
m_bMenuMode = sal_False;
- if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU )))
+ if ( !aName.startsWith( ELEMENT_MENU ))
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menu expected!";
@@ -746,7 +746,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName )
{
if ( m_nNextElementExpected == ELEM_CLOSE_MENUITEM )
{
- if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUITEM )))
+ if ( !aName.startsWith( ELEMENT_MENUITEM ))
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menuitem expected!";
@@ -755,7 +755,7 @@ void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName )
}
else if ( m_nNextElementExpected == ELEM_CLOSE_MENUSEPARATOR )
{
- if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUSEPARATOR )))
+ if ( !aName.startsWith( ELEMENT_MENUSEPARATOR ))
{
OUString aErrorMessage = getErrorLineString();
aErrorMessage += "closing element menuseparator expected!";
@@ -847,8 +847,8 @@ throw ( SAXException, RuntimeException )
ExtractMenuParameters( aProps, aCommandURL, aLabel, aHelpURL, xSubMenu, nType, nItemBits );
if ( xSubMenu.is() )
{
- if ( aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(ADDDIRECT_CMD)) ||
- aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AUTOPILOTMENU_CMD)) )
+ if ( aCommandURL.startsWith(ADDDIRECT_CMD) ||
+ aCommandURL.startsWith(AUTOPILOTMENU_CMD) )
{
WriteMenuItem( aCommandURL, aLabel, aHelpURL, nItemBits );
bSeparator = sal_False;
@@ -862,7 +862,7 @@ throw ( SAXException, RuntimeException )
m_aAttributeType,
aCommandURL );
- if ( !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_PROTOCOL))) )
+ if ( !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL)) )
pListMenu->AddAttribute( OUString( ATTRIBUTE_NS_LABEL ),
m_aAttributeType,
aLabel );
@@ -921,13 +921,13 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons
aHelpURL );
}
- if ( !aLabel.isEmpty() && !aCommandURL.copy( CMD_PROTOCOL_SIZE ).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_PROTOCOL)) )
+ if ( !aLabel.isEmpty() && !aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL) )
{
pList->AddAttribute( OUString( ATTRIBUTE_NS_LABEL ),
m_aAttributeType,
aLabel );
}
- if (( nStyle > 0 ) && !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CMD_PROTOCOL)) ))
+ if (( nStyle > 0 ) && !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL) ))
{
OUString aValue;
MenuStyleItem* pStyle = MenuItemStyles;
diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx
index d0b955cec3c5..dd98699fa94b 100644
--- a/framework/source/jobs/jobexecutor.cxx
+++ b/framework/source/jobs/jobexecutor.cxx
@@ -200,8 +200,8 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
// Special feature: If the events "OnNew" or "OnLoad" occurs - we generate our own event "onDocumentOpened".
if (
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_NEW))) ||
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_LOAD)))
+ (aEvent.EventName.startsWith(EVENT_ON_NEW)) ||
+ (aEvent.EventName.startsWith(EVENT_ON_LOAD))
)
{
if (m_lEvents.find(EVENT_ON_DOCUMENT_OPENED) != m_lEvents.end())
@@ -210,8 +210,8 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
// Special feature: If the events "OnCreate" or "OnLoadFinished" occurs - we generate our own event "onDocumentAdded".
if (
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_CREATE))) ||
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_LOAD_FINISHED)))
+ (aEvent.EventName.startsWith(EVENT_ON_CREATE)) ||
+ (aEvent.EventName.startsWith(EVENT_ON_LOAD_FINISHED))
)
{
if (m_lEvents.find(EVENT_ON_DOCUMENT_ADDED) != m_lEvents.end())
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 6c3944f1cf32..1106f84615b8 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -738,8 +738,8 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent
// new document => put it into the internal list
if (
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_NEW))) ||
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_LOAD)))
+ (aEvent.EventName.startsWith(EVENT_ON_NEW)) ||
+ (aEvent.EventName.startsWith(EVENT_ON_LOAD))
)
{
implts_registerDocument(xDocument);
@@ -755,17 +755,17 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent
for the moment, till this other save requests will be finished.
*/
else if (
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVE))) ||
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEAS))) ||
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVETO)))
+ (aEvent.EventName.startsWith(EVENT_ON_SAVE)) ||
+ (aEvent.EventName.startsWith(EVENT_ON_SAVEAS)) ||
+ (aEvent.EventName.startsWith(EVENT_ON_SAVETO))
)
{
implts_updateDocumentUsedForSavingState(xDocument, SAVE_IN_PROGRESS);
}
// document saved => remove tmp. files - but hold config entries alive!
else if (
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEDONE))) ||
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEASDONE)))
+ (aEvent.EventName.startsWith(EVENT_ON_SAVEDONE)) ||
+ (aEvent.EventName.startsWith(EVENT_ON_SAVEASDONE))
)
{
implts_markDocumentAsSaved(xDocument);
@@ -785,9 +785,9 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent
// But we can reset the state "used for other save requests". Otherwhise
// these documents will never be saved!
else if (
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEFAILED))) ||
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVEASFAILED))) ||
- (aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(EVENT_ON_SAVETOFAILED)))
+ (aEvent.EventName.startsWith(EVENT_ON_SAVEFAILED)) ||
+ (aEvent.EventName.startsWith(EVENT_ON_SAVEASFAILED)) ||
+ (aEvent.EventName.startsWith(EVENT_ON_SAVETOFAILED))
)
{
implts_updateDocumentUsedForSavingState(xDocument, SAVE_FINISHED);
@@ -2885,7 +2885,7 @@ css::frame::FeatureStateEvent AutoRecovery::implst_createFeatureStateEvent(
aEvent.FeatureURL.Complete = AutoRecovery::implst_getJobDescription(eJob);
aEvent.FeatureDescriptor = sEventType;
- if (pInfo && sEventType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(OPERATION_UPDATE)))
+ if (pInfo && sEventType.startsWith(OPERATION_UPDATE))
{
// pack rInfo for transport via UNO
::comphelper::NamedValueCollection aInfo;
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index 63c4976c4b0d..0472218e9359 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -521,7 +521,7 @@ void SAL_CALL NewMenuController::initialize( const Sequence< Any >& aArguments )
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
m_bShowImages = rSettings.GetUseImagesInMenus();
- m_bNewMenu = m_aCommandURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:AddDirect" ) );
+ m_bNewMenu = m_aCommandURL.startsWith( ".uno:AddDirect" );
}
}
}
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 37c3c052d9c1..52b3ed69ebce 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -280,7 +280,7 @@ void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent
OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s",
OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
- if ( aCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_CLEAR_LIST ) ) )
+ if ( aCommand.startsWith( CMD_CLEAR_LIST ) )
SvtHistoryOptions().Clear( ePICKLIST );
else
executeEntry( rEvent.MenuId-1 );
diff --git a/framework/source/uielement/statusbarmerger.cxx b/framework/source/uielement/statusbarmerger.cxx
index b71f612e741a..667929f7cfc6 100644
--- a/framework/source/uielement/statusbarmerger.cxx
+++ b/framework/source/uielement/statusbarmerger.cxx
@@ -61,19 +61,19 @@ static void lcl_ConvertSequenceToValues(
for ( sal_Int32 i = 0; i < rSequence.getLength(); i++ )
{
aPropVal = rSequence[i];
- if ( aPropVal.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGE_STATUSBAR_URL ) ) )
+ if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_URL ) )
aPropVal.Value >>= rItem.aCommandURL;
- else if ( aPropVal.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGE_STATUSBAR_TITLE ) ) )
+ else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_TITLE ) )
aPropVal.Value >>= rItem.aLabel;
- else if ( aPropVal.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGE_STATUSBAR_CONTEXT ) ) )
+ else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_CONTEXT ) )
aPropVal.Value >>= rItem.aContext;
- else if ( aPropVal.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGE_STATUSBAR_ALIGN ) ) )
+ else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_ALIGN ) )
aPropVal.Value >>= sAlignment;
- else if ( aPropVal.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGE_STATUSBAR_AUTOSIZE ) ) )
+ else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_AUTOSIZE ) )
aPropVal.Value >>= bAutoSize;
- else if ( aPropVal.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGE_STATUSBAR_OWNERDRAW ) ) )
+ else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_OWNERDRAW ) )
aPropVal.Value >>= bOwnerDraw;
- else if ( aPropVal.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGE_STATUSBAR_WIDTH ) ) )
+ else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_WIDTH ) )
{
sal_Int32 aWidth = 0;
aPropVal.Value >>= aWidth;
@@ -86,9 +86,9 @@ static void lcl_ConvertSequenceToValues(
nItemBits |= SIB_AUTOSIZE;
if ( bOwnerDraw )
nItemBits |= SIB_USERDRAW;
- if ( sAlignment.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( STATUSBAR_ALIGN_CENTER )))
+ if ( sAlignment.startsWith( STATUSBAR_ALIGN_CENTER ))
nItemBits |= SIB_CENTER;
- else if ( sAlignment.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( STATUSBAR_ALIGN_RIGHT )))
+ else if ( sAlignment.startsWith( STATUSBAR_ALIGN_RIGHT ))
nItemBits |= SIB_RIGHT;
else
// if unset, defaults to left alignment
@@ -214,13 +214,13 @@ bool StatusbarMerger::ProcessMergeOperation(
const ::rtl::OUString& rMergeCommandParameter,
const AddonStatusbarItemContainer& rItems )
{
- if ( rMergeCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGECOMMAND_ADDAFTER ) ) )
+ if ( rMergeCommand.startsWith( MERGECOMMAND_ADDAFTER ) )
return lcl_MergeItems( pStatusbar, nPos, 1, rItemId, rModuleIdentifier, rItems );
- else if ( rMergeCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGECOMMAND_ADDBEFORE ) ) )
+ else if ( rMergeCommand.startsWith( MERGECOMMAND_ADDBEFORE ) )
return lcl_MergeItems( pStatusbar, nPos, 0, rItemId, rModuleIdentifier, rItems );
- else if ( rMergeCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGECOMMAND_REPLACE ) ) )
+ else if ( rMergeCommand.startsWith( MERGECOMMAND_REPLACE ) )
return lcl_ReplaceItem( pStatusbar, nPos, rItemId, rModuleIdentifier, rItems );
- else if ( rMergeCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGECOMMAND_REMOVE ) ) )
+ else if ( rMergeCommand.startsWith( MERGECOMMAND_REMOVE ) )
return lcl_RemoveItems( pStatusbar, nPos, rMergeCommandParameter );
return false;
@@ -236,18 +236,18 @@ bool StatusbarMerger::ProcessMergeFallback(
const AddonStatusbarItemContainer& rItems )
{
// fallback IGNORE or REPLACE/REMOVE item not found
- if (( rMergeFallback.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGEFALLBACK_IGNORE ))) ||
- ( rMergeCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGECOMMAND_REPLACE ))) ||
- ( rMergeCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGECOMMAND_REMOVE ))) )
+ if (( rMergeFallback.startsWith( MERGEFALLBACK_IGNORE )) ||
+ ( rMergeCommand.startsWith( MERGECOMMAND_REPLACE )) ||
+ ( rMergeCommand.startsWith( MERGECOMMAND_REMOVE )) )
{
return true;
}
- else if (( rMergeCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGECOMMAND_ADDBEFORE ))) ||
- ( rMergeCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGECOMMAND_ADDAFTER ))) )
+ else if (( rMergeCommand.startsWith( MERGECOMMAND_ADDBEFORE )) ||
+ ( rMergeCommand.startsWith( MERGECOMMAND_ADDAFTER )) )
{
- if ( rMergeFallback.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGEFALLBACK_ADDFIRST )))
+ if ( rMergeFallback.startsWith( MERGEFALLBACK_ADDFIRST ))
return lcl_MergeItems( pStatusbar, 0, 0, rItemId, rModuleIdentifier, rItems );
- else if ( rMergeFallback.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MERGEFALLBACK_ADDLAST )))
+ else if ( rMergeFallback.startsWith( MERGEFALLBACK_ADDLAST ))
return lcl_MergeItems( pStatusbar, STATUSBAR_APPEND, 0, rItemId, rModuleIdentifier, rItems );
}