diff options
author | Andreas Bregas <ab@openoffice.org> | 2001-03-28 10:12:39 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2001-03-28 10:12:39 +0000 |
commit | fdc3629c289541527cf457095f831642d984c8a9 (patch) | |
tree | 2b13ca0c1969d7624c1e6994a391b0f3d237f8f7 /sfx2/source/appl/appbas.cxx | |
parent | 6f14d2e7f45efefc042973b8fabf6a3cabc2d35e (diff) |
Integrated Basic library container
Diffstat (limited to 'sfx2/source/appl/appbas.cxx')
-rw-r--r-- | sfx2/source/appl/appbas.cxx | 81 |
1 files changed, 64 insertions, 17 deletions
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 6715a490eff6..baaae9536520 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -2,9 +2,9 @@ * * $RCSfile: appbas.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ab $ $Date: 2001-03-09 11:03:00 $ + * last change: $Author: ab $ $Date: 2001-03-28 11:10:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -176,6 +176,7 @@ #include "appimp.hxx" #include "basmgr.hxx" #include "dlgcont.hxx" +#include "scriptcont.hxx" #include "helper.hxx" #define ITEMID_SEARCH SID_SEARCH_ITEM @@ -533,11 +534,6 @@ SbxVariable* SfxConstants_Impl::Find //========================================================================= sal_uInt16 SfxApplication::SaveBasicManager() const { - // Save Dialog Container - sal_Bool bComplete = sal_False; - if( pImp->pDialogContainer ) - pImp->pDialogContainer->storeLibraries( bComplete ); - // MT: #47347# AppBasicDir ist jetzt ein PATH! // Ncht den vom BasicManager, falls inzwischen der Pfad geaendert wurde !? // So wird natuerlich auch das erste Dir genommen, wenn der BasicManager @@ -567,6 +563,26 @@ sal_uInt16 SfxApplication::SaveBasicManager() const } //-------------------------------------------------------------------- +sal_uInt16 SfxApplication::SaveDialogContainer() const +{ + // Save Dialog Container + sal_Bool bComplete = sal_False; + if( pImp->pDialogLibContainer ) + pImp->pDialogLibContainer->storeLibraries( bComplete ); + return 0; +} + +//-------------------------------------------------------------------- +sal_uInt16 SfxApplication::SaveBasicContainer() const +{ + // Save Dialog Container + sal_Bool bComplete = sal_False; + if( pImp->pBasicLibContainer ) + pImp->pBasicLibContainer->storeLibraries( bComplete ); + return 0; +} + +//-------------------------------------------------------------------- void SfxApplication::RegisterBasicConstants ( @@ -764,18 +780,40 @@ BasicManager* SfxApplication::GetBasicManager() pBas->Insert( xUnoObj ); //pBas->setRoot( xDesktop ); + // Basic container + SfxScriptLibraryContainer* pBasicCont = new SfxScriptLibraryContainer + ( DEFINE_CONST_UNICODE( "StarBasic" ), pSfxBasicManager ); + pBasicCont->acquire(); // Hold via UNO + pImp->pBasicLibContainer = pBasicCont; + // Dialog container - SfxDialogContainer* pDlgCont = new SfxDialogContainer( sal_True ); - pDlgCont->acquire(); // Hold via UNO - pImp->pDialogContainer = pDlgCont; - pSfxBasicManager->SetDialogContainer( pImp->pDialogContainer ); - - Reference< XLibraryContainer > xDlgCont = static_cast< XLibraryContainer* >( pDlgCont ); - Any aDlgCont; - aDlgCont <<= xDlgCont; - xUnoObj = GetSbUnoObject( DEFINE_CONST_UNICODE("Dialogs"), aDlgCont ); + SfxDialogLibraryContainer* pDialogCont = new SfxDialogLibraryContainer(); + pDialogCont->acquire(); // Hold via UNO + pImp->pDialogLibContainer = pDialogCont; + + BasicManagerImpl* pBasMgrImpl = new BasicManagerImpl(); + pBasMgrImpl->pScriptCont = pBasicCont; + pBasMgrImpl->pDialogCont = pDialogCont; + pSfxBasicManager->SetImpl( pBasMgrImpl ); + + + Reference< XLibraryContainer > xBasicCont = static_cast< XLibraryContainer* >( pBasicCont ); + Any aBasicCont; + aBasicCont <<= xBasicCont; + xUnoObj = GetSbUnoObject( DEFINE_CONST_UNICODE("BasicLibraries"), aBasicCont ); + pBas->Insert( xUnoObj ); + + Reference< XLibraryContainer > xDialogCont = static_cast< XLibraryContainer* >( pDialogCont ); + Any aDialogCont; + aDialogCont <<= xDialogCont; + xUnoObj = GetSbUnoObject( DEFINE_CONST_UNICODE("Dialogs"), aDialogCont ); pBas->Insert( xUnoObj ); + SbxVariableRef pGlobal = new SbxVariable( SbxOBJECT, pBas ); + pGlobal->SetFlag( SBX_DONTSTORE ); + pGlobal->SetName( String( DEFINE_CONST_UNICODE("GlobalScope") ) ); + pBas->Insert( pGlobal ); + // Konstanten //ASDBG RegisterBasicConstants( "so", aConstants, sizeof(aConstants)/sizeof(SfxConstant) ); @@ -791,7 +829,16 @@ BasicManager* SfxApplication::GetBasicManager() Reference< XLibraryContainer > SfxApplication::GetDialogContainer() { Reference< XLibraryContainer > xRet - = static_cast< XLibraryContainer* >( pImp->pDialogContainer ); + = static_cast< XLibraryContainer* >( pImp->pDialogLibContainer ); + return xRet; +} + +//-------------------------------------------------------------------- + +Reference< XLibraryContainer > SfxApplication::GetBasicContainer() +{ + Reference< XLibraryContainer > xRet + = static_cast< XLibraryContainer* >( pImp->pBasicLibContainer ); return xRet; } |