diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-04-10 00:42:02 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-04-10 00:42:02 +0200 |
commit | 6957d013b49fdb18180f4bf414862c199ea96e26 (patch) | |
tree | 3e2c266b5394f2c4c5e0ed48970f7af1bd54f411 | |
parent | 4e3c5f4e50e40a40bbd0db1c249d9957e181b71d (diff) |
equalsAsciiL() -> operator==()
some more like 7e06132878a495ffb8ed9d54588e1a3ebbd0e8da
Change-Id: I42c2a208e30ce80e95d892c6123247057c823773
-rw-r--r-- | framework/source/fwe/classes/addonsoptions.cxx | 3 | ||||
-rw-r--r-- | framework/source/uielement/addonstoolbarmanager.cxx | 3 | ||||
-rw-r--r-- | framework/source/uielement/menubarmerger.cxx | 41 | ||||
-rw-r--r-- | sfx2/source/dialog/mailmodel.cxx | 5 |
4 files changed, 21 insertions, 31 deletions
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 6b9aefa75ef1..84b635095aa7 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -51,7 +51,6 @@ using namespace ::com::sun::star; #define ROOTNODE_ADDONMENU OUString("Office.Addons" ) #define PATHDELIMITER OUString("/" ) #define SEPARATOR_URL_STR "private:separator" -#define SEPARATOR_URL_LEN 17 #define SEPARATOR_URL OUString( SEPARATOR_URL_STR ) #define PROPERTYNAME_URL ADDONSMENUITEM_PROPERTYNAME_URL @@ -1100,7 +1099,7 @@ sal_Bool AddonsOptions_Impl::ReadMenuItem( const OUString& aMenuNodeName, Sequen } } else if (( aMenuItemNodePropValues[ OFFSET_MENUITEM_URL ] >>= aStrValue ) && - aStrValue.equalsAsciiL( SEPARATOR_URL_STR, SEPARATOR_URL_LEN )) + aStrValue == SEPARATOR_URL_STR ) { // Separator aMenuItem[ OFFSET_MENUITEM_URL ].Value <<= aStrValue; diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 7a6b22811d35..4e897c0521ba 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -74,7 +74,6 @@ namespace framework { static const char TOOLBOXITEM_SEPARATOR_STR[] = "private:separator"; -static const sal_uInt16 TOOLBOXITEM_SEPARATOR_STR_LEN = sizeof( TOOLBOXITEM_SEPARATOR_STR )-1; AddonsToolBarManager::AddonsToolBarManager( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& rFrame, @@ -243,7 +242,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue if ( IsCorrectContext( aModuleIdentifier, aContext )) { - if ( aURL.equalsAsciiL( TOOLBOXITEM_SEPARATOR_STR, TOOLBOXITEM_SEPARATOR_STR_LEN )) + if ( aURL == TOOLBOXITEM_SEPARATOR_STR ) { sal_uInt16 nCount = m_pToolBar->GetItemCount(); if ( nCount > 0 && ( m_pToolBar->GetItemType( nCount-1 ) != TOOLBOXITEM_SEPARATOR ) && nElements > 0 ) diff --git a/framework/source/uielement/menubarmerger.cxx b/framework/source/uielement/menubarmerger.cxx index 8d5569fb3fa6..2f5b91571dbf 100644 --- a/framework/source/uielement/menubarmerger.cxx +++ b/framework/source/uielement/menubarmerger.cxx @@ -24,21 +24,14 @@ using namespace ::com::sun::star; static const char SEPARATOR_STRING[] = "private:separator"; -static const sal_uInt32 SEPARATOR_STRING_LEN = 17; static const char MERGECOMMAND_ADDAFTER[] = "AddAfter"; -static const sal_uInt32 MERGECOMMAND_ADDAFTER_LEN = 8; static const char MERGECOMMAND_ADDBEFORE[] = "AddBefore"; -static const sal_uInt32 MERGECOMMAND_ADDBEFORE_LEN = 9; static const char MERGECOMMAND_REPLACE[] = "Replace"; -static const sal_uInt32 MERGECOMMAND_REPLACE_LEN = 7; static const char MERGECOMMAND_REMOVE[] = "Remove"; -static const sal_uInt32 MERGECOMMAND_REMOVE_LEN = 6; static const char MERGEFALLBACK_ADDPATH[] = "AddPath"; -static const char MERGEFALLBACK_ADDPATH_LEN = 7; static const char MERGEFALLBACK_IGNORE[] = "Ignore"; -static const char MERGEFALLBACK_IGNORE_LEN = 6; namespace framework @@ -176,7 +169,7 @@ bool MenuBarMerger::CreateSubMenu( if ( IsCorrectContext( rMenuItem.aContext, rModuleIdentifier )) { - if ( rMenuItem.aURL.equalsAsciiL( SEPARATOR_STRING, SEPARATOR_STRING_LEN )) + if ( rMenuItem.aURL == SEPARATOR_STRING ) { pSubMenu->InsertSeparator(); } @@ -217,7 +210,7 @@ bool MenuBarMerger::MergeMenuItems( if ( IsCorrectContext( rMenuItem.aContext, rModuleIdentifier )) { - if ( rMenuItem.aURL.equalsAsciiL( SEPARATOR_STRING, SEPARATOR_STRING_LEN )) + if ( rMenuItem.aURL == SEPARATOR_STRING ) { pMenu->InsertSeparator(OString(), nPos+nModIndex+nIndex); } @@ -288,21 +281,21 @@ bool MenuBarMerger::ProcessMergeOperation( { sal_uInt16 nModIndex( 0 ); - if ( rMergeCommand.equalsAsciiL( MERGECOMMAND_ADDBEFORE, MERGECOMMAND_ADDBEFORE_LEN )) + if ( rMergeCommand == MERGECOMMAND_ADDBEFORE ) { nModIndex = 0; return MergeMenuItems( pMenu, nPos, nModIndex, nItemId, rModuleIdentifier, rAddonMenuItems ); } - else if ( rMergeCommand.equalsAsciiL( MERGECOMMAND_ADDAFTER, MERGECOMMAND_ADDAFTER_LEN )) + else if ( rMergeCommand == MERGECOMMAND_ADDAFTER ) { nModIndex = 1; return MergeMenuItems( pMenu, nPos, nModIndex, nItemId, rModuleIdentifier, rAddonMenuItems ); } - else if ( rMergeCommand.equalsAsciiL( MERGECOMMAND_REPLACE, MERGECOMMAND_REPLACE_LEN )) + else if ( rMergeCommand == MERGECOMMAND_REPLACE ) { return ReplaceMenuItem( pMenu, nPos, nItemId, rModuleIdentifier, rAddonMenuItems ); } - else if ( rMergeCommand.equalsAsciiL( MERGECOMMAND_REMOVE, MERGECOMMAND_REMOVE_LEN )) + else if ( rMergeCommand == MERGECOMMAND_REMOVE ) { return RemoveMenuItems( pMenu, nPos, rMergeCommandParameter ); } @@ -319,13 +312,13 @@ bool MenuBarMerger::ProcessFallbackOperation( const OUString& rModuleIdentifier, const AddonMenuContainer& rAddonMenuItems ) { - if (( rMergeFallback.equalsAsciiL( MERGEFALLBACK_IGNORE, MERGEFALLBACK_IGNORE_LEN )) || - ( rMergeCommand.equalsAsciiL( MERGECOMMAND_REPLACE, MERGECOMMAND_REPLACE_LEN )) || - ( rMergeCommand.equalsAsciiL( MERGECOMMAND_REMOVE, MERGECOMMAND_REMOVE_LEN )) ) + if (( rMergeFallback == MERGEFALLBACK_IGNORE ) || + ( rMergeCommand == MERGECOMMAND_REPLACE ) || + ( rMergeCommand == MERGECOMMAND_REMOVE ) ) { return true; } - else if ( rMergeFallback.equalsAsciiL( MERGEFALLBACK_ADDPATH, MERGEFALLBACK_ADDPATH_LEN )) + else if ( rMergeFallback == MERGEFALLBACK_ADDPATH ) { Menu* pCurrMenu( aRefPathInfo.pPopupMenu ); sal_Int32 nLevel( aRefPathInfo.nLevel ); @@ -342,7 +335,7 @@ bool MenuBarMerger::ProcessFallbackOperation( const AddonMenuItem& rMenuItem = rAddonMenuItems[i]; if ( IsCorrectContext( rMenuItem.aContext, rModuleIdentifier )) { - if ( rMenuItem.aURL.equalsAsciiL( SEPARATOR_STRING, SEPARATOR_STRING_LEN )) + if ( rMenuItem.aURL == SEPARATOR_STRING ) pCurrMenu->InsertSeparator(OString(), MENU_APPEND); else { @@ -398,21 +391,21 @@ void MenuBarMerger::GetMenuEntry( for ( sal_Int32 i = 0; i < rAddonMenuEntry.getLength(); i++ ) { OUString aMenuEntryPropName = rAddonMenuEntry[i].Name; - if ( aMenuEntryPropName.equalsAsciiL( ADDONSMENUITEM_STRING_URL, ADDONSMENUITEM_URL_LEN )) + if ( aMenuEntryPropName == ADDONSMENUITEM_STRING_URL ) rAddonMenuEntry[i].Value >>= rAddonMenuItem.aURL; - else if ( aMenuEntryPropName.equalsAsciiL( ADDONSMENUITEM_STRING_TITLE, ADDONSMENUITEM_TITLE_LEN )) + else if ( aMenuEntryPropName == ADDONSMENUITEM_STRING_TITLE ) rAddonMenuEntry[i].Value >>= rAddonMenuItem.aTitle; - else if ( aMenuEntryPropName.equalsAsciiL( ADDONSMENUITEM_STRING_TARGET, ADDONSMENUITEM_TARGET_LEN )) + else if ( aMenuEntryPropName == ADDONSMENUITEM_STRING_TARGET ) rAddonMenuEntry[i].Value >>= rAddonMenuItem.aTarget; - else if ( aMenuEntryPropName.equalsAsciiL( ADDONSMENUITEM_STRING_SUBMENU, ADDONSMENUITEM_SUBMENU_LEN )) + else if ( aMenuEntryPropName == ADDONSMENUITEM_STRING_SUBMENU ) { uno::Sequence< uno::Sequence< beans::PropertyValue > > aSubMenu; rAddonMenuEntry[i].Value >>= aSubMenu; GetSubMenu( aSubMenu, rAddonMenuItem.aSubMenu ); } - else if ( aMenuEntryPropName.equalsAsciiL( ADDONSMENUITEM_STRING_CONTEXT, ADDONSMENUITEM_CONTEXT_LEN )) + else if ( aMenuEntryPropName == ADDONSMENUITEM_STRING_CONTEXT ) rAddonMenuEntry[i].Value >>= rAddonMenuItem.aContext; - else if ( aMenuEntryPropName.equalsAsciiL( ADDONSMENUITEM_STRING_IMAGEIDENTIFIER, ADDONSMENUITEM_IMAGEIDENTIFIER_LEN )) + else if ( aMenuEntryPropName == ADDONSMENUITEM_STRING_IMAGEIDENTIFIER ) rAddonMenuEntry[i].Value >>= rAddonMenuItem.aImageId; } } diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 2605119eef50..8df390fd1f20 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -130,7 +130,6 @@ void PrepareListener_Impl::disposing(const css::lang::EventObject& /*rEvent*/) t // class SfxMailModel ----------------------------------------------- static const char PDF_DOCUMENT_TYPE[] = "pdf_Portable_Document_Format"; -static const sal_uInt32 PDF_DOCUMENT_TYPE_LEN = 28; void SfxMailModel::ClearList( AddressList_Impl* pList ) { @@ -212,7 +211,7 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( uno::Sequence< beans::PropertyValue > aPropsForDialog(1); uno::Reference< document::XExporter > xExporter( xFilterDialog, uno::UNO_QUERY ); - if ( rType.equalsAsciiL( PDF_DOCUMENT_TYPE, PDF_DOCUMENT_TYPE_LEN )) + if ( rType == PDF_DOCUMENT_TYPE ) { //add an internal property, used to tell the dialog we want to set a different //string for the ok button @@ -300,7 +299,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( OUString& rFileNamePath ) { SaveResult eRet( SAVE_ERROR ); - bool bSendAsPDF = (rType.equalsAsciiL( PDF_DOCUMENT_TYPE, PDF_DOCUMENT_TYPE_LEN )); + bool bSendAsPDF = ( rType == PDF_DOCUMENT_TYPE ); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); |