From 9ecac3874d179b1d7aa6b45337001b1def06a9dd Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Oct 2014 23:21:37 +0300 Subject: 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 --- basic/Library_sb.mk | 2 +- basic/Module_basic.mk | 2 +- basic/source/runtime/methods.cxx | 14 ++++++++------ basic/source/runtime/methods1.cxx | 8 +++++--- basic/source/sbx/sbxarray.cxx | 4 +++- basic/source/sbx/sbxdbl.cxx | 6 ++++-- basic/source/sbx/sbxscan.cxx | 4 +++- basic/source/sbx/sbxstr.cxx | 4 +++- basic/source/sbx/sbxvalue.cxx | 11 ++++++----- basic/source/sbx/sbxvar.cxx | 10 ++++++---- 10 files changed, 40 insertions(+), 25 deletions(-) (limited to 'basic') diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk index 3fed0bccc901..314b999a5863 100644 --- a/basic/Library_sb.mk +++ b/basic/Library_sb.mk @@ -59,7 +59,7 @@ $(eval $(call gb_Library_use_libraries,sb,\ $(gb_UWINAPI) \ )) -ifneq ($(DISABLE_SCRIPTING),TRUE) +ifneq ($(filter SCRIPTING,$(BUILD_TYPE)),) $(eval $(call gb_Library_add_exception_objects,sb,\ basic/source/basmgr/basicmanagerrepository \ diff --git a/basic/Module_basic.mk b/basic/Module_basic.mk index 0f74a2746431..98eb3447f97b 100644 --- a/basic/Module_basic.mk +++ b/basic/Module_basic.mk @@ -9,7 +9,7 @@ $(eval $(call gb_Module_Module,basic)) -ifneq ($(DISABLE_SCRIPTING),TRUE) +ifneq ($(filter SCRIPTING,$(BUILD_TYPE)),) $(eval $(call gb_Module_add_l10n_targets,basic,\ AllLangResTarget_sb \ 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 + #include #include #include @@ -94,7 +96,7 @@ using namespace com::sun::star::uno; #include #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 + #include #include @@ -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 + #include #include #include @@ -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(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 + #include #include #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 + #include #include #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 + #include #include #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 #include #include @@ -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 + #include #include #include @@ -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 } -- cgit