summaryrefslogtreecommitdiff
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
parentaf9618b29f186c3991d9225cc50b55dc78612f27 (diff)
Sprinkle DISABLE_SCRIPTING ifdefs
-rw-r--r--sc/source/core/tool/interpr4.cxx3
-rw-r--r--sc/source/filter/excel/excimp8.cxx2
-rw-r--r--sc/source/ui/app/typemap.cxx71
-rw-r--r--sc/source/ui/docshell/docsh4.cxx6
-rw-r--r--sc/source/ui/unoobj/servuno.cxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx4
-rw-r--r--sc/source/ui/view/cellsh2.cxx2
-rw-r--r--sc/source/ui/view/tabvwshf.cxx4
-rw-r--r--sc/source/ui/view/tabvwshh.cxx2
-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
-rw-r--r--svx/source/form/fmscriptingenv.cxx5
-rw-r--r--sw/source/ui/app/docsh.cxx2
24 files changed, 268 insertions, 33 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 56af5a140443..9c6794b4e0e4 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3108,12 +3108,13 @@ lcl_setVBARange( ScRange& aRange, ScDocument* pDok, SbxVariable* pPar )
void ScInterpreter::ScMacro()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMacro" );
- SbxBase::ResetError();
#ifdef DISABLE_SCRIPTING
PushNoValue(); // ohne DocShell kein CallBasic
return;
#else
+ SbxBase::ResetError();
+
sal_uInt8 nParamCount = GetByte();
String aMacro( pCur->GetExternal() );
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index ef09d2b77b7c..41d8c38ffb8c 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -392,9 +392,11 @@ void ImportExcel8::EndSheet( void )
void ImportExcel8::PostDocLoad( void )
{
+#ifndef DISABLE_SCRIPTING
// reading basic has been delayed until sheet objects (codenames etc.) are read
if( HasBasic() )
ReadBasic();
+#endif
// #i11776# filtered ranges before outlines and hidden rows
if( pExcRoot->pAutoFilterBuffer )
pExcRoot->pAutoFilterBuffer->Apply();
diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx
index 1d4c3a05698a..257d9111e73c 100644
--- a/sc/source/ui/app/typemap.cxx
+++ b/sc/source/ui/app/typemap.cxx
@@ -26,39 +26,13 @@
*
************************************************************************/
-
-
#include <svx/svxids.hrc>
#include "sc.hrc"
#include "scitems.hxx"
#include <editeng/memberids.hrc>
-
#define ITEMID_DBTYPE 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#include <sfx2/msg.hxx>
#include <svl/stritem.hxx>
#include <svl/slstitm.hxx>
@@ -132,7 +106,52 @@
#define SvxChooseControlItem SfxEnumItem
#define avmedia_MediaItem ::avmedia::MediaItem
+#if defined(IOS)
+/* Avoid clash with the ones from svx/source/form/typemap.cxx */
+#define aSfxBoolItem_Impl sc_source_ui_appl_typemap_aSfxBoolItem_Impl
+#define aSfxInt32Item_Impl sc_source_ui_appl_typemap_aSfxInt32Item_Impl
+#define aSfxObjectItem_Impl sc_source_ui_appl_typemap_aSfxObjectItem_Impl
+#define aSfxStringItem_Impl sc_source_ui_appl_typemap_aSfxStringItem_Impl
+#define aSfxUInt16Item_Impl sc_source_ui_appl_typemap_aSfxUInt16Item_Impl
+#define aSfxUInt32Item_Impl sc_source_ui_appl_typemap_aSfxUInt32Item_Impl
+#define aSfxVoidItem_Impl sc_source_ui_appl_typemap_aSfxVoidItem_Impl
+#define aSvxCharReliefItem_Impl sc_source_ui_appl_typemap_aSvxCharReliefItem_Impl
+#define aSvxClipboardFmtItem_Impl sc_source_ui_appl_typemap_aSvxClipboardFmtItem_Impl
+#define aSvxColorItem_Impl sc_source_ui_appl_typemap_aSvxColorItem_Impl
+#define aSvxContourItem_Impl sc_source_ui_appl_typemap_aSvxContourItem_Impl
+#define aSvxCrossedOutItem_Impl sc_source_ui_appl_typemap_aSvxCrossedOutItem_Impl
+#define aSvxFontHeightItem_Impl sc_source_ui_appl_typemap_aSvxFontHeightItem_Impl
+#define aSvxFontItem_Impl sc_source_ui_appl_typemap_aSvxFontItem_Impl
+#define aSvxLanguageItem_Impl sc_source_ui_appl_typemap_aSvxLanguageItem_Impl
+#define aSvxPostureItem_Impl sc_source_ui_appl_typemap_aSvxPostureItem_Impl
+#define aSvxShadowedItem_Impl sc_source_ui_appl_typemap_aSvxShadowedItem_Impl
+#define aSvxTextLineItem_Impl sc_source_ui_appl_typemap_aSvxTextLineItem_Impl
+#define aSvxWeightItem_Impl sc_source_ui_appl_typemap_aSvxWeightItem_Impl
+#endif
+
#define SFX_TYPEMAP
#include "scslots.hxx"
+#if defined(IOS)
+#undef aSfxBoolItem_Impl
+#undef aSfxInt32Item_Impl
+#undef aSfxObjectItem_Impl
+#undef aSfxStringItem_Impl
+#undef aSfxUInt16Item_Impl
+#undef aSfxUInt32Item_Impl
+#undef aSfxVoidItem_Impl
+#undef aSvxCharReliefItem_Impl
+#undef aSvxClipboardFmtItem_Impl
+#undef aSvxColorItem_Impl
+#undef aSvxContourItem_Impl
+#undef aSvxCrossedOutItem_Impl
+#undef aSvxFontHeightItem_Impl
+#undef aSvxFontItem_Impl
+#undef aSvxLanguageItem_Impl
+#undef aSvxPostureItem_Impl
+#undef aSvxShadowedItem_Impl
+#undef aSvxTextLineItem_Impl
+#undef aSvxWeightItem_Impl
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8b527f578e9b..e92fae8b73a7 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -182,12 +182,16 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
else // geschuetzte Zelle
{
+#ifndef DISABLE_SCRIPTING
SbxBase::SetError( SbxERR_BAD_PARAMETER ); //! welchen Fehler ?
+#endif
break;
}
}
}
+#ifndef DISABLE_SCRIPTING
SbxBase::SetError( SbxERR_NO_OBJECT );
+#endif
}
break;
@@ -1098,8 +1102,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
ScTabViewShell* pSh = GetBestViewShell();
if ( pSh )
pSh->Execute( rReq );
+#ifndef DISABLE_SCRIPTING
else
SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT );
+#endif
}
}
}
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index 0f90e04ee065..6c0146f59dd8 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -584,6 +584,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
xRet.set(static_cast<sheet::XFormulaOpCodeMapper*>(new ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::FormulaCompiler> (pComp))));
break;
}
+#ifndef DISABLE_SCRIPTING
case SC_SERVICE_VBAOBJECTPROVIDER:
if (pDocShell && pDocShell->GetDocument()->IsInVBAMode())
{
@@ -619,6 +620,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
}
}
break;
+#endif
}
return xRet;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index ec5b8e8107e6..7fb77ed2f624 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1682,8 +1682,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
rReq.Done();
}
+#ifndef DISABLE_SCRIPTING
else if (rReq.IsAPI())
SbxBase::SetError(SbxERR_BAD_PARAMETER);
+#endif
}
break;
@@ -1727,8 +1729,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
if (pTabViewShell->InsertName( aName, aSymbol, aAttrib ))
rReq.Done();
+#ifndef DISABLE_SCRIPTING
else
SbxBase::SetError( SbxERR_BAD_PARAMETER ); // Basic-error
+#endif
}
}
else
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 210277fa12ec..77121b7dd46a 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -676,8 +676,10 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
rReq.Done();
}
+#ifndef DISABLE_SCRIPTING
else if (rReq.IsAPI())
SbxBase::SetError(SbxERR_BAD_PARAMETER);
+#endif
}
break;
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 1858ecc40354..30638e1f91f8 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -447,7 +447,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
if( rReq.IsAPI() )
{
+#ifndef DISABLE_SCRIPTING
StarBASIC::Error( SbERR_SETPROP_FAILED ); // XXX Fehlerbehandlung???
+#endif
}
else
{
@@ -784,7 +786,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
if( rReq.IsAPI() )
{
+#ifndef DISABLE_SCRIPTING
StarBASIC::Error( SbERR_SETPROP_FAILED );
+#endif
}
}
}
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index 0daa16739e5b..707cd7f9c1d8 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -149,8 +149,10 @@ void ScTabViewShell::ExecuteObject( SfxRequest& rReq )
}
}
}
+#ifndef DISABLE_SCRIPTING
if (!bDone)
SbxBase::SetError( SbxERR_BAD_PARAMETER ); // Basic-Fehler
+#endif
}
break;
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 )
diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx
index d604cb22bc4e..1f7b5bf3351a 100644
--- a/svx/source/form/fmscriptingenv.cxx
+++ b/svx/source/form/fmscriptingenv.cxx
@@ -437,6 +437,10 @@ namespace svxform
//--------------------------------------------------------------------
void FormScriptingEnvironment::doFireScriptEvent( const ScriptEvent& _rEvent, Any* _pSyncronousResult )
{
+#ifdef DISABLE_SCRIPTING
+ (void) _rEvent;
+ (void) _pSyncronousResult;
+#else
SolarMutexClearableGuard aSolarGuard;
::osl::ClearableMutexGuard aGuard( m_aMutex );
@@ -513,6 +517,7 @@ namespace svxform
SolarMutexGuard aSolarGuarsReset;
xObjectShell = NULL;
}
+#endif
}
//--------------------------------------------------------------------
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index bb6adecbfa60..ef3d10aa173d 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -581,6 +581,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
if( pFlt->GetUserData().EqualsAscii( "HTML") )
{
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+#ifndef DISABLE_SCRIPTING
if( !rHtmlOpt.IsStarBasic() && rHtmlOpt.IsStarBasicWarning() && HasBasic() )
{
uno::Reference< XLibraryContainer > xLibCont(GetBasicContainer(), UNO_QUERY);
@@ -602,6 +603,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
}
}
}
+#endif
UpdateDocInfoForSave();
}