summaryrefslogtreecommitdiffstats
path: root/basic/source/uno/namecont.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/uno/namecont.cxx')
-rw-r--r--basic/source/uno/namecont.cxx25
1 files changed, 23 insertions, 2 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 6ccb7e81d2c4..05134620f173 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -73,7 +73,6 @@
#include <cppuhelper/exc_hlp.hxx>
#include <basic/sbmod.hxx>
-
namespace basic
{
@@ -332,7 +331,7 @@ SfxLibraryContainer::SfxLibraryContainer( void )
, mbOldInfoFormat( sal_False )
, mbOasis2OOoFormat( sal_False )
, mpBasMgr( NULL )
- , mbOwnBasMgr( sal_False )
+ , mbOwnBasMgr( sal_False ), mbVBACompat( sal_False )
{
DBG_CTOR( SfxLibraryContainer, NULL );
@@ -2726,6 +2725,28 @@ OUString SfxLibraryContainer::expand_url( const OUString& url )
}
}
+::sal_Bool SAL_CALL SfxLibraryContainer::getVBACompatModeOn() throw (RuntimeException)
+{
+ return mbVBACompat;
+}
+
+void SAL_CALL SfxLibraryContainer::setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (RuntimeException)
+{
+ BasicManager* pBasMgr = getBasicManager();
+ if( pBasMgr )
+ {
+ // get the standard library
+ String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
+ if ( pBasMgr->GetName().Len() )
+ aLibName = pBasMgr->GetName();
+
+ StarBASIC* pBasic = pBasMgr->GetLib( aLibName );
+ if( pBasic )
+ pBasic->SetVBAEnabled( _vbacompatmodeon );
+ }
+ mbVBACompat = _vbacompatmodeon;
+}
+
// Methods XServiceInfo
::sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const ::rtl::OUString& _rServiceName )
throw (RuntimeException)