1 --- basctl/source/basicide/bastypes.cxx.orig 2008-08-20 18:25:53.000000000 +0800
2 +++ basctl/source/basicide/bastypes.cxx 2008-08-19 18:40:27.000000000 +0800
4 #include <com/sun/star/script/XLibraryContainer2.hpp>
6 #include <com/sun/star/script/XLibraryContainerPassword.hpp>
7 +#include <com/sun/star/script/ModuleType.hpp>
9 using namespace ::com::sun::star::uno;
10 using namespace ::com::sun::star;
11 @@ -640,8 +641,30 @@ void __EXPORT BasicIDETabBar::Command( c
12 aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE );
13 aPopup.RemoveDisabledEntries();
16 + // disable to delete or remove object modules in IDE
17 + BasicManager* pBasMgr = aDocument.getBasicManager();
20 + StarBASIC* pBasic = pBasMgr->GetLib( aOULibName );
23 + IDEWindowTable& aIDEWindowTable = pIDEShell->GetIDEWindowTable();
24 + IDEBaseWindow* pWin = aIDEWindowTable.Get( GetCurPageId() );
25 + if( pWin && pWin->ISA( ModulWindow ) )
27 + SbModule* pActiveModule = (SbModule*)pBasic->FindModule( pWin->GetName() );
28 + if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::Document ) )
30 + aPopup.EnableItem( SID_BASICIDE_DELETECURRENT, FALSE );
31 + aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE );
39 SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
40 SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;