summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/moduldlg.cxx
diff options
context:
space:
mode:
authorThomas Benisch <tbe@openoffice.org>2001-09-03 10:56:10 +0000
committerThomas Benisch <tbe@openoffice.org>2001-09-03 10:56:10 +0000
commit7ae106bb38b0786757588199e63d94643bdbf8ec (patch)
tree10ae94369a1127662fbed63970ce60909316d1fe /basctl/source/basicide/moduldlg.cxx
parent3dfd05700cda93102ee457baf7ecf66bebf7ef3d (diff)
#91121# adapt library management in BasicIDE to library containers
Diffstat (limited to 'basctl/source/basicide/moduldlg.cxx')
-rw-r--r--basctl/source/basicide/moduldlg.cxx28
1 files changed, 22 insertions, 6 deletions
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index dbc1a4d6cd53..156c7ca46048 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: moduldlg.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: tbe $ $Date: 2001-08-29 12:25:29 $
+ * last change: $Author: tbe $ $Date: 2001-09-03 11:55:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -183,11 +183,13 @@ BOOL __EXPORT ExtBasicTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry )
// don't drop on a library, which is not loaded or password protected
if ( bValid && ( nDepth == 1 ) )
{
- String aLib = GetEntryText( pEntry );
- String aMgr = GetEntryText( GetParent( pEntry ) );
- BasicManager* pBasicManager = BasicIDE::FindBasicManager( aMgr );
- if ( pBasicManager )
+ String aLibName = GetEntryText( pEntry );
+ String aBasMgrName = GetEntryText( GetParent( pEntry ) );
+ BasicManager* pBasMgr = BasicIDE::FindBasicManager( aBasMgrName );
+ if ( pBasMgr )
{
+ // TODO: check password
+ /* old code
USHORT nLib = pBasicManager->GetLibId( aLib );
if ( !pBasicManager->IsLibLoaded( nLib ) || (
pBasicManager->HasPassword( nLib ) &&
@@ -195,6 +197,20 @@ BOOL __EXPORT ExtBasicTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry )
{
bValid = FALSE;
}
+ */
+
+ SfxObjectShell* pShell = BasicIDE::FindDocShell( pBasMgr );
+ ::rtl::OUString aOULibName( aLibName );
+
+ // check if module library is loaded
+ Reference< script::XLibraryContainer > xModLibContainer = BasicIDE::GetModuleLibraryContainer( pShell );
+ if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && !xModLibContainer->isLibraryLoaded( aOULibName ) )
+ bValid = FALSE;
+
+ // check if dialog library is loaded
+ Reference< script::XLibraryContainer > xDlgLibContainer = BasicIDE::GetDialogLibraryContainer( pShell );
+ if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) && !xDlgLibContainer->isLibraryLoaded( aOULibName ) )
+ bValid = FALSE;
}
else
bValid = FALSE;