diff options
author | Andreas Bregas <ab@openoffice.org> | 2001-04-23 10:21:28 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2001-04-23 10:21:28 +0000 |
commit | 947cacf4722788f5a5fbc6c043d6bad67f5444f5 (patch) | |
tree | 45332fe7731a3252b45dd803d51ef77ab22fd2fb /basctl/source/basicide/bastype3.cxx | |
parent | 02f0d6ad5ff474452309dc1bffd52121251c7cc8 (diff) |
Check new library container in TreeListBox
Diffstat (limited to 'basctl/source/basicide/bastype3.cxx')
-rw-r--r-- | basctl/source/basicide/bastype3.cxx | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index 46715d1a8e05..3e506f0e73a3 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bastype3.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mh $ $Date: 2000-09-29 11:02:36 $ + * last change: $Author: ab $ $Date: 2001-04-23 11:21:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,10 +68,19 @@ #include <svtools/sbx.hxx> #include <sidll.hxx> #include <bastype2.hxx> +#include <basobj.hxx> #include <baside2.hrc> #include <iderid.hxx> #include <bastypes.hxx> +#ifndef _COM_SUN_STAR_SCRIPT_XLIBRARYCONTAINER_HPP_ +#include <com/sun/star/script/XLibraryContainer.hpp> +#endif + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star; + + SV_DECL_VARARR( EntryArray, SvLBoxEntry*, 4, 4 ); SV_IMPL_VARARR( EntryArray, SvLBoxEntry*); @@ -104,6 +113,27 @@ void __EXPORT BasicTreeListBox::RequestingChilds( SvLBoxEntry* pEntry ) BasicManager* pBasMgr = ((BasicManagerEntry*)pUser)->GetBasicManager(); USHORT nLib = pBasMgr->GetLibId( aLibName ); + // New library container + Reference< script::XLibraryContainer > xLibContainer; + SfxObjectShell* pShell = BasicIDE::FindDocShell( pBasMgr ); + if ( pShell ) + { + xLibContainer = uno::Reference< script::XLibraryContainer > + ( pShell->GetBasicContainer(), uno::UNO_QUERY ); + } + else + { + xLibContainer = uno::Reference< script::XLibraryContainer > + ( SFX_APP()->GetBasicContainer(), uno::UNO_QUERY ); + } + + if( xLibContainer.is() && xLibContainer->hasByName( aLibName ) && + !xLibContainer->isLibraryLoaded( aLibName ) ) + { + xLibContainer->loadLibrary( aLibName ); + } + + BOOL bOK = TRUE; if ( pBasMgr->HasPassword( nLib ) && !pBasMgr->IsPasswordVerified( nLib ) ) |