diff options
Diffstat (limited to 'cui/source/customize')
-rw-r--r-- | cui/source/customize/cfg.cxx | 18 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 10 | ||||
-rw-r--r-- | cui/source/customize/macropg.cxx | 12 |
3 files changed, 18 insertions, 22 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 35da4cccdfa0..8605ade05212 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -804,7 +804,7 @@ SvxConfigDialog::SvxConfigDialog( { OUString text = ((const SfxStringItem*)pItem)->GetValue(); - if (text.indexOf( ITEM_TOOLBAR_URL ) == 0) + if (text.startsWith( ITEM_TOOLBAR_URL ) ) { SetCurPageId( RID_SVXPAGE_TOOLBARS ); } @@ -3109,7 +3109,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage( if ( pItem ) { OUString text = ((const SfxStringItem*)pItem)->GetValue(); - if (text.indexOf( ITEM_TOOLBAR_URL ) == 0) + if (text.startsWith( ITEM_TOOLBAR_URL )) { m_aURLToSelect = text.copy( 0 ); } @@ -3754,7 +3754,7 @@ void ToolbarSaveInData::SetSystemStyle( const OUString& rResourceURL, sal_Int32 nStyle ) { - if ( rResourceURL.indexOf( "private" ) == 0 && + if ( rResourceURL.startsWith( "private" ) && m_xPersistentWindowState.is() && m_xPersistentWindowState->hasByName( rResourceURL ) ) { @@ -3793,7 +3793,7 @@ sal_Int32 ToolbarSaveInData::GetSystemStyle( const OUString& rResourceURL ) { sal_Int32 result = 0; - if ( rResourceURL.indexOf( "private" ) == 0 && + if ( rResourceURL.startsWith( "private" ) && m_xPersistentWindowState.is() && m_xPersistentWindowState->hasByName( rResourceURL ) ) { @@ -3827,7 +3827,7 @@ OUString ToolbarSaveInData::GetSystemUIName( const OUString& rResourceURL ) { OUString result; - if ( rResourceURL.indexOf( "private" ) == 0 && + if ( rResourceURL.startsWith( "private" ) && m_xPersistentWindowState.is() && m_xPersistentWindowState->hasByName( rResourceURL ) ) { @@ -3853,7 +3853,7 @@ OUString ToolbarSaveInData::GetSystemUIName( const OUString& rResourceURL ) } } - if ( rResourceURL.indexOf( ".uno" ) == 0 && + if ( rResourceURL.startsWith( ".uno" ) && m_xCommandToLabelMap.is() && m_xCommandToLabelMap->hasByName( rResourceURL ) ) { @@ -3956,7 +3956,7 @@ SvxEntries* ToolbarSaveInData::GetEntries() aToolbarInfo.insert( ToolbarInfo::value_type( systemname, true )); OUString custom(CUSTOM_TOOLBAR_STR); - if ( systemname.indexOf( custom ) == 0 ) + if ( systemname.startsWith( custom ) ) { pEntry->SetUserDefined( sal_True ); } @@ -4008,7 +4008,7 @@ SvxEntries* ToolbarSaveInData::GetEntries() // custom toolbars of the parent are not visible in the document layer OUString custom(CUSTOM_TOOLBAR_STR); - if ( systemname.indexOf( custom ) == 0 ) + if ( systemname.startsWith( custom ) ) continue; // check if toolbar is already in the document layer @@ -4039,7 +4039,7 @@ SvxEntries* ToolbarSaveInData::GetEntries() pEntry->SetMain( sal_True ); pEntry->SetStyle( GetSystemStyle( url ) ); - if ( systemname.indexOf( custom ) == 0 ) + if ( systemname.startsWith( custom ) ) { pEntry->SetUserDefined( sal_True ); } diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 509a3728d7d3..a23418522fd9 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -99,7 +99,7 @@ sal_Bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle) static sal_Int32 LEN_SPART = CMDURL_SPART_ONLY.getLength(); static sal_Int32 LEN_FPART = CMDURL_FPART_ONLY.getLength(); - if (aStyle.sCommand.indexOf(CMDURL_STYLEPROT_ONLY, 0) != 0) + if (!aStyle.sCommand.startsWith(CMDURL_STYLEPROT_ONLY)) return sal_False; aStyle.sFamily = OUString(); @@ -112,15 +112,15 @@ sal_Bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle) return sal_False; OUString sArg = sCmdArgs.copy(0, i); - if (sArg.indexOf(CMDURL_SPART_ONLY) == 0) + if (sArg.startsWith(CMDURL_SPART_ONLY)) aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART); - else if (sArg.indexOf(CMDURL_FPART_ONLY) == 0) + else if (sArg.startsWith(CMDURL_FPART_ONLY)) aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART); sArg = sCmdArgs.copy(i+1, sCmdArgs.getLength()-i-1); - if (sArg.indexOf(CMDURL_SPART_ONLY) == 0) + if (sArg.startsWith(CMDURL_SPART_ONLY)) aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART); - else if (sArg.indexOf(CMDURL_FPART_ONLY) == 0) + else if (sArg.startsWith(CMDURL_FPART_ONLY)) aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART); if (!(aStyle.sFamily.isEmpty() || aStyle.sStyle.isEmpty())) diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index e0ca7ef4c89d..ab01f069a0a0 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -631,7 +631,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* } bool bDoubleClick = (pBtn == NULL); - bool bUNOAssigned = (sEventURL.indexOf( aVndSunStarUNO ) == 0); + bool bUNOAssigned = sEventURL.startsWith( aVndSunStarUNO ); if( pBtn == pImpl->pDeletePB ) { // delete pressed @@ -895,14 +895,10 @@ AssignComponentDialog::AssignComponentDialog( Window * pParent, const OUString& maOKButton.SetClickHdl(LINK(this, AssignComponentDialog, ButtonHandler)); OUString aMethodName; - if( !maURL.isEmpty() ) + if( maURL.startsWith( aVndSunStarUNO ) ) { - sal_Int32 nIndex = maURL.indexOf( aVndSunStarUNO ); - if( nIndex == 0 ) - { - sal_Int32 nBegin = aVndSunStarUNO.getLength(); - aMethodName = maURL.copy( nBegin ); - } + sal_Int32 nBegin = aVndSunStarUNO.getLength(); + aMethodName = maURL.copy( nBegin ); } maMethodEdit.SetText( aMethodName, Selection( 0, SELECTION_MAX ) ); } |