summaryrefslogtreecommitdiffstats
path: root/sfx2
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-03-05 02:00:40 +0200
committerTor Lillqvist <tml@iki.fi>2012-03-05 02:05:30 +0200
commite42515549eae51fa625b2d8789f20a5065365ac5 (patch)
tree2af9385edcdd9a87361f8869349c6f4f57f82119 /sfx2
parentWorkaround for weird gbuild looping problem with Clang for iOS (diff)
downloadcore-e42515549eae51fa625b2d8789f20a5065365ac5.tar.gz
core-e42515549eae51fa625b2d8789f20a5065365ac5.zip
Sprinkle DISABLE_SCRIPTING ifdefs
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/app.cxx34
-rw-r--r--sfx2/source/appl/appbas.cxx36
-rw-r--r--sfx2/source/appl/appbaslib.cxx16
-rw-r--r--sfx2/source/appl/appdata.cxx8
-rw-r--r--sfx2/source/appl/appdde.cxx3
-rw-r--r--sfx2/source/appl/appquit.cxx5
-rw-r--r--sfx2/source/appl/appserv.cxx6
-rw-r--r--sfx2/source/appl/appuno.cxx7
-rw-r--r--sfx2/source/doc/objserv.cxx4
-rw-r--r--sfx2/source/doc/objstor.cxx9
-rw-r--r--sfx2/source/doc/objxtor.cxx35
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx31
-rw-r--r--sfx2/source/view/viewfrm.cxx4
13 files changed, 192 insertions, 6 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 231a2570c613..e792eea8e923 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -140,7 +140,9 @@ using namespace ::com::sun::star;
// Static member
SfxApplication* SfxApplication::pApp = NULL;
+#ifndef DISABLE_SCRIPTING
static BasicDLL* pBasic = NULL;
+#endif
static SfxHelp* pSfxHelp = NULL;
namespace
@@ -223,8 +225,10 @@ SfxApplication::SfxApplication()
pSfxHelp = new SfxHelp;
+#ifndef DISABLE_SCRIPTING
pBasic = new BasicDLL;
StarBASIC::SetGlobalErrorHdl( LINK( this, SfxApplication, GlobalBasicErrorHdl_Impl ) );
+#endif
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} initialize DDE" );
}
@@ -241,8 +245,9 @@ SfxApplication::~SfxApplication()
// delete global options
SvtViewOptions::ReleaseOptions();
+#ifndef DISABLE_SCRIPTING
delete pBasic;
-
+#endif
if ( !pAppData_Impl->bDowning )
Deinitialize();
@@ -482,14 +487,22 @@ void SfxApplication::Invalidate( sal_uInt16 nId )
#define DOSTRING( x ) #x
#define STRING( x ) DOSTRING( x )
+#ifndef DISABLE_SCRIPTING
+
typedef long (SAL_CALL *basicide_handle_basic_error)(void*);
typedef rtl_uString* (SAL_CALL *basicide_choose_macro)(void*, sal_Bool, rtl_uString*);
typedef void* (SAL_CALL *basicide_macro_organizer)(sal_Int16);
extern "C" { static void SAL_CALL thisModule() {} }
+#endif
+
IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic )
{
+#ifdef DISABLE_SCRIPTING
+ (void) pStarBasic;
+ return 0;
+#else
// get basctl dllname
static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
@@ -505,12 +518,16 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic )
long nRet = pSymbol ? pSymbol( pStarBasic ) : 0;
return nRet;
+#endif
}
sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL )
{
sal_Bool result = sal_False;
+#ifdef DISABLE_SCRIPTING
+ (void) rScriptURL;
+#else
::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory > xSMgr =
::comphelper::getProcessServiceFactory();
@@ -541,6 +558,7 @@ sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL )
// ignore, will just return FALSE
}
}
+#endif
return result;
}
@@ -549,6 +567,7 @@ SfxApplication::ChooseScript()
{
::rtl::OUString aScriptURL;
+#ifndef DISABLE_SCRIPTING
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -574,11 +593,15 @@ SfxApplication::ChooseScript()
delete pDlg;
}
+#endif
return aScriptURL;
}
void SfxApplication::MacroOrganizer( sal_Int16 nTabId )
{
+#ifdef DISABLE_SCRIPTING
+ (void) nTabId;
+#else
// get basctl dllname
static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
@@ -592,11 +615,20 @@ void SfxApplication::MacroOrganizer( sal_Int16 nTabId )
// call basicide_choose_macro in basctl
pSymbol( nTabId );
+#endif
}
ErrCode SfxApplication::CallBasic( const String& rCode, BasicManager* pMgr, SbxArray* pArgs, SbxValue* pRet )
{
+#ifdef DISABLE_SCRIPTING
+ (void) rCode;
+ (void) pMgr;
+ (void) pArgs;
+ (void) pRet;
+ return ERRCODE_BASIC_CANNOT_LOAD;
+#else
return pMgr->ExecuteMacro( rCode, pArgs, pRet);
+#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 12ef3f0226da..0018663e83e8 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -138,48 +138,79 @@ sal_uInt16 SfxApplication::SaveBasicAndDialogContainer() const
SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject,
const char *pName, sal_uInt32 nSID, SbxDataType eType, SbxClassType eClassType )
{
+#ifdef DISABLE_SCRIPTING
+ (void) pBas;
+ (void) pObject;
+ (void) pName;
+ (void) nSID;
+ (void) eType;
+ (void) eClassType;
+ return 0;
+#else
SbxVariable *pVar = pBas->Make( String::CreateFromAscii(pName), eClassType, eType ); //SbxCLASS_PROPERTY
pVar->SetUserData( nSID );
pVar->SetFlag( SBX_DONTSTORE );
pObject->StartListening( pVar->GetBroadcaster() );
return pVar;
+#endif
}
//--------------------------------------------------------------------
BasicManager* SfxApplication::GetBasicManager()
{
+#ifdef DISABLE_SCRIPTING
+ return 0;
+#else
return BasicManagerRepository::getApplicationBasicManager( true );
+#endif
}
//--------------------------------------------------------------------
Reference< XLibraryContainer > SfxApplication::GetDialogContainer()
{
+#ifdef DISABLE_SCRIPTING
+ Reference< XLibraryContainer > dummy;
+ return dummy;
+#else
if ( !pAppData_Impl->pBasicManager->isValid() )
GetBasicManager();
return pAppData_Impl->pBasicManager->getLibraryContainer( SfxBasicManagerHolder::DIALOGS );
+#endif
}
//--------------------------------------------------------------------
Reference< XLibraryContainer > SfxApplication::GetBasicContainer()
{
+#ifdef DISABLE_SCRIPTING
+ Reference< XLibraryContainer > dummy;
+ return dummy;
+#else
if ( !pAppData_Impl->pBasicManager->isValid() )
GetBasicManager();
return pAppData_Impl->pBasicManager->getLibraryContainer( SfxBasicManagerHolder::SCRIPTS );
+#endif
}
//--------------------------------------------------------------------
StarBASIC* SfxApplication::GetBasic()
{
+#ifdef DISABLE_SCRIPTING
+ return 0;
+#else
return GetBasicManager()->GetLib(0);
+#endif
}
//-------------------------------------------------------------------------
void SfxApplication::PropExec_Impl( SfxRequest &rReq )
{
+#ifdef DISABLE_SCRIPTING
+ (void) rReq;
+#else
rReq.GetArgs();
sal_uInt16 nSID = rReq.GetSlot();
switch ( nSID )
@@ -244,11 +275,15 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
break;
}
}
+#endif
}
//-------------------------------------------------------------------------
void SfxApplication::PropState_Impl( SfxItemSet &rSet )
{
+#ifdef DISABLE_SCRIPTING
+ (void) rSet;
+#else
SfxWhichIter aIter(rSet);
for ( sal_uInt16 nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
{
@@ -288,6 +323,7 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet )
}
}
}
+#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index a5b6e337ff6e..a8fb71ed2e6e 100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -55,6 +55,7 @@ void SfxBasicManagerHolder::reset( BasicManager* _pBasicManager )
{
impl_releaseContainers();
+#ifndef DISABLE_SCRIPTING
// Note: we do not delete the old BasicManager. BasicManager instances are
// nowadays obtained from the BasicManagerRepository, and the ownership is with
// the repository.
@@ -74,10 +75,12 @@ void SfxBasicManagerHolder::reset( BasicManager* _pBasicManager )
DBG_UNHANDLED_EXCEPTION();
}
}
+#endif
}
void SfxBasicManagerHolder::storeAllLibraries()
{
+#ifndef DISABLE_SCRIPTING
OSL_PRECOND( isValid(), "SfxBasicManagerHolder::storeAllLibraries: not initialized!" );
try
{
@@ -90,10 +93,14 @@ void SfxBasicManagerHolder::storeAllLibraries()
{
DBG_UNHANDLED_EXCEPTION();
}
+#endif
}
void SfxBasicManagerHolder::setStorage( const Reference< XStorage >& _rxStorage )
{
+#ifdef DISABLE_SCRIPTING
+ (void) _rxStorage;
+#else
try
{
if ( mxBasicContainer.is() )
@@ -105,16 +112,21 @@ void SfxBasicManagerHolder::setStorage( const Reference< XStorage >& _rxStorage
{
DBG_UNHANDLED_EXCEPTION();
}
+#endif
}
void SfxBasicManagerHolder::storeLibrariesToStorage( const Reference< XStorage >& _rxStorage )
{
+#ifdef DISABLE_SCRIPTING
+ (void) _rxStorage;
+#else
OSL_PRECOND( isValid(), "SfxBasicManagerHolder::storeLibrariesToStorage: not initialized!" );
if ( mxBasicContainer.is() )
mxBasicContainer->storeLibrariesToStorage( _rxStorage );
if ( mxDialogContainer.is() )
mxDialogContainer->storeLibrariesToStorage( _rxStorage );
+#endif
}
Reference< XLibraryContainer > SfxBasicManagerHolder::getLibraryContainer( ContainerType _eType )
@@ -139,8 +151,12 @@ void SfxBasicManagerHolder::impl_releaseContainers()
sal_Bool
SfxBasicManagerHolder::LegacyPsswdBinaryLimitExceeded( Sequence< rtl::OUString >& sModules )
{
+#ifdef DISABLE_SCRIPTING
+ (void) sModules;
+#else
if ( mpBasicManager )
return mpBasicManager->LegacyPsswdBinaryLimitExceeded( sModules );
+#endif
return sal_True;
}
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 0358dd4a19c6..a5904eb7fc8f 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -132,7 +132,9 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* )
, bODFVersionWarningLater( sal_False )
{
+#ifndef DISABLE_SCRIPTING
BasicManagerRepository::registerCreationListener( *pBasMgrListener );
+#endif
}
SfxAppData_Impl::~SfxAppData_Impl()
@@ -141,8 +143,10 @@ SfxAppData_Impl::~SfxAppData_Impl()
delete pTopFrames;
delete pBasicManager;
+#ifndef DISABLE_SCRIPTING
BasicManagerRepository::revokeCreationListener( *pBasMgrListener );
delete pBasMgrListener;
+#endif
}
SfxDocumentTemplates* SfxAppData_Impl::GetDocumentTemplates()
@@ -156,12 +160,16 @@ SfxDocumentTemplates* SfxAppData_Impl::GetDocumentTemplates()
void SfxAppData_Impl::OnApplicationBasicManagerCreated( BasicManager& _rBasicManager )
{
+#ifdef DISABLE_SCRIPTING
+ (void) _rBasicManager;
+#else
pBasicManager->reset( &_rBasicManager );
// global constants, additionally to the ones already added by createApplicationBasicManager:
// ThisComponent
Reference< XInterface > xCurrentComponent = SfxObjectShell::GetCurrentComponent();
_rBasicManager.SetGlobalUNOConstant( "ThisComponent", makeAny( xCurrentComponent ) );
+#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 65be1fcb6120..d46a016cb2c0 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -350,6 +350,7 @@ long SfxObjectShell::DdeExecute
*/
{
+#ifndef DISABLE_SCRIPTING
StarBASIC* pBasic = GetBasic();
DBG_ASSERT( pBasic, "Where is the Basic???" ) ;
SbxVariable* pRet = pBasic->Execute( rCmd );
@@ -358,7 +359,7 @@ long SfxObjectShell::DdeExecute
SbxBase::ResetError();
return 0;
}
-
+#endif
return 1;
}
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index f5a8f59a325d..b78b30e6e0ac 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -90,6 +90,7 @@ void SfxApplication::Deinitialize()
if ( pAppData_Impl->bDowning )
return;
+#ifndef DISABLE_SCRIPTING
StarBASIC::Stop();
// Save BASIC if possible
@@ -98,6 +99,7 @@ void SfxApplication::Deinitialize()
SaveBasicManager();
SaveBasicAndDialogContainer();
+#endif
pAppData_Impl->bDowning = sal_True; // due to Timer from DecAliveCount and QueryExit
@@ -122,9 +124,12 @@ void SfxApplication::Deinitialize()
// Release Controller and others
// then the remaining components should alse disapear ( Beamer! )
+
+#ifndef DISABLE_SCRIPTING
BasicManagerRepository::resetApplicationBasicManager();
pAppData_Impl->pBasicManager->reset( NULL );
// this will also delete pBasMgr
+#endif
DBG_ASSERT( pAppData_Impl->pViewFrame == 0, "active foreign ViewFrame" );
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 8070b51d455b..24e818800188 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -532,6 +532,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
break;
}
+#ifndef DISABLE_SCRIPTING
case SID_BASICSTOP:
StarBASIC::Stop();
break;
@@ -539,6 +540,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_BASICBREAK :
BASIC_DLL()->BasicBreak();
break;
+#endif
case SID_CRASH :
{
@@ -666,10 +668,12 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
break;
}
+#ifndef DISABLE_SCRIPTING
case SID_BASICSTOP:
if ( !StarBASIC::IsRunning() )
rSet.DisableItem(nWhich);
break;
+#endif
case SID_HELPTIPS:
{
@@ -1174,8 +1178,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
String aPLZ = pStringItem->GetValue();
bRet = sal_True /*!!!SfxIniManager::CheckPLZ( aPLZ )*/;
}
+#ifndef DISABLE_SCRIPTING
else
SbxBase::SetError( SbxERR_WRONG_ARGS );
+#endif
rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bRet ) );
}
break;
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 6026f19a4580..fe9e65a082a9 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1766,6 +1766,12 @@ void SAL_CALL SfxMacroLoader::removeStatusListener(
ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::uno::Any& rRetval, SfxObjectShell* pSh )
throw ( ::com::sun::star::uno::RuntimeException )
{
+#ifdef DISABLE_SCRIPTING
+ (void) rURL;
+ (void) rRetval;
+ (void) pSh;
+ return ERRCODE_BASIC_PROC_UNDEFINED;
+#else
SfxObjectShell* pCurrent = pSh;
if ( !pCurrent )
// all not full qualified names use the BASIC of the given or current document
@@ -1905,6 +1911,7 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::
SbxBase::ResetError();
return nErr;
+#endif
}
SFX_IMPL_XSERVICEINFO( SfxAppDispatchProvider, "com.sun.star.frame.DispatchProvider", "com.sun.star.comp.sfx2.AppDispatchProvider" ) \
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index bce45ff33e3a..34565c86b979 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -766,7 +766,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
{
if ( !pNameItem )
{
+#ifndef DISABLE_SCRIPTING
SbxBase::SetError( SbxERR_WRONG_ARGS );
+#endif
rReq.Ignore();
return;
}
@@ -836,7 +838,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( (!pRegionItem && !pRegionNrItem ) || !pNameItem )
{
DBG_ASSERT( rReq.IsAPI(), "non-API call without Arguments" );
+#ifndef DISABLE_SCRIPTING
SbxBase::SetError( SbxERR_WRONG_ARGS );
+#endif
rReq.Ignore();
return;
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 604d824f090b..dac0751c3c4e 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -996,7 +996,7 @@ sal_Bool SfxObjectShell::DoSave()
}
else
bOk = sal_True;
-
+#ifndef DISABLE_SCRIPTING
if ( HasBasic() )
{
try
@@ -1033,6 +1033,7 @@ sal_Bool SfxObjectShell::DoSave()
bOk = sal_False;
}
}
+#endif
}
if ( bOk )
@@ -3005,7 +3006,7 @@ sal_Bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
sal_Bool bTemplate = ( rMedium.GetFilter()->IsOwnTemplateFormat() && nVersion > SOFFICE_FILEFORMAT_60 );
SetupStorage( xStorage, nVersion, bTemplate );
-
+#ifndef DISABLE_SCRIPTING
if ( HasBasic() )
{
// Initialize Basic
@@ -3014,7 +3015,7 @@ sal_Bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
// Save dialog/script container
pImp->pBasicManager->storeLibrariesToStorage( xStorage );
}
-
+#endif
return SaveAs( rMedium );
}
else return sal_False;
@@ -3552,6 +3553,7 @@ void SfxObjectShell::SetConfigOptionsChecked( sal_Bool bChecked )
sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< task::XInteractionHandler >& xHandler )
{
+#ifndef DISABLE_SCRIPTING
if ( !HasBasic() )
return sal_True;
@@ -3568,6 +3570,7 @@ sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference
return pReq->isApprove();
}
}
+#endif
// No interaction handler, default is to continue to save
return sal_True;
}
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 1cda68be05ae..9e20d837b85d 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -126,6 +126,8 @@ namespace {
static WeakReference< XInterface > s_xCurrentComponent;
+#ifndef DISABLE_SCRIPTING
+
// remember all registered components for VBA compatibility, to be able to remove them on disposing the model
typedef ::std::map< XInterface*, ::rtl::OString > VBAConstantNameMap;
static VBAConstantNameMap s_aRegisteredVBAConstants;
@@ -151,6 +153,8 @@ static VBAConstantNameMap s_aRegisteredVBAConstants;
return ::rtl::OString();
}
+#endif
+
} // namespace
//=========================================================================
@@ -188,6 +192,7 @@ void SAL_CALL SfxModelListener_Impl::disposing( const com::sun::star::lang::Even
SfxObjectShell::SetCurrentComponent( Reference< XInterface >() );
}
+#ifndef DISABLE_SCRIPTING
/* Remove VBA component from AppBasic. As every application registers its
own current component, the disposed component may not be the "current
component" of the SfxObjectShell. */
@@ -201,6 +206,7 @@ void SAL_CALL SfxModelListener_Impl::disposing( const com::sun::star::lang::Even
s_aRegisteredVBAConstants.erase( aIt );
}
}
+#endif
if ( mpDoc->Get_Impl()->bHiddenLockedByAPI )
{
@@ -675,6 +681,7 @@ sal_uInt16 SfxObjectShell::PrepareClose
}
//--------------------------------------------------------------------
+#ifndef DISABLE_SCRIPTING
namespace
{
static BasicManager* lcl_getBasicManagerForDocument( const SfxObjectShell& _rDocument )
@@ -708,15 +715,20 @@ namespace
return pBasMgr;
}
}
+#endif
//--------------------------------------------------------------------
BasicManager* SfxObjectShell::GetBasicManager() const
{
+#ifdef DISABLE_SCRIPTING
+ return NULL;
+#else
BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
if ( !pBasMgr )
pBasMgr = SFX_APP()->GetBasicManager();
return pBasMgr;
+#endif
}
//--------------------------------------------------------------------
@@ -730,6 +742,9 @@ void SfxObjectShell::SetHasNoBasic()
sal_Bool SfxObjectShell::HasBasic() const
{
+#ifdef DISABLE_SCRIPTING
+ return sal_False;
+#else
if ( pImp->m_bNoBasicCapabilities )
return sal_False;
@@ -737,9 +752,11 @@ sal_Bool SfxObjectShell::HasBasic() const
const_cast< SfxObjectShell* >( this )->InitBasicManager_Impl();
return pImp->pBasicManager->isValid();
+#endif
}
//--------------------------------------------------------------------
+#ifndef DISABLE_SCRIPTING
namespace
{
const Reference< XLibraryContainer >&
@@ -768,11 +785,12 @@ namespace
return _rxContainer;
}
}
-
+#endif
//--------------------------------------------------------------------
Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer()
{
+#ifndef DISABLE_SCRIPTING
if ( !pImp->m_bNoBasicCapabilities )
return lcl_getOrCreateLibraryContainer( false, pImp->xDialogLibraries, GetModel() );
@@ -781,6 +799,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer()
return pBasMgr->GetDialogLibraryContainer().get();
OSL_FAIL( "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?" );
+#endif
return SFX_APP()->GetDialogContainer();
}
@@ -788,6 +807,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer()
Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
{
+#ifndef DISABLE_SCRIPTING
if ( !pImp->m_bNoBasicCapabilities )
return lcl_getOrCreateLibraryContainer( true, pImp->xBasicLibraries, GetModel() );
@@ -796,6 +816,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
return pBasMgr->GetScriptLibraryContainer().get();
OSL_FAIL( "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?" );
+#endif
return SFX_APP()->GetBasicContainer();
}
@@ -803,7 +824,11 @@ Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
StarBASIC* SfxObjectShell::GetBasic() const
{
+#ifdef DISABLE_SCRIPTING
+ return NULL;
+#else
return GetBasicManager()->GetLib(0);
+#endif
}
//--------------------------------------------------------------------
@@ -845,10 +870,12 @@ void SfxObjectShell::InitBasicManager_Impl()
does not take ownership but stores only the raw pointer. Owner of all
Basic managers is the global BasicManagerRepository instance.
*/
+#ifndef DISABLE_SCRIPTING
DBG_ASSERT( !pImp->bBasicInitialized && !pImp->pBasicManager->isValid(), "Lokaler BasicManager bereits vorhanden");
pImp->pBasicManager->reset( BasicManagerRepository::getDocumentBasicManager( GetModel() ) );
DBG_ASSERT( pImp->pBasicManager->isValid(), "SfxObjectShell::InitBasicManager_Impl: did not get a BasicManager!" );
pImp->bBasicInitialized = sal_True;
+#endif
}
//--------------------------------------------------------------------
@@ -930,6 +957,7 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
// In other words, it's still possible that we here do something which is not necessary,
// but we should have filtered quite some unnecessary calls already.
+#ifndef DISABLE_SCRIPTING
BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
s_xCurrentComponent = _rxComponent;
if ( pAppMgr )
@@ -958,6 +986,7 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
}
}
}
+#endif
}
Reference< XInterface > SfxObjectShell::GetCurrentComponent()
@@ -1022,14 +1051,18 @@ String SfxObjectShell::GetServiceNameFromFactory( const String& rFact )
{
aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.formula.FormulaProperties"));
}
+#ifndef DISABLE_SCRIPTING
else if ( aFact.EqualsAscii("sbasic") )
{
aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.BasicIDE"));
}
+#endif
+#ifndef DISABLE_DBCONNECTIVITY
else if ( aFact.EqualsAscii("sdatabase") )
{
aServiceName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument"));
}
+#endif
return aServiceName;
}
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 1ff0f27b52bc..b4e0d0a67fab 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -672,16 +672,26 @@ uno::Sequence< sal_Int8 > SAL_CALL SfxBaseModel::getImplementationId() throw( un
uno::Reference< script::XStarBasicAccess > implGetStarBasicAccess( SfxObjectShell* pObjectShell )
{
uno::Reference< script::XStarBasicAccess > xRet;
+
+#ifdef DISABLE_SCRIPTING
+ (void) pObjectShell;
+#else
if( pObjectShell )
{
BasicManager* pMgr = pObjectShell->GetBasicManager();
xRet = getStarBasicAccess( pMgr );
}
+#endif
return xRet;
}
uno::Reference< XNAMECONTAINER > SAL_CALL SfxBaseModel::getLibraryContainer() throw( uno::RuntimeException )
{
+#ifdef DISABLE_SCRIPTING
+ uno::Reference< XNAMECONTAINER > dummy;
+
+ return dummy;
+#else
SfxModelGuard aGuard( *this );
uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
@@ -692,6 +702,7 @@ uno::Reference< XNAMECONTAINER > SAL_CALL SfxBaseModel::getLibraryContainer() th
if( rxAccess.is() )
xRet = rxAccess->getLibraryContainer();
return xRet;
+#endif
}
/**___________________________________________________________________________________________________
@@ -701,6 +712,12 @@ void SAL_CALL SfxBaseModel::createLibrary( const ::rtl::OUString& LibName, const
const ::rtl::OUString& ExternalSourceURL, const ::rtl::OUString& LinkTargetURL )
throw(ELEMENTEXISTEXCEPTION, uno::RuntimeException)
{
+#ifdef DISABLE_SCRIPTING
+ (void) LibName;
+ (void) Password;
+ (void) ExternalSourceURL;
+ (void) LinkTargetURL;
+#else
SfxModelGuard aGuard( *this );
uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
@@ -709,6 +726,7 @@ void SAL_CALL SfxBaseModel::createLibrary( const ::rtl::OUString& LibName, const
if( rxAccess.is() )
rxAccess->createLibrary( LibName, Password, ExternalSourceURL, LinkTargetURL );
+#endif
}
/**___________________________________________________________________________________________________
@@ -718,6 +736,12 @@ void SAL_CALL SfxBaseModel::addModule( const ::rtl::OUString& LibraryName, const
const ::rtl::OUString& Language, const ::rtl::OUString& Source )
throw( NOSUCHELEMENTEXCEPTION, uno::RuntimeException)
{
+#ifdef DISABLE_SCRIPTING
+ (void) LibraryName;
+ (void) ModuleName;
+ (void) Language;
+ (void) Source;
+#else
SfxModelGuard aGuard( *this );
uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
@@ -726,6 +750,7 @@ void SAL_CALL SfxBaseModel::addModule( const ::rtl::OUString& LibraryName, const
if( rxAccess.is() )
rxAccess->addModule( LibraryName, ModuleName, Language, Source );
+#endif
}
/**___________________________________________________________________________________________________
@@ -735,6 +760,11 @@ void SAL_CALL SfxBaseModel::addDialog( const ::rtl::OUString& LibraryName, const
const ::com::sun::star::uno::Sequence< sal_Int8 >& Data )
throw(NOSUCHELEMENTEXCEPTION, uno::RuntimeException)
{
+#ifdef DISABLE_SCRIPTING
+ (void) LibraryName;
+ (void) DialogName;
+ (void) Data;
+#else
SfxModelGuard aGuard( *this );
uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
@@ -743,6 +773,7 @@ void SAL_CALL SfxBaseModel::addDialog( const ::rtl::OUString& LibraryName, const
if( rxAccess.is() )
rxAccess->addDialog( LibraryName, DialogName, Data );
+#endif
}
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 62e11ba75bdf..0b8a3eb8b728 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2637,6 +2637,9 @@ void CutLines( ::rtl::OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, sa
*/
void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro )
{
+#ifdef DISABLE_SCRIPTING
+ (void) sMacro;
+#else
if ( sMacro.isEmpty() )
return;
@@ -2816,6 +2819,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro )
{
// add code for "session only" macro
}
+#endif
}
void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )