summaryrefslogtreecommitdiff
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.cxx24
1 files changed, 23 insertions, 1 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 657ecd03f4..06f4ecf22d 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
{
@@ -327,6 +326,7 @@ DBG_NAME( SfxLibraryContainer )
// Ctor
SfxLibraryContainer::SfxLibraryContainer( void )
: LibraryContainerHelper( maMutex )
+ , mbVBACompat( sal_False )
, maModifiable( *this, maMutex )
, maNameContainer( getCppuType( (Reference< XNameAccess >*) NULL ) )
, mbOldInfoFormat( sal_False )
@@ -2785,6 +2785,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)