diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-01 01:25:36 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-01 01:36:11 +0200 |
commit | f3ba0c5d4dfc44f72aa7d4809c062227649f098f (patch) | |
tree | c3219aa0d88d621ed40f80703386997758299416 /basctl/source/basicide/bastypes.cxx | |
parent | 21f632d327a08fbe4c57b937745e5dee9006cfe2 (diff) |
Convert RID_POPUP_TABBAR to xml
Change-Id: Ic4587b8e244c52089692908fe0d10e363b5ed4fb
Diffstat (limited to 'basctl/source/basicide/bastypes.cxx')
-rw-r--r-- | basctl/source/basicide/bastypes.cxx | 54 |
1 files changed, 1 insertions, 53 deletions
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 92282d76acd0..14381efba979 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -470,60 +470,8 @@ void TabBar::Command( const CommandEvent& rCEvt ) MouseEvent aMouseEvent( aP, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT ); ::TabBar::MouseButtonDown( aMouseEvent ); // base class } - - ScopedVclPtrInstance<PopupMenu> aPopup( IDEResId( RID_POPUP_TABBAR ) ); - if ( GetPageCount() == 0 ) - { - aPopup->EnableItem(SID_BASICIDE_DELETECURRENT, false); - aPopup->EnableItem(SID_BASICIDE_RENAMECURRENT, false); - aPopup->EnableItem(SID_BASICIDE_HIDECURPAGE, false); - } - - if ( StarBASIC::IsRunning() ) - { - aPopup->EnableItem(SID_BASICIDE_DELETECURRENT, false); - aPopup->EnableItem(SID_BASICIDE_RENAMECURRENT, false); - aPopup->EnableItem(SID_BASICIDE_MODULEDLG, false); - } - - if (Shell* pShell = GetShell()) - { - ScriptDocument aDocument( pShell->GetCurDocument() ); - OUString aOULibName( pShell->GetCurLibName() ); - Reference< script::XLibraryContainer2 > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); - Reference< script::XLibraryContainer2 > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); - if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryReadOnly( aOULibName ) ) || - ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) && xDlgLibContainer->isLibraryReadOnly( aOULibName ) ) ) - { - aPopup->EnableItem(aPopup->GetItemId( 0 ), false); - aPopup->EnableItem(SID_BASICIDE_DELETECURRENT, false); - aPopup->EnableItem(SID_BASICIDE_RENAMECURRENT, false); - aPopup->RemoveDisabledEntries(); - } - if ( aDocument.isInVBAMode() ) - { - // disable to delete or remove object modules in IDE - if (BasicManager* pBasMgr = aDocument.getBasicManager()) - { - if (StarBASIC* pBasic = pBasMgr->GetLib(aOULibName)) - { - Shell::WindowTable& aWindowTable = pShell->GetWindowTable(); - Shell::WindowTableIt it = aWindowTable.find( GetCurPageId() ); - if (it != aWindowTable.end() && dynamic_cast<ModulWindow*>(it->second.get())) - { - SbModule* pActiveModule = pBasic->FindModule( it->second->GetName() ); - if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) ) - { - aPopup->EnableItem(SID_BASICIDE_DELETECURRENT, false); - aPopup->EnableItem(SID_BASICIDE_RENAMECURRENT, false); - } - } - } - } - } - } if (SfxDispatcher* pDispatcher = GetDispatcher()) - pDispatcher->Execute(aPopup->Execute(this, aPos)); + pDispatcher->ExecutePopup("tabbar", this, &aPos); } } |