diff options
Diffstat (limited to 'framework/source/uielement')
15 files changed, 47 insertions, 47 deletions
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 5d136aaec714..6ae3d09cbe5c 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -125,10 +125,10 @@ AddonsToolBarManager::~AddonsToolBarManager() static sal_Bool IsCorrectContext( const ::rtl::OUString& rModuleIdentifier, const ::rtl::OUString& aContextList ) { - if ( aContextList.getLength() == 0 ) + if ( aContextList.isEmpty() ) return sal_True; - if ( rModuleIdentifier.getLength() > 0 ) + if ( !rModuleIdentifier.isEmpty() ) { sal_Int32 nIndex = aContextList.indexOf( rModuleIdentifier ); return ( nIndex >= 0 ); @@ -145,7 +145,7 @@ static Image RetrieveImage( Reference< com::sun::star::frame::XFrame >& rFrame, { Image aImage; - if ( aImageId.getLength() > 0 ) + if ( !aImageId.isEmpty() ) { aImage = framework::AddonsOptions().GetImageFromURL( aImageId, bBigImage ); if ( !!aImage ) diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx index 554a9e75ab03..4f8c655f22e3 100644 --- a/framework/source/uielement/buttontoolbarcontroller.cxx +++ b/framework/source/uielement/buttontoolbarcontroller.cxx @@ -245,7 +245,7 @@ throw (::com::sun::star::uno::RuntimeException) if ( m_bInitialized && m_xFrame.is() && m_xServiceManager.is() && - m_aCommandURL.getLength() ) + !m_aCommandURL.isEmpty() ) { if ( !m_xURLTransformer.is() ) { diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index 94b398694b2b..a70dd5a7d45f 100644 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -136,7 +136,7 @@ throw ( RuntimeException ) if ( m_bInitialized && m_xFrame.is() && m_xServiceManager.is() && - m_aCommandURL.getLength() ) + !m_aCommandURL.isEmpty() ) { xURLTransformer = m_xURLTransformer; xDispatch = getDispatchFromCommand( m_aCommandURL ); @@ -146,7 +146,7 @@ throw ( RuntimeException ) } } - if ( xDispatch.is() && aTargetURL.Complete.getLength() > 0 ) + if ( xDispatch.is() && !aTargetURL.Complete.isEmpty() ) { // Execute dispatch asynchronously ExecuteInfo* pExecuteInfo = new ExecuteInfo; @@ -321,7 +321,7 @@ uno::Reference< frame::XDispatch > ComplexToolbarController::getDispatchFromComm { uno::Reference< frame::XDispatch > xDispatch; - if ( m_bInitialized && m_xFrame.is() && m_xServiceManager.is() && aCommand.getLength() ) + if ( m_bInitialized && m_xFrame.is() && m_xServiceManager.is() && !aCommand.isEmpty() ) { URLToDispatchMap::const_iterator pIter = m_aListenerMap.find( aCommand ); if ( pIter != m_aListenerMap.end() ) @@ -335,7 +335,7 @@ uno::Reference< frame::XDispatch > ComplexToolbarController::getDispatchFromComm const ::com::sun::star::util::URL& ComplexToolbarController::getInitializedURL() { - if ( m_aURL.Complete.getLength() == 0 ) + if ( m_aURL.Complete.isEmpty() ) { m_aURL.Complete = m_aCommandURL; m_xURLTransformer->parseStrict( m_aURL ); diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index fadf338bec5c..2de8e8d5833b 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -166,7 +166,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r // try to retrieve printer name of document aPrinterName = retrievePrinterName( m_xFrame ); - if ( aPrinterName.getLength() > 0 ) + if ( !aPrinterName.isEmpty() ) { pInfoPrinter = new Printer( aPrinterName ); if ( pInfoPrinter && pInfoPrinter->GetDevFontCount() > 0 ) diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index 08db404d63c4..defc407db11e 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -165,7 +165,7 @@ throw ( RuntimeException ) if ( m_bInitialized && m_xFrame.is() && m_xServiceManager.is() && - m_aCommandURL.getLength() ) + !m_aCommandURL.isEmpty() ) { xURLTransformer = Reference< XURLTransformer >( m_xServiceManager->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index 7da9718a2b5d..568383d5d0e4 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -169,7 +169,7 @@ IMPL_STATIC_LINK_NOINSTANCE( MacrosMenuController, ExecuteHdl_Impl, ExecuteInfo* String MacrosMenuController::RetrieveLabelFromCommand( const String& aCmdURL ) { - sal_Bool bModuleIdentified = m_aModuleIdentifier.getLength() != 0; + sal_Bool bModuleIdentified = !m_aModuleIdentifier.isEmpty(); return framework::RetrieveLabelFromCommand(aCmdURL,m_xServiceManager,m_xUICommandLabels,m_xFrame,m_aModuleIdentifier,bModuleIdentified,"Label"); } diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 1ce47762af32..4de7ea4accd1 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -782,8 +782,8 @@ void MenuBarManager::CheckAndAddMenuExtension( Menu* pMenu ) // retrieve menu extension item MenuExtensionItem aMenuItem( GetMenuExtension() ); - if (( aMenuItem.aURL.getLength() > 0 ) && - ( aMenuItem.aLabel.getLength() > 0 )) + if (( !aMenuItem.aURL.isEmpty() ) && + ( !aMenuItem.aLabel.isEmpty() )) { // remove all old window list entries from menu sal_uInt16 nNewItemId( 0 ); @@ -925,7 +925,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) Reference< XDispatch > xMenuItemDispatch; ::rtl::OUString aItemCommand = pMenu->GetItemCommand( pMenuItemHandler->nItemId ); - if ( !aItemCommand.getLength() ) + if ( aItemCommand.isEmpty() ) { aItemCommand = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aItemCommand += ::rtl::OUString::valueOf( (sal_Int32)pMenuItemHandler->nItemId ); @@ -1281,7 +1281,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF sal_uInt16 nItemId = FillItemCommand(aItemCommand,pMenu, i ); // Set module identifier when provided from outside - if ( rModuleIdentifier.getLength() > 0 ) + if ( !rModuleIdentifier.isEmpty() ) { m_aModuleIdentifier = rModuleIdentifier; m_bModuleIdentified = sal_True; @@ -1290,7 +1290,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF if (( pMenu->IsMenuBar() || bAccessibilityEnabled ) && ( pMenu->GetItemText( nItemId ).Len() == 0 )) { - if ( aItemCommand.getLength() > 0 ) + if ( !aItemCommand.isEmpty() ) pMenu->SetItemText( nItemId, RetrieveLabelFromCommand( aItemCommand )); } @@ -1425,7 +1425,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF MenuConfiguration::Attributes* pMenuAttributes = (MenuConfiguration::Attributes*)pMenu->GetUserValue( nItemId ); - if ( pMenuAttributes && pMenuAttributes->aImageId.getLength() > 0 ) + if ( pMenuAttributes && !pMenuAttributes->aImageId.isEmpty() ) { // Retrieve image id from menu attributes aImage = GetImageFromURL( m_xFrame, aImageId, false ); @@ -1646,7 +1646,7 @@ void MenuBarManager::RetrieveImageManagers() } Reference< XModuleManager > xModuleManager; - if ( m_aModuleIdentifier.getLength() == 0 ) + if ( m_aModuleIdentifier.isEmpty() ) xModuleManager.set( getServiceFactory()->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW ); try @@ -1794,7 +1794,7 @@ void MenuBarManager::FillMenu( } // Use help command to transport module identifier - if ( aModuleIdentifier.getLength() > 0 ) + if ( !aModuleIdentifier.isEmpty() ) pMenu->SetHelpCommand( nId, aModuleIdentifier ); ++nId; @@ -2009,7 +2009,7 @@ sal_uInt16 MenuBarManager::FillItemCommand(::rtl::OUString& _rItemCommand,Menu* sal_uInt16 nItemId = _pMenu->GetItemId( _nIndex ); _rItemCommand = _pMenu->GetItemCommand( nItemId ); - if ( !_rItemCommand.getLength() ) + if ( _rItemCommand.isEmpty() ) { const static ::rtl::OUString aSlotString( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); _rItemCommand = aSlotString; diff --git a/framework/source/uielement/menubarmerger.cxx b/framework/source/uielement/menubarmerger.cxx index 30a6a6295b66..544c52ad2668 100644 --- a/framework/source/uielement/menubarmerger.cxx +++ b/framework/source/uielement/menubarmerger.cxx @@ -74,7 +74,7 @@ namespace framework */ bool MenuBarMerger::IsCorrectContext( const ::rtl::OUString& rContext, const ::rtl::OUString& rModuleIdentifier ) { - return (( rContext.getLength() == 0 ) || ( rContext.indexOf( rModuleIdentifier ) >= 0 )); + return ( rContext.isEmpty() || ( rContext.indexOf( rModuleIdentifier ) >= 0 )); } void MenuBarMerger::RetrieveReferencePath( @@ -88,7 +88,7 @@ void MenuBarMerger::RetrieveReferencePath( do { ::rtl::OUString aToken = rReferencePathString.getToken( 0, aDelimiter, nIndex ); - if ( aToken.getLength() > 0 ) + if ( !aToken.isEmpty() ) rReferencePath.push_back( aToken ); } while ( nIndex >= 0 ); diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index dad7a1922c47..3fc4a5a72834 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -110,7 +110,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, sal_Bool bSetImage if ( pInfo != m_aAddInfoForItem.end() ) aImageId = pInfo->second.aImageId; // Retrieve image id for menu item - if ( aImageId.getLength() > 0 ) + if ( !aImageId.isEmpty() ) { aImage = GetImageFromURL( xFrame, aImageId, false ); if ( !!aImage ) @@ -143,7 +143,7 @@ void NewMenuController::determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const sal_Bool bFound( sal_False ); rtl::OUString aCommand; - if ( m_aEmptyDocURL.getLength() > 0 ) + if ( !m_aEmptyDocURL.isEmpty() ) { // Search for the empty document URL @@ -167,7 +167,7 @@ void NewMenuController::determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const { // Search for the default module name rtl::OUString aDefaultModuleName( SvtModuleOptions().GetDefaultModuleName() ); - if ( aDefaultModuleName.getLength() > 0 ) + if ( !aDefaultModuleName.isEmpty() ) { for ( sal_uInt32 i = 0; i < sal_uInt32( nCount ); i++ ) { @@ -507,7 +507,7 @@ void NewMenuController::impl_setPopupMenu() m_bModuleIdentified = sal_True; Reference< XNameAccess > xNameAccess( xModuleManager, UNO_QUERY ); - if (( m_aModuleIdentifier.getLength() > 0 ) && xNameAccess.is() ) + if ( !m_aModuleIdentifier.isEmpty() && xNameAccess.is() ) { Sequence< PropertyValue > aSeq; diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx index 8a941aedae57..6245d01e4183 100644 --- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx +++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx @@ -477,7 +477,7 @@ void SpinfieldToolbarController::executeControlCommand( const ::com::sun::star:: } // Check values and set members - if ( aValue.getLength() > 0 ) + if ( !aValue.isEmpty() ) { m_bFloat = bFloatValue; m_nValue = aValue.toDouble(); @@ -486,17 +486,17 @@ void SpinfieldToolbarController::executeControlCommand( const ::com::sun::star:: m_pSpinfieldControl->SetText( aOutString ); notifyTextChanged( aOutString ); } - if ( aMax.getLength() > 0 ) + if ( !aMax.isEmpty() ) { m_nMax = aMax.toDouble(); m_bMaxSet = true; } - if ( aMin.getLength() > 0 ) + if ( !aMin.isEmpty() ) { m_nMin = aMin.toDouble(); m_bMinSet = true; } - if ( aStep.getLength() > 0 ) + if ( !aStep.isEmpty() ) m_nStep = aStep.toDouble(); } @@ -525,7 +525,7 @@ bool SpinfieldToolbarController::impl_getValue( rtl::OUString SpinfieldToolbarController::impl_formatOutputString( double fValue ) { - if ( m_aOutFormat.getLength() == 0 ) + if ( m_aOutFormat.isEmpty() ) { if ( m_bFloat ) return rtl::OUString::valueOf( fValue ); diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index 029cc52d5cb4..9fd22cdee959 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -519,7 +519,7 @@ void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAcc } } - if (( nType == ::com::sun::star::ui::ItemType::DEFAULT ) && ( aCommandURL.getLength() > 0 )) + if (( nType == ::com::sun::star::ui::ItemType::DEFAULT ) && !aCommandURL.isEmpty() ) { rtl::OUString aString( RetrieveLabelFromCommand( aCommandURL )); sal_uInt16 nItemBits( impl_convertItemStyleToItemBits( nStyle )); diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 3c2896eac8bc..8d4f9841e00c 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -842,7 +842,7 @@ uno::Sequence< beans::PropertyValue > ToolBarManager::GetPropsForCommand( const m_bModuleIdentified = sal_True; m_aModuleIdentifier = xModuleManager->identify( xIfac ); - if ( m_aModuleIdentifier.getLength() > 0 ) + if ( !m_aModuleIdentifier.isEmpty() ) { Reference< XNameAccess > xNameAccess( m_xServiceManager->createInstance( SERVICENAME_UICOMMANDDESCRIPTION ), UNO_QUERY ); if ( xNameAccess.is() ) @@ -852,7 +852,7 @@ uno::Sequence< beans::PropertyValue > ToolBarManager::GetPropsForCommand( const if ( m_xUICommandLabels.is() ) { - if ( rCmdURL.getLength() > 0 ) + if ( !rCmdURL.isEmpty() ) m_xUICommandLabels->getByName( rCmdURL ) >>= aPropSeq; } } @@ -1036,7 +1036,7 @@ void ToolBarManager::CreateControllers() if ( xSubToolBar.is() && xSubToolBar->opensSubToolbar() ) { rtl::OUString aSubToolBarName = xSubToolBar->getSubToolbarName(); - if ( aSubToolBarName.getLength() != 0 ) + if ( !aSubToolBarName.isEmpty() ) { SubToolBarToSubToolBarControllerMap::iterator pIter = m_aSubToolBarControllerMap.find( aSubToolBarName ); @@ -1333,7 +1333,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine aProp[i].Value >>= nStyle; } - if (( nType == ::com::sun::star::ui::ItemType::DEFAULT ) && ( aCommandURL.getLength() > 0 )) + if (( nType == ::com::sun::star::ui::ItemType::DEFAULT ) && !aCommandURL.isEmpty() ) { ::rtl::OUString aString( RetrieveLabelFromCommand( aCommandURL )); @@ -1342,7 +1342,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine m_aMenuMap[ nId ] = aMenuDesc; m_pToolBar->InsertItem( nId, aString, nItemBits ); m_pToolBar->SetItemCommand( nId, aCommandURL ); - if ( aTooltip.getLength() ) + if ( !aTooltip.isEmpty() ) { m_pToolBar->SetQuickHelpText( nId, aTooltip ); } @@ -1360,7 +1360,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine m_pToolBar->SetQuickHelpText( nId, sQuickHelp ); } - if ( aLabel.getLength() > 0 ) + if ( !aLabel.isEmpty() ) { m_pToolBar->SetItemText( nId, aLabel ); } @@ -1493,7 +1493,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine { rtl::OUString aUIName; xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))) >>= aUIName; - if ( aUIName.getLength() > 0 ) + if ( !aUIName.isEmpty() ) m_pToolBar->SetText( aUIName ); } catch (const Exception&) diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx index 7e0b39ffbfb9..4b5da501f896 100644 --- a/framework/source/uielement/toolbarmerger.cxx +++ b/framework/source/uielement/toolbarmerger.cxx @@ -116,7 +116,7 @@ bool ToolBarMerger::IsCorrectContext( const ::rtl::OUString& rContext, const ::rtl::OUString& rModuleIdentifier ) { - return (( rContext.getLength() == 0 ) || ( rContext.indexOf( rModuleIdentifier ) >= 0 )); + return ( rContext.isEmpty() || ( rContext.indexOf( rModuleIdentifier ) >= 0 )); } /** diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index a31f32865818..ecc6a9b209f2 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -176,7 +176,7 @@ void ToolbarsMenuController::addCommand( sal_uInt16 nItemId = m_xPopupMenu->getItemCount()+1; rtl::OUString aLabel; - if ( rLabel.getLength() == 0 ) + if ( rLabel.isEmpty() ) aLabel = getUINameFromCommand( rCommandURL ); else aLabel = rLabel; @@ -297,7 +297,7 @@ static void fillHashMap( const Sequence< Sequence< ::com::sun::star::beans::Prop pProperties[j].Value >>= aUIName; } - if ( aResourceURL.getLength() > 0 && + if ( !aResourceURL.isEmpty() && rHashMap.find( aResourceURL ) == rHashMap.end() ) rHashMap.insert( ToolbarHashMap::value_type( aResourceURL, aUIName )); } @@ -322,7 +322,7 @@ Sequence< Sequence< com::sun::star::beans::PropertyValue > > ToolbarsMenuControl xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" ))) >>= aResName; if (( nType == ::com::sun::star::ui::UIElementType::TOOLBAR ) && - ( aResName.getLength() > 0 )) + !aResName.isEmpty() ) { ToolBarInfo aToolBarInfo; @@ -411,7 +411,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r sal_Bool bHideFromMenu( sal_False ); sal_Bool bContextSensitive( sal_False ); sal_Bool bVisible( sal_False ); - if ( aUIName.getLength() == 0 && + if ( aUIName.isEmpty() && m_xPersistentWindowState.is() ) { try @@ -444,7 +444,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r } - if (( aUIName.getLength() > 0 ) && ( !bHideFromMenu )) + if ( !aUIName.isEmpty() && !bHideFromMenu ) { ToolBarEntry aTbEntry; aTbEntry.aUIName = aUIName; diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx index 7c1ad858fecf..a14d5938d54d 100644 --- a/framework/source/uielement/uicommanddescription.cxx +++ b/framework/source/uielement/uicommanddescription.cxx @@ -341,7 +341,7 @@ Any ConfigurationAccess_UICommand::getSequenceFromCache( const ::rtl::OUString& Sequence< PropertyValue > aPropSeq( 4 ); aPropSeq[0].Name = m_aPropLabel; - aPropSeq[0].Value = pIter->second.aContextLabel.getLength() ? + aPropSeq[0].Value = !pIter->second.aContextLabel.isEmpty() ? makeAny( pIter->second.aContextLabel ): makeAny( pIter->second.aLabel ); aPropSeq[1].Name = m_aPropName; aPropSeq[1].Value <<= pIter->second.aCommandName; @@ -738,7 +738,7 @@ throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::la } } } - else if ( m_aPrivateResourceURL.getLength() && aName.indexOf( m_aPrivateResourceURL ) == 0 ) + else if ( !m_aPrivateResourceURL.isEmpty() && aName.indexOf( m_aPrivateResourceURL ) == 0 ) { // special keys to retrieve information about a set of commands return m_xGenericUICommands->getByName( aName ); |