diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-21 15:53:55 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-21 15:54:52 +0100 |
commit | a3f32769fc4bb23c64168b412dd10ec769a3854d (patch) | |
tree | 92bb435946dcfc422c9816bc05c150069a2da3c3 /framework | |
parent | 35539318cecddc9ccb2904573a894ea05adc432c (diff) |
Fix bogus mass-conversion equalsAsciiL -> startsWith
3af99e4d59d89c343965a928681a30f36b1007d2 "convert equalsAsciiL calls to
startsWith calls" should rather have converted to oprator ==.
Change-Id: Id4a8836c5d6d570e54661c40be7214632e202b21
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/fwe/xml/menudocumenthandler.cxx | 22 | ||||
-rw-r--r-- | framework/source/jobs/jobexecutor.cxx | 8 | ||||
-rw-r--r-- | framework/source/services/autorecovery.cxx | 22 | ||||
-rw-r--r-- | framework/source/uielement/newmenucontroller.cxx | 2 | ||||
-rw-r--r-- | framework/source/uielement/recentfilesmenucontroller.cxx | 2 | ||||
-rw-r--r-- | framework/source/uielement/statusbarmerger.cxx | 40 |
6 files changed, 48 insertions, 48 deletions
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx index b8d7a8bc6ed4..3b81cbad5a9d 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.startsWith( ELEMENT_MENUBAR )) + if ( aName != 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.startsWith( ELEMENT_MENU )) + if ( aName != 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.startsWith( ELEMENT_MENUPOPUP )) + if ( aName != 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.startsWith( ELEMENT_MENU )) + if ( aName != 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.startsWith( ELEMENT_MENUITEM )) + if ( aName != 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.startsWith( ELEMENT_MENUSEPARATOR )) + if ( aName != 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.startsWith(ADDDIRECT_CMD) || - aCommandURL.startsWith(AUTOPILOTMENU_CMD) ) + if ( aCommandURL == ADDDIRECT_CMD || + aCommandURL == 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 ).startsWith(CMD_PROTOCOL)) ) + if ( aCommandURL.copy( CMD_PROTOCOL_SIZE ) != 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 ).startsWith(CMD_PROTOCOL) ) + if ( !aLabel.isEmpty() && aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL ) { pList->AddAttribute( OUString( ATTRIBUTE_NS_LABEL ), m_aAttributeType, aLabel ); } - if (( nStyle > 0 ) && !( aCommandURL.copy( CMD_PROTOCOL_SIZE ).startsWith(CMD_PROTOCOL) )) + if (( nStyle > 0 ) && aCommandURL.copy( CMD_PROTOCOL_SIZE ) != CMD_PROTOCOL ) { OUString aValue; MenuStyleItem* pStyle = MenuItemStyles; diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx index e066719e0c90..05a0cfd3a9ac 100644 --- a/framework/source/jobs/jobexecutor.cxx +++ b/framework/source/jobs/jobexecutor.cxx @@ -272,8 +272,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.startsWith(EVENT_ON_NEW)) || - (aEvent.EventName.startsWith(EVENT_ON_LOAD)) + (aEvent.EventName == EVENT_ON_NEW) || + (aEvent.EventName == EVENT_ON_LOAD) ) { if (m_lEvents.find(EVENT_ON_DOCUMENT_OPENED) != m_lEvents.end()) @@ -282,8 +282,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.startsWith(EVENT_ON_CREATE)) || - (aEvent.EventName.startsWith(EVENT_ON_LOAD_FINISHED)) + (aEvent.EventName == EVENT_ON_CREATE) || + (aEvent.EventName == 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 cd9d3493b7e4..badab99a40f3 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1743,8 +1743,8 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent // new document => put it into the internal list if ( - (aEvent.EventName.startsWith(EVENT_ON_NEW)) || - (aEvent.EventName.startsWith(EVENT_ON_LOAD)) + (aEvent.EventName == EVENT_ON_NEW) || + (aEvent.EventName == EVENT_ON_LOAD) ) { implts_registerDocument(xDocument); @@ -1760,17 +1760,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.startsWith(EVENT_ON_SAVE)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVEAS)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVETO)) + (aEvent.EventName == EVENT_ON_SAVE) || + (aEvent.EventName == EVENT_ON_SAVEAS) || + (aEvent.EventName == EVENT_ON_SAVETO) ) { implts_updateDocumentUsedForSavingState(xDocument, SAVE_IN_PROGRESS); } // document saved => remove tmp. files - but hold config entries alive! else if ( - (aEvent.EventName.startsWith(EVENT_ON_SAVEDONE)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVEASDONE)) + (aEvent.EventName == EVENT_ON_SAVEDONE) || + (aEvent.EventName == EVENT_ON_SAVEASDONE) ) { implts_markDocumentAsSaved(xDocument); @@ -1790,9 +1790,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.startsWith(EVENT_ON_SAVEFAILED)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVEASFAILED)) || - (aEvent.EventName.startsWith(EVENT_ON_SAVETOFAILED)) + (aEvent.EventName == EVENT_ON_SAVEFAILED) || + (aEvent.EventName == EVENT_ON_SAVEASFAILED) || + (aEvent.EventName == EVENT_ON_SAVETOFAILED) ) { implts_updateDocumentUsedForSavingState(xDocument, SAVE_FINISHED); @@ -3890,7 +3890,7 @@ css::frame::FeatureStateEvent AutoRecovery::implst_createFeatureStateEvent( aEvent.FeatureURL.Complete = AutoRecovery::implst_getJobDescription(eJob); aEvent.FeatureDescriptor = sEventType; - if (pInfo && sEventType.startsWith(OPERATION_UPDATE)) + if (pInfo && sEventType == 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 9857350998e3..c424aa28c7bb 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.startsWith( ".uno:AddDirect" ); + m_bNewMenu = m_aCommandURL == ".uno:AddDirect"; } } } diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 82136bfdd4c0..91340111778d 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -324,7 +324,7 @@ void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s", OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() ); - if ( aCommand.startsWith( CMD_CLEAR_LIST ) ) + if ( aCommand == CMD_CLEAR_LIST ) { SvtHistoryOptions().Clear( ePICKLIST ); dispatchCommand( diff --git a/framework/source/uielement/statusbarmerger.cxx b/framework/source/uielement/statusbarmerger.cxx index 667929f7cfc6..f62af3e51e35 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.startsWith( MERGE_STATUSBAR_URL ) ) + if ( aPropVal.Name == MERGE_STATUSBAR_URL ) aPropVal.Value >>= rItem.aCommandURL; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_TITLE ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_TITLE ) aPropVal.Value >>= rItem.aLabel; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_CONTEXT ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_CONTEXT ) aPropVal.Value >>= rItem.aContext; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_ALIGN ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_ALIGN ) aPropVal.Value >>= sAlignment; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_AUTOSIZE ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_AUTOSIZE ) aPropVal.Value >>= bAutoSize; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_OWNERDRAW ) ) + else if ( aPropVal.Name == MERGE_STATUSBAR_OWNERDRAW ) aPropVal.Value >>= bOwnerDraw; - else if ( aPropVal.Name.startsWith( MERGE_STATUSBAR_WIDTH ) ) + else if ( aPropVal.Name == 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.startsWith( STATUSBAR_ALIGN_CENTER )) + if ( sAlignment == STATUSBAR_ALIGN_CENTER ) nItemBits |= SIB_CENTER; - else if ( sAlignment.startsWith( STATUSBAR_ALIGN_RIGHT )) + else if ( sAlignment == 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.startsWith( MERGECOMMAND_ADDAFTER ) ) + if ( rMergeCommand == MERGECOMMAND_ADDAFTER ) return lcl_MergeItems( pStatusbar, nPos, 1, rItemId, rModuleIdentifier, rItems ); - else if ( rMergeCommand.startsWith( MERGECOMMAND_ADDBEFORE ) ) + else if ( rMergeCommand == MERGECOMMAND_ADDBEFORE ) return lcl_MergeItems( pStatusbar, nPos, 0, rItemId, rModuleIdentifier, rItems ); - else if ( rMergeCommand.startsWith( MERGECOMMAND_REPLACE ) ) + else if ( rMergeCommand == MERGECOMMAND_REPLACE ) return lcl_ReplaceItem( pStatusbar, nPos, rItemId, rModuleIdentifier, rItems ); - else if ( rMergeCommand.startsWith( MERGECOMMAND_REMOVE ) ) + else if ( rMergeCommand == 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.startsWith( MERGEFALLBACK_IGNORE )) || - ( rMergeCommand.startsWith( MERGECOMMAND_REPLACE )) || - ( rMergeCommand.startsWith( MERGECOMMAND_REMOVE )) ) + if (( rMergeFallback == MERGEFALLBACK_IGNORE ) || + ( rMergeCommand == MERGECOMMAND_REPLACE ) || + ( rMergeCommand == MERGECOMMAND_REMOVE ) ) { return true; } - else if (( rMergeCommand.startsWith( MERGECOMMAND_ADDBEFORE )) || - ( rMergeCommand.startsWith( MERGECOMMAND_ADDAFTER )) ) + else if (( rMergeCommand == MERGECOMMAND_ADDBEFORE ) || + ( rMergeCommand == MERGECOMMAND_ADDAFTER ) ) { - if ( rMergeFallback.startsWith( MERGEFALLBACK_ADDFIRST )) + if ( rMergeFallback == MERGEFALLBACK_ADDFIRST ) return lcl_MergeItems( pStatusbar, 0, 0, rItemId, rModuleIdentifier, rItems ); - else if ( rMergeFallback.startsWith( MERGEFALLBACK_ADDLAST )) + else if ( rMergeFallback == MERGEFALLBACK_ADDLAST ) return lcl_MergeItems( pStatusbar, STATUSBAR_APPEND, 0, rItemId, rModuleIdentifier, rItems ); } |