diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-10-21 23:21:37 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-10-22 09:30:23 +0300 |
commit | 9ecac3874d179b1d7aa6b45337001b1def06a9dd (patch) | |
tree | 120fc40fda1055a0f504e60c553b5734030d2741 /basic/source | |
parent | coverity#1242908 Untrusted value as argument (diff) | |
download | core-9ecac3874d179b1d7aa6b45337001b1def06a9dd.tar.gz core-9ecac3874d179b1d7aa6b45337001b1def06a9dd.zip |
Replace DISABLE_SCRIPTING with HAVE_FEATURE_SCRIPTING
Feature test macros that govern conditional compilation should be
defined in config_*.h include files, not on the compilation command
line.
Change-Id: I40575a4762fd2564f10927b6f38a112dd9f9a3d7
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/runtime/methods.cxx | 14 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxarray.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxdbl.cxx | 6 | ||||
-rw-r--r-- | basic/source/sbx/sbxscan.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxstr.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 11 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 10 |
8 files changed, 38 insertions, 23 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 3ccc46e994c7..194b06bb6444 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <tools/date.hxx> #include <basic/sbxvar.hxx> #include <basic/sbuno.hxx> @@ -94,7 +96,7 @@ using namespace com::sun::star::uno; #include <postwin.h> #endif -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING static void FilterWhiteSpace( OUString& rStr ) { @@ -4876,7 +4878,7 @@ sal_Int16 implGetDateYear( double aDate ) bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ) { -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING if ( nYear < 30 && SbiRuntime::isVBAEnabled() ) { nYear += 2000; @@ -4892,26 +4894,26 @@ bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& Date aCurDate( nDay, nMonth, nYear ); if ((nYear < 100 || nYear > 9999) ) { -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING StarBASIC::Error( SbERR_BAD_ARGUMENT ); #endif return false; } -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING if ( !SbiRuntime::isVBAEnabled() ) #endif { if ( (nMonth < 1 || nMonth > 12 )|| (nDay < 1 || nDay > 31 ) ) { -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING StarBASIC::Error( SbERR_BAD_ARGUMENT ); #endif return false; } } -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING else { // grab the year & month diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 29f25c504273..9b1ae18f87f3 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <sal/config.h> #include <cstddef> @@ -96,7 +98,7 @@ static Reference< XCalendar3 > getLocaleCalendar( void ) return xCalendar; } -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING RTLFUNC(CallByName) { @@ -3316,7 +3318,7 @@ sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam, sal_Int16 nFirstDay { if( nFirstDay < 0 || nFirstDay > 7 ) { -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING StarBASIC::Error( SbERR_BAD_ARGUMENT ); #endif return 0; @@ -3326,7 +3328,7 @@ sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam, sal_Int16 nFirstDay Reference< XCalendar3 > xCalendar = getLocaleCalendar(); if( !xCalendar.is() ) { -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING StarBASIC::Error( SbERR_INTERNAL_ERROR ); #endif return 0; diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index f6f04060c24b..420715b261c3 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <tools/debug.hxx> #include <tools/stream.hxx> #include <basic/sbx.hxx> @@ -731,7 +733,7 @@ void SbxDimArray::Put32( SbxVariable* p, const sal_Int32* pIdx ) // Element-Number with the help of Parameter-Array sal_uInt32 SbxDimArray::Offset32( SbxArray* pPar ) { -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING if (m_vDimensions.empty() || !pPar || ((m_vDimensions.size() != sal::static_int_cast<size_t>(pPar->Count() - 1)) && SbiRuntime::isVBAEnabled())) diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx index e349a946c337..e251336c62c8 100644 --- a/basic/source/sbx/sbxdbl.cxx +++ b/basic/source/sbx/sbxdbl.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <tools/errcode.hxx> #include <basic/sbx.hxx> #include "sbxconv.hxx" @@ -69,7 +71,7 @@ double ImpGetDouble( const SbxValues* p ) if( !p->pOUString ) { nRes = 0; -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour SbxBase::SetError( SbxERR_CONVERSION ); #endif @@ -81,7 +83,7 @@ double ImpGetDouble( const SbxValues* p ) if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) { nRes = 0; -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour SbxBase::SetError( SbxERR_CONVERSION ); #endif diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index b31f0a56a2b9..0ec92eba6d44 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <tools/errcode.hxx> #include <basic/sbx.hxx> #include "sbxconv.hxx" @@ -250,7 +252,7 @@ SbxError ImpScan( const OUString& rWSrc, double& nVal, SbxDataType& rType, if( l >= SbxMININT && l <= SbxMAXINT ) eScanType = SbxINTEGER; } -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING else if ( SbiRuntime::isVBAEnabled() ) { OSL_TRACE("Reporting error converting"); diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx index 339080ecd352..ded077a6c4fd 100644 --- a/basic/source/sbx/sbxstr.cxx +++ b/basic/source/sbx/sbxstr.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <tools/errcode.hxx> #include <basic/sbx.hxx> #include "sbxconv.hxx" @@ -260,7 +262,7 @@ SbxArray* StringToByteArray(const OUString& rStr) sal_Int32 nArraySize = rStr.getLength() * 2; const sal_Unicode* pSrc = rStr.getStr(); SbxDimArray* pArray = new SbxDimArray(SbxBYTE); -#ifdef DISABLE_SCRIPTING +#if !HAVE_FEATURE_SCRIPTING bool bIncIndex = false; #else bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() ); diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 605cfe3b33e0..87bf0c0bbde1 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> #include <math.h> #include <tools/debug.hxx> @@ -259,7 +260,7 @@ SbxValue* SbxValue::TheRealValue( bool bObjInObjError ) const ((SbxValue*) pObj)->aData.eType == SbxOBJECT && ((SbxValue*) pObj)->aData.pObj == pObj ) { -#ifdef DISABLE_SCRIPTING // No sbunoobj +#if !HAVE_FEATURE_SCRIPTING const bool bSuccess = false; #else bool bSuccess = handleToStringForCOMObjects( pObj, p ); @@ -871,8 +872,8 @@ bool SbxValue::Convert( SbxDataType eTo ) bool SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp ) { -#ifdef DISABLE_SCRIPTING - bool bVBAInterop = false; +#if !HAVE_FEATURE_SCRIPTING + const bool bVBAInterop = false; #else bool bVBAInterop = SbiRuntime::isVBAEnabled(); #endif @@ -1243,8 +1244,8 @@ Lbl_OpIsEmpty: bool SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const { -#ifdef DISABLE_SCRIPTING - bool bVBAInterop = false; +#if !HAVE_FEATURE_SCRIPTING + const bool bVBAInterop = false; #else bool bVBAInterop = SbiRuntime::isVBAEnabled(); #endif diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index ba32676f4335..5e7595041828 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <tools/debug.hxx> #include <tools/stream.hxx> #include <svl/SfxBroadcaster.hxx> @@ -78,7 +80,7 @@ SbxVariable::SbxVariable( const SbxVariable& r ) if( r.mpSbxVariableImpl != NULL ) { mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl ); -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING if( mpSbxVariableImpl->m_xComListener.is() ) { registerComListenerVariableForBasic( this, mpSbxVariableImpl->m_pComListenerParentBasic ); @@ -112,7 +114,7 @@ SbxVariable::SbxVariable( SbxDataType t, void* p ) : SbxValue( t, p ) SbxVariable::~SbxVariable() { -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING if( IsSet( SBX_DIM_AS_NEW )) { removeDimAsNewRecoverItem( this ); @@ -347,7 +349,7 @@ SbxVariable& SbxVariable::operator=( const SbxVariable& r ) if( r.mpSbxVariableImpl != NULL ) { mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl ); -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING if( mpSbxVariableImpl->m_xComListener.is() ) { registerComListenerVariableForBasic( this, mpSbxVariableImpl->m_pComListenerParentBasic ); @@ -450,7 +452,7 @@ void SbxVariable::SetComListener( ::com::sun::star::uno::Reference< ::com::sun:: SbxVariableImpl* pImpl = getImpl(); pImpl->m_xComListener = xComListener; pImpl->m_pComListenerParentBasic = pParentBasic; -#ifndef DISABLE_SCRIPTING +#if HAVE_FEATURE_SCRIPTING registerComListenerVariableForBasic( this, pParentBasic ); #endif } |