diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-03-05 21:41:31 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-03-05 22:30:12 +0200 |
commit | b344c30ab49b6faf8a24be42bdfcf4e946a861cd (patch) | |
tree | 75699c0eb98676e6f9359a44fae78a29594ad751 /basic/source/sbx | |
parent | b69285590d704b08852c22dbb5ed073bff9998ce (diff) |
Sprinkle more DISABLE_SCRIPTING ifdefs
Diffstat (limited to 'basic/source/sbx')
-rw-r--r-- | basic/source/sbx/sbxarray.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxdbl.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxscan.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxstr.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 13 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 8 |
6 files changed, 32 insertions, 1 deletions
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index 544f71708da0..d221e4d85288 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -767,10 +767,12 @@ void SbxDimArray::Put32( SbxVariable* p, const sal_Int32* pIdx ) sal_uInt32 SbxDimArray::Offset32( SbxArray* pPar ) { +#ifndef DISABLE_SCRIPTING if( nDim == 0 || !pPar || ( ( nDim != ( pPar->Count() - 1 ) ) && SbiRuntime::isVBAEnabled() ) ) { SetError( SbxERR_BOUNDS ); return 0; } +#endif sal_uInt32 nPos = 0; sal_uInt16 nOff = 1; // Non element 0! for( SbxDim* p = pFirst; p && !IsError(); p = p->pNext ) diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx index ef6a8ae3d185..9eca1dda0e21 100644 --- a/basic/source/sbx/sbxdbl.cxx +++ b/basic/source/sbx/sbxdbl.cxx @@ -78,8 +78,10 @@ double ImpGetDouble( const SbxValues* p ) if( !p->pOUString ) { nRes = 0; +#ifndef DISABLE_SCRIPTING if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour SbxBase::SetError( SbxERR_CONVERSION ); +#endif } else { @@ -88,8 +90,10 @@ double ImpGetDouble( const SbxValues* p ) if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) { nRes = 0; +#ifndef DISABLE_SCRIPTING if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour SbxBase::SetError( SbxERR_CONVERSION ); +#endif } else nRes = d; diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index a25337709e83..b4f111c32f6c 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -219,11 +219,13 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType if( l >= SbxMININT && l <= SbxMAXINT ) eScanType = SbxINTEGER; } +#ifndef DISABLE_SCRIPTING else if ( SbiRuntime::isVBAEnabled() ) { OSL_TRACE("Reporting error converting"); return SbxERR_CONVERSION; } +#endif if( pLen ) *pLen = (sal_uInt16) ( p - pStart ); if( !bRes ) diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx index fc95c5763211..20a7b116793e 100644 --- a/basic/source/sbx/sbxstr.cxx +++ b/basic/source/sbx/sbxstr.cxx @@ -260,7 +260,11 @@ SbxArray* StringToByteArray(const ::rtl::OUString& rStr) sal_Int32 nArraySize = rStr.getLength() * 2; const sal_Unicode* pSrc = rStr.getStr(); SbxDimArray* pArray = new SbxDimArray(SbxBYTE); +#ifdef DISABLE_SCRIPTING + bool bIncIndex = false; +#else bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() ); +#endif if( nArraySize ) { if( bIncIndex ) diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index be3611921ac1..74b9d9c96a3e 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -297,7 +297,11 @@ SbxValue* SbxValue::TheRealValue( sal_Bool bObjInObjError ) const ((SbxValue*) pObj)->aData.eType == SbxOBJECT && ((SbxValue*) pObj)->aData.pObj == pObj ) { +#ifdef DISABLE_SCRIPTING // No sbunoobj + const bool bSuccess = false; +#else bool bSuccess = handleToStringForCOMObjects( pObj, p ); +#endif if( !bSuccess ) { SetError( SbxERR_BAD_PROP_VALUE ); @@ -914,8 +918,11 @@ sal_Bool SbxValue::Convert( SbxDataType eTo ) sal_Bool SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp ) { +#ifdef DISABLE_SCRIPTING + bool bVBAInterop = false; +#else bool bVBAInterop = SbiRuntime::isVBAEnabled(); - +#endif SbxDataType eThisType = GetType(); SbxDataType eOpType = rOp.GetType(); SbxError eOld = GetError(); @@ -1283,7 +1290,11 @@ Lbl_OpIsEmpty: sal_Bool SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const { +#ifdef DISABLE_SCRIPTING + bool bVBAInterop = false; +#else bool bVBAInterop = SbiRuntime::isVBAEnabled(); +#endif sal_Bool bRes = sal_False; SbxError eOld = GetError(); diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index d00115a1ed41..9ad7a5f0de9d 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -93,8 +93,10 @@ SbxVariable::SbxVariable( const SbxVariable& r ) if( r.mpSbxVariableImpl != NULL ) { mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl ); +#ifndef DISABLE_SCRIPTING if( mpSbxVariableImpl->m_xComListener.is() ) registerComListenerVariableForBasic( this, mpSbxVariableImpl->m_pComListenerParentBasic ); +#endif } pCst = NULL; if( r.CanRead() ) @@ -141,8 +143,10 @@ SbxVariable::~SbxVariable() if ( maName.EqualsAscii( aCellsStr ) ) maName.AssignAscii( aCellsStr, sizeof( aCellsStr )-1 ); #endif +#ifndef DISABLE_SCRIPTING if( IsSet( SBX_DIM_AS_NEW )) removeDimAsNewRecoverItem( this ); +#endif delete mpSbxVariableImpl; delete pCst; } @@ -333,8 +337,10 @@ SbxVariable& SbxVariable::operator=( const SbxVariable& r ) if( r.mpSbxVariableImpl != NULL ) { mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl ); +#ifndef DISABLE_SCRIPTING if( mpSbxVariableImpl->m_xComListener.is() ) registerComListenerVariableForBasic( this, mpSbxVariableImpl->m_pComListenerParentBasic ); +#endif } else mpSbxVariableImpl = NULL; @@ -422,7 +428,9 @@ void SbxVariable::SetComListener( ::com::sun::star::uno::Reference< ::com::sun:: SbxVariableImpl* pImpl = getImpl(); pImpl->m_xComListener = xComListener; pImpl->m_pComListenerParentBasic = pParentBasic; +#ifndef DISABLE_SCRIPTING registerComListenerVariableForBasic( this, pParentBasic ); +#endif } void SbxVariable::ClearComListener( void ) |