From 08e49fa3377d8c4e7e5df7a32233fcd9763ee936 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Nov 2015 10:10:36 +0100 Subject: loplugin:nullptr (automatic rewrite) Change-Id: I1ec9a671fe3ac838feb36297915e3cdf8749d944 --- basic/qa/cppunit/basictest.hxx | 8 +- basic/qa/cppunit/test_vba.cxx | 2 +- basic/source/basmgr/basicmanagerrepository.cxx | 20 +- basic/source/basmgr/basmgr.cxx | 60 +-- basic/source/classes/errobject.cxx | 4 +- basic/source/classes/eventatt.cxx | 26 +- basic/source/classes/image.cxx | 18 +- basic/source/classes/propacc.cxx | 2 +- basic/source/classes/sb.cxx | 128 ++--- basic/source/classes/sbintern.cxx | 26 +- basic/source/classes/sbunoobj.cxx | 142 +++--- basic/source/classes/sbxmod.cxx | 102 ++-- basic/source/comp/basiccharclass.cxx | 4 +- basic/source/comp/buffer.cxx | 12 +- basic/source/comp/codegen.cxx | 6 +- basic/source/comp/dim.cxx | 44 +- basic/source/comp/exprgen.cxx | 6 +- basic/source/comp/exprnode.cxx | 24 +- basic/source/comp/exprtree.cxx | 50 +- basic/source/comp/parser.cxx | 10 +- basic/source/comp/sbcomp.cxx | 4 +- basic/source/comp/scanner.cxx | 10 +- basic/source/comp/symtbl.cxx | 16 +- basic/source/inc/codegen.hxx | 2 +- basic/source/inc/expr.hxx | 8 +- basic/source/inc/namecont.hxx | 2 +- basic/source/inc/parser.hxx | 4 +- basic/source/inc/runtime.hxx | 14 +- basic/source/inc/scanner.hxx | 2 +- basic/source/inc/token.hxx | 4 +- basic/source/runtime/iosys.cxx | 18 +- basic/source/runtime/methods.cxx | 34 +- basic/source/runtime/methods1.cxx | 38 +- basic/source/runtime/props.cxx | 2 +- basic/source/runtime/runtime.cxx | 182 ++++---- basic/source/runtime/stdobj.cxx | 616 ++++++++++++------------- basic/source/runtime/stdobj1.cxx | 2 +- basic/source/sbx/sbxarray.cxx | 10 +- basic/source/sbx/sbxbase.cxx | 16 +- basic/source/sbx/sbxbyte.cxx | 2 +- basic/source/sbx/sbxchar.cxx | 2 +- basic/source/sbx/sbxcoll.cxx | 8 +- basic/source/sbx/sbxcurr.cxx | 2 +- basic/source/sbx/sbxdbl.cxx | 2 +- basic/source/sbx/sbxdec.cxx | 6 +- basic/source/sbx/sbxexec.cxx | 12 +- basic/source/sbx/sbxint.cxx | 6 +- basic/source/sbx/sbxlng.cxx | 2 +- basic/source/sbx/sbxobj.cxx | 34 +- basic/source/sbx/sbxscan.cxx | 10 +- basic/source/sbx/sbxsng.cxx | 2 +- basic/source/sbx/sbxstr.cxx | 4 +- basic/source/sbx/sbxuint.cxx | 2 +- basic/source/sbx/sbxulng.cxx | 2 +- basic/source/sbx/sbxvalue.cxx | 34 +- basic/source/sbx/sbxvar.cxx | 34 +- basic/source/uno/namecont.cxx | 28 +- basic/source/uno/scriptcont.cxx | 6 +- 58 files changed, 938 insertions(+), 938 deletions(-) (limited to 'basic') diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx index 9115b60bb544..39240e0d3c6f 100644 --- a/basic/qa/cppunit/basictest.hxx +++ b/basic/qa/cppunit/basictest.hxx @@ -31,7 +31,7 @@ class MacroSnippet void InitSnippet() { - CPPUNIT_ASSERT_MESSAGE( "No resource manager", maDll.GetBasResMgr() != NULL ); + CPPUNIT_ASSERT_MESSAGE( "No resource manager", maDll.GetBasResMgr() != nullptr ); mpBasic = new StarBASIC(); StarBASIC::SetGlobalErrorHdl( LINK( this, MacroSnippet, BasicErrorHdl ) ); } @@ -90,10 +90,10 @@ class MacroSnippet SbxVariableRef Run( const css::uno::Sequence< css::uno::Any >& rArgs ) { - SbxVariableRef pReturn = NULL; + SbxVariableRef pReturn = nullptr; if ( !Compile() ) return pReturn; - SbMethod* pMeth = mpMod ? static_cast(mpMod->Find( "doUnitTest", SbxCLASS_METHOD )) : NULL; + SbMethod* pMeth = mpMod ? static_cast(mpMod->Find( "doUnitTest", SbxCLASS_METHOD )) : nullptr; if ( pMeth ) { if ( rArgs.getLength() ) @@ -120,7 +120,7 @@ class MacroSnippet bool Compile() { - CPPUNIT_ASSERT_MESSAGE("module is NULL", mpMod != NULL ); + CPPUNIT_ASSERT_MESSAGE("module is NULL", mpMod != nullptr ); mpMod->Compile(); return !mbError; } diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx index ba145621b0e8..e45808d4f309 100644 --- a/basic/qa/cppunit/test_vba.cxx +++ b/basic/qa/cppunit/test_vba.cxx @@ -74,7 +74,7 @@ void VBATest::testMiscVBAFunctions() fprintf(stderr, "macro result for %s\n", macroSource[ i ] ); fprintf(stderr, "macro returned:\n%s\n", OUStringToOString( pReturn->GetOUString(), RTL_TEXTENCODING_UTF8 ).getStr() ); } - CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn != NULL ); + CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn != nullptr ); CPPUNIT_ASSERT_MESSAGE("Result not as expected", pReturn->GetOUString() == "OK" ); } } diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index 3ec9ed4f8bf0..1b3ca26af456 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -225,7 +225,7 @@ namespace basic without creating another instance. */ BasicManager*& pBasicManager = impl_getLocationForModel( _rxDocumentModel ); - if ( pBasicManager == NULL ) + if ( pBasicManager == nullptr ) impl_createManagerForModel( pBasicManager, _rxDocumentModel ); return pBasicManager; @@ -237,7 +237,7 @@ namespace basic SolarMutexGuard g; BasicManager* pAppManager = GetSbData()->pAppBasMgr; - if ( ( pAppManager == NULL ) && _bCreate ) + if ( ( pAppManager == nullptr ) && _bCreate ) pAppManager = impl_createApplicationBasicManager(); return pAppManager; @@ -259,7 +259,7 @@ namespace basic { SolarMutexGuard g; - OSL_PRECOND( getApplicationBasicManager( false ) == NULL, "ImplRepository::impl_createApplicationBasicManager: there already is one!" ); + OSL_PRECOND( getApplicationBasicManager( false ) == nullptr, "ImplRepository::impl_createApplicationBasicManager: there already is one!" ); // Determine Directory SvtPathOptions aPathCFG; @@ -308,7 +308,7 @@ namespace basic // (BasicLibraries and DialogLibraries have automatically been added in SetLibraryContainerInfo) // notify - impl_notifyCreationListeners( NULL, *pBasicManager ); + impl_notifyCreationListeners( nullptr, *pBasicManager ); // outta here return pBasicManager; @@ -352,8 +352,8 @@ namespace basic { BasicManager* pAppManager = getApplicationBasicManager( true ); - StarBASIC* pAppBasic = pAppManager ? pAppManager->GetLib(0) : NULL; - DBG_ASSERT( pAppBasic != NULL, "impl_getApplicationBasic: unable to determine the default application's Basic library!" ); + StarBASIC* pAppBasic = pAppManager ? pAppManager->GetLib(0) : nullptr; + DBG_ASSERT( pAppBasic != nullptr, "impl_getApplicationBasic: unable to determine the default application's Basic library!" ); return pAppBasic; } @@ -398,7 +398,7 @@ namespace basic { StarBASIC* pAppBasic = impl_getDefaultAppBasicLibrary(); - _out_rpBasicManager = 0; + _out_rpBasicManager = nullptr; Reference< XStorage > xStorage; if ( !impl_getDocumentStorage_nothrow( _rxDocumentModel, xStorage ) ) { @@ -434,7 +434,7 @@ namespace basic { // user wants to break loading of BASIC-manager delete _out_rpBasicManager; - _out_rpBasicManager = NULL; + _out_rpBasicManager = nullptr; xStorage.clear(); break; } @@ -448,7 +448,7 @@ namespace basic // create new BASIC-manager StarBASIC* pBasic = new StarBASIC( pAppBasic ); pBasic->SetFlag( SbxFlagBits::ExtSearch ); - _out_rpBasicManager = new BasicManager( pBasic, NULL, true ); + _out_rpBasicManager = new BasicManager( pBasic, nullptr, true ); } // knit the containers with the BasicManager @@ -599,7 +599,7 @@ namespace basic void BasicManagerRepository::resetApplicationBasicManager() { - return ImplRepository::Instance().setApplicationBasicManager( NULL ); + return ImplRepository::Instance().setApplicationBasicManager( nullptr ); } diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 18e8f6ff50c3..34e052cd91b3 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -115,8 +115,8 @@ struct BasicManagerImpl OUString aBasicLibPath; BasicManagerImpl() - : mpManagerStream( NULL ) - , mppLibStreams( NULL ) + : mpManagerStream( nullptr ) + , mppLibStreams( nullptr ) , mnLibStreamCount( 0 ) {} ~BasicManagerImpl(); @@ -343,7 +343,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementRemoved( const container::Cont else { StarBASIC* pLib = mpMgr->GetLib( maLibName ); - SbModule* pMod = pLib ? pLib->FindModule( aName ) : NULL; + SbModule* pMod = pLib ? pLib->FindModule( aName ) : nullptr; if( pMod ) { pLib->Remove( pMod ); @@ -434,7 +434,7 @@ BasicLibInfo::BasicLibInfo() bReference = false; bPasswordVerified = false; bDoLoad = false; - mxScriptCont = NULL; + mxScriptCont = nullptr; aStorageName = szImbedded; aRelStorageName = szImbedded; } @@ -505,7 +505,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const OUString& rBaseURL, Star if ( !pStdLib ) { // Should never happen, but if it happens we wont crash... - pStdLib = new StarBASIC( NULL, mbDocMgr ); + pStdLib = new StarBASIC( nullptr, mbDocMgr ); if (mpImpl->aLibs.empty()) CreateLibInfo(); @@ -649,7 +649,7 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo ) StarBASIC* pLib = rpBasLibInfo->GetLib(); if( !pLib ) { - bool bLoaded = ImpLoadLibrary( rpBasLibInfo.get(), NULL ); + bool bLoaded = ImpLoadLibrary( rpBasLibInfo.get(), nullptr ); if( bLoaded ) pLib = rpBasLibInfo->GetLib(); } @@ -705,7 +705,7 @@ void BasicManager::ImpMgrNotLoaded( const OUString& rStorageName ) // Create a stdlib otherwise we crash! BasicLibInfo* pStdLibInfo = CreateLibInfo(); - pStdLibInfo->SetLib( new StarBASIC( NULL, mbDocMgr ) ); + pStdLibInfo->SetLib( new StarBASIC( nullptr, mbDocMgr ) ); StarBASICRef xStdLib = pStdLibInfo->GetLib(); xStdLib->SetName( szStdLibName ); pStdLibInfo->SetLibName( szStdLibName ); @@ -909,7 +909,7 @@ BasicManager::~BasicManager() void BasicManager::LegacyDeleteBasicManager( BasicManager*& _rpManager ) { delete _rpManager; - _rpManager = NULL; + _rpManager = nullptr; } @@ -1078,7 +1078,7 @@ bool BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) con bool bLoaded = false; if( xNew.Is() ) { - if( 0 != dynamic_cast( &xNew ) ) + if( nullptr != dynamic_cast( &xNew ) ) { StarBASIC* pNew = static_cast(static_cast(xNew)); // Use the Parent of the old BASICs @@ -1178,10 +1178,10 @@ StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const OUString& rLibName, else { RemoveLib( nLibId, false ); - pLibInfo = 0; + pLibInfo = nullptr; } - return pLibInfo ? &*pLibInfo->GetLib() : 0; + return pLibInfo ? &*pLibInfo->GetLib() : nullptr; } @@ -1298,7 +1298,7 @@ StarBASIC* BasicManager::GetLib( sal_uInt16 nLib ) const { return mpImpl->aLibs[nLib]->GetLib(); } - return 0; + return nullptr; } StarBASIC* BasicManager::GetStdLib() const @@ -1316,7 +1316,7 @@ StarBASIC* BasicManager::GetLib( const OUString& rName ) const return rpLib->GetLib(); } } - return 0; + return nullptr; } sal_uInt16 BasicManager::GetLibId( const OUString& rName ) const @@ -1369,7 +1369,7 @@ bool BasicManager::LoadLib( sal_uInt16 nLib ) } else { - bDone = ImpLoadLibrary( &rLibInfo, NULL ); + bDone = ImpLoadLibrary( &rLibInfo, nullptr ); StarBASIC* pLib = GetLib( nLib ); if ( pLib ) { @@ -1390,7 +1390,7 @@ StarBASIC* BasicManager::CreateLib( const OUString& rLibName ) { if ( GetLib( rLibName ) ) { - return 0; + return nullptr; } BasicLibInfo* pLibInfo = CreateLibInfo(); StarBASIC* pNew = new StarBASIC( GetStdLib(), mbDocMgr ); @@ -1445,7 +1445,7 @@ StarBASIC* BasicManager::CreateLibForLibContainer( const OUString& rLibName, { if ( GetLib( rLibName ) ) { - return 0; + return nullptr; } BasicLibInfo* pLibInfo = CreateLibInfo(); StarBASIC* pNew = new StarBASIC( GetStdLib(), mbDocMgr ); @@ -1468,7 +1468,7 @@ BasicLibInfo* BasicManager::FindLibInfo( StarBASIC* pBasic ) return rpLib.get(); } } - return NULL; + return nullptr; } @@ -1618,13 +1618,13 @@ namespace } } } - return 0; + return nullptr; } } bool BasicManager::HasMacro( OUString const& i_fullyQualifiedName ) const { - return ( NULL != lcl_queryMacro( const_cast< BasicManager* >( this ), i_fullyQualifiedName ) ); + return ( nullptr != lcl_queryMacro( const_cast< BasicManager* >( this ), i_fullyQualifiedName ) ); } ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue ) @@ -1828,7 +1828,7 @@ uno::Type ModuleContainer_Impl::getElementType() sal_Bool ModuleContainer_Impl::hasElements() throw(uno::RuntimeException, std::exception) { - SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL; + SbxArray* pMods = mpLib ? mpLib->GetModules() : nullptr; return pMods && pMods->Count() > 0; } @@ -1836,7 +1836,7 @@ sal_Bool ModuleContainer_Impl::hasElements() uno::Any ModuleContainer_Impl::getByName( const OUString& aName ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) { - SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL; + SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : nullptr; if( !pMod ) throw container::NoSuchElementException(); uno::Reference< script::XStarBasicModuleInfo > xMod = static_cast(new ModuleInfo_Impl @@ -1849,7 +1849,7 @@ uno::Any ModuleContainer_Impl::getByName( const OUString& aName ) uno::Sequence< OUString > ModuleContainer_Impl::getElementNames() throw(uno::RuntimeException, std::exception) { - SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL; + SbxArray* pMods = mpLib ? mpLib->GetModules() : nullptr; sal_uInt16 nMods = pMods ? pMods->Count() : 0; uno::Sequence< OUString > aRetSeq( nMods ); OUString* pRetSeq = aRetSeq.getArray(); @@ -1864,8 +1864,8 @@ uno::Sequence< OUString > ModuleContainer_Impl::getElementNames() sal_Bool ModuleContainer_Impl::hasByName( const OUString& aName ) throw(uno::RuntimeException, std::exception) { - SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL; - bool bRet = (pMod != NULL); + SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : nullptr; + bool bRet = (pMod != nullptr); return bRet; } @@ -1897,7 +1897,7 @@ void ModuleContainer_Impl::insertByName( const OUString& aName, const uno::Any& void ModuleContainer_Impl::removeByName( const OUString& Name ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) { - SbModule* pMod = mpLib ? mpLib->FindModule( Name ) : NULL; + SbModule* pMod = mpLib ? mpLib->FindModule( Name ) : nullptr; if( !pMod ) { throw container::NoSuchElementException(); @@ -1983,7 +1983,7 @@ sal_Bool DialogContainer_Impl::hasElements() for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ ) { SbxVariable* pVar = mpLib->GetObjects()->Get( nObj ); - if ( 0 != dynamic_cast( pVar) && ( static_cast(pVar)->GetSbxId() == SBXID_DIALOG ) ) + if ( nullptr != dynamic_cast( pVar) && ( static_cast(pVar)->GetSbxId() == SBXID_DIALOG ) ) { bRet = true; break; @@ -1997,7 +1997,7 @@ uno::Any DialogContainer_Impl::getByName( const OUString& aName ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) { SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE ); - if( !( pVar && 0 != dynamic_cast( pVar) && + if( !( pVar && nullptr != dynamic_cast( pVar) && ( static_cast(pVar)->GetSbxId() == SBXID_DIALOG ) ) ) { throw container::NoSuchElementException(); @@ -2023,7 +2023,7 @@ uno::Sequence< OUString > DialogContainer_Impl::getElementNames() for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ ) { SbxVariable* pVar = mpLib->GetObjects()->Get( nObj ); - if ( 0 != dynamic_cast( pVar) && ( static_cast(pVar)->GetSbxId() == SBXID_DIALOG ) ) + if ( nullptr != dynamic_cast( pVar) && ( static_cast(pVar)->GetSbxId() == SBXID_DIALOG ) ) { pRetSeq[ nDialogCounter ] = OUString( pVar->GetName() ); nDialogCounter++; @@ -2038,7 +2038,7 @@ sal_Bool DialogContainer_Impl::hasByName( const OUString& aName ) { bool bRet = false; SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE ); - if( pVar && 0 != dynamic_cast( pVar) && + if( pVar && nullptr != dynamic_cast( pVar) && ( static_cast(pVar)->GetSbxId() == SBXID_DIALOG ) ) { bRet = true; @@ -2078,7 +2078,7 @@ void DialogContainer_Impl::removeByName( const OUString& Name ) { (void)Name; SbxVariable* pVar = mpLib->GetObjects()->Find( Name, SbxCLASS_DONTCARE ); - if( !( pVar && 0 != dynamic_cast( pVar) && + if( !( pVar && nullptr != dynamic_cast( pVar) && ( static_cast(pVar)->GetSbxId() == SBXID_DIALOG ) ) ) { throw container::NoSuchElementException(); diff --git a/basic/source/classes/errobject.cxx b/basic/source/classes/errobject.cxx index 202b76aed444..7bf209563d91 100644 --- a/basic/source/classes/errobject.cxx +++ b/basic/source/classes/errobject.cxx @@ -173,7 +173,7 @@ void ErrObject::setData( const uno::Any& Number, const uno::Any& Source, const u // SbxErrObject SbxErrObject::SbxErrObject( const OUString& rName, const uno::Any& rUnoObj ) : SbUnoObject( rName, rUnoObj ) - , m_pErrObject( NULL ) + , m_pErrObject( nullptr ) { OSL_TRACE("SbxErrObject::SbxErrObject ctor"); rUnoObj >>= m_xErr; @@ -207,7 +207,7 @@ SbxErrObject::getErrObject() void SbxErrObject::setNumberAndDescription( ::sal_Int32 _number, const OUString& _description ) throw (uno::RuntimeException) { - if( m_pErrObject != NULL ) + if( m_pErrObject != nullptr ) { m_pErrObject->setData( uno::makeAny( _number ), uno::Any(), uno::makeAny( _description ), uno::Any(), uno::Any() ); } diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index ccdfd20311ae..5c54cb0c7dea 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -163,7 +163,7 @@ void BasicScriptListener_Impl::firing( const ScriptEvent& aScriptEvent ) throw ( { SolarMutexGuard g; - firing_impl( aScriptEvent, NULL ); + firing_impl( aScriptEvent, nullptr ); } Any BasicScriptListener_Impl::approveFiring( const ScriptEvent& aScriptEvent ) @@ -210,7 +210,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any SbxObject* p = maBasicRef; SbxObject* pParent = p->GetParent(); - SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL; + SbxObject* pParentParent = pParent ? pParent->GetParent() : nullptr; StarBASICRef xAppStandardBasic; StarBASICRef xDocStandardBasic; @@ -249,7 +249,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any { bSearchLib = false; } - SbxVariable* pMethVar = NULL; + SbxVariable* pMethVar = nullptr; // Be still tolerant and make default search if no search basic exists if( bSearchLib && xLibSearchBasic.Is() ) { @@ -284,7 +284,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any } // Default: Be tolerant and search everywhere - if( (!pMethVar || 0 == dynamic_cast( pMethVar)) && maBasicRef.Is() ) + if( (!pMethVar || nullptr == dynamic_cast( pMethVar)) && maBasicRef.Is() ) { pMethVar = maBasicRef->FindQualified( aMacro, SbxCLASS_DONTCARE ); } @@ -309,7 +309,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any } // Call method - SbxVariableRef xValue = pRet ? new SbxVariable : 0; + SbxVariableRef xValue = pRet ? new SbxVariable : nullptr; if( xArray.Is() ) { pMeth->SetParameters( xArray ); @@ -319,7 +319,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any { *pRet = sbxToUnoValue( xValue ); } - pMeth->SetParameters( NULL ); + pMeth->SetParameters( nullptr ); } else // scripting framework script { @@ -333,7 +333,7 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog css::uno::Reference< css::container::XNameContainer > aRetDlgLib; SbxVariable* pDlgLibContVar = pBasic->Find("DialogLibraries", SbxCLASS_OBJECT); - if( pDlgLibContVar && 0 != dynamic_cast( pDlgLibContVar) ) + if( pDlgLibContVar && nullptr != dynamic_cast( pDlgLibContVar) ) { SbUnoObject* pDlgLibContUnoObj = static_cast(static_cast(pDlgLibContVar)); Any aDlgLibContAny = pDlgLibContUnoObj->getUnoAny(); @@ -384,11 +384,11 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog css::uno::Reference< css::container::XNameContainer > aDlgLib; // Find dialog library for dialog, direct access is not possible here StarBASIC* pStartedBasic = static_cast(pBasic); - SbxObject* pParentBasic = pStartedBasic ? pStartedBasic->GetParent() : NULL; - SbxObject* pParentParentBasic = pParentBasic ? pParentBasic->GetParent() : NULL; + SbxObject* pParentBasic = pStartedBasic ? pStartedBasic->GetParent() : nullptr; + SbxObject* pParentParentBasic = pParentBasic ? pParentBasic->GetParent() : nullptr; - SbxObject* pSearchBasic1 = NULL; - SbxObject* pSearchBasic2 = NULL; + SbxObject* pSearchBasic1 = nullptr; + SbxObject* pSearchBasic2 = nullptr; if( pParentParentBasic ) { pSearchBasic1 = pParentBasic; @@ -432,7 +432,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) // Get dialog SbxBaseRef pObj = rPar.Get( 1 )->GetObject(); - if( !(pObj && 0 != dynamic_cast( &pObj )) ) + if( !(pObj && nullptr != dynamic_cast( &pObj )) ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; @@ -486,7 +486,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) css::uno::Reference< css::container::XNameContainer > aDlgLib; bool bDocDialog = false; - StarBASIC* pFoundBasic = NULL; + StarBASIC* pFoundBasic = nullptr; SAL_INFO("basic", "About to try get a hold of ThisComponent"); Reference< frame::XModel > xModel = StarBASIC::GetModelFromBasic( GetSbData()->pInst->GetBasic() ) ; aDlgLib = implFindDialogLibForDialogBasic( aAnyISP, GetSbData()->pInst->GetBasic(), pFoundBasic ); diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 268fcd00eda5..a487e62ea9e8 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -29,10 +29,10 @@ SbiImage::SbiImage() { - pStringOff = NULL; - pStrings = NULL; - pCode = NULL; - pLegacyPCode = NULL; + pStringOff = nullptr; + pStrings = nullptr; + pCode = nullptr; + pLegacyPCode = nullptr; nFlags = SbiImageFlags::NONE; nStrings = 0; nStringSize= 0; @@ -58,9 +58,9 @@ void SbiImage::Clear() delete[] pStrings; delete[] pCode; ReleaseLegacyBuffer(); - pStringOff = NULL; - pStrings = NULL; - pCode = NULL; + pStringOff = nullptr; + pStrings = nullptr; + pCode = nullptr; nFlags = SbiImageFlags::NONE; nStrings = 0; nStringSize= 0; @@ -673,7 +673,7 @@ OUString SbiImage::GetString( short nId ) const const SbxObject* SbiImage::FindType (const OUString& aTypeName) const { - return rTypes.Is() ? static_cast(rTypes->Find(aTypeName,SbxCLASS_OBJECT)) : NULL; + return rTypes.Is() ? static_cast(rTypes->Find(aTypeName,SbxCLASS_OBJECT)) : nullptr; } sal_uInt16 SbiImage::CalcLegacyOffset( sal_Int32 nOffset ) @@ -689,7 +689,7 @@ sal_uInt32 SbiImage::CalcNewOffset( sal_Int16 nOffset ) void SbiImage::ReleaseLegacyBuffer() { delete[] pLegacyPCode; - pLegacyPCode = NULL; + pLegacyPCode = nullptr; nLegacyCodeSize = 0; } diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx index ead41afb7253..fa6a6422d6fa 100644 --- a/basic/source/classes/propacc.cxx +++ b/basic/source/classes/propacc.cxx @@ -231,7 +231,7 @@ void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, bool bWrite } // Object could not be created - refVar->PutObject( NULL ); + refVar->PutObject( nullptr ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 2b30d114c770..e84bc3a76c06 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -185,7 +185,7 @@ const DocBasicItem* lclFindDocBasicItem( const StarBASIC* pDocBasic ) { DocBasicItemMap::iterator it = GaDocBasicItems::get().find( pDocBasic ); DocBasicItemMap::iterator end = GaDocBasicItems::get().end(); - return (it != end) ? it->second.get() : 0; + return (it != end) ? it->second.get() : nullptr; } void lclInsertDocBasicItem( StarBASIC& rDocBasic ) @@ -212,13 +212,13 @@ void lclRemoveDocBasicItem( StarBASIC& rDocBasic ) StarBASIC* lclGetDocBasicForModule( SbModule* pModule ) { - StarBASIC* pRetBasic = NULL; + StarBASIC* pRetBasic = nullptr; SbxObject* pCurParent = pModule; - while( pCurParent->GetParent() != NULL ) + while( pCurParent->GetParent() != nullptr ) { pCurParent = pCurParent->GetParent(); StarBASIC* pDocBasic = dynamic_cast( pCurParent ); - if( pDocBasic != NULL && pDocBasic->IsDocBasic() ) + if( pDocBasic != nullptr && pDocBasic->IsDocBasic() ) { pRetBasic = pDocBasic; break; @@ -262,14 +262,14 @@ SbxVariable* StarBASIC::VBAFind( const OUString& rName, SbxClassType t ) { if( rName == "ThisComponent" ) { - return NULL; + return nullptr; } // rename to init globals if ( getVBAGlobals( ) ) { return pVBAGlobals->Find( rName, t ); } - return NULL; + return nullptr; } // Create array for conversion SFX <-> VB error code @@ -418,27 +418,27 @@ SbxBase* SbiFactory::Create( sal_uInt16 nSbxId, sal_uInt32 nCreator ) switch( nSbxId ) { case SBXID_BASIC: - return new StarBASIC( NULL ); + return new StarBASIC( nullptr ); case SBXID_BASICMOD: return new SbModule( "" ); case SBXID_BASICPROP: - return new SbProperty( "", SbxVARIANT, NULL ); + return new SbProperty( "", SbxVARIANT, nullptr ); case SBXID_BASICMETHOD: - return new SbMethod( "", SbxVARIANT, NULL ); + return new SbMethod( "", SbxVARIANT, nullptr ); case SBXID_JSCRIPTMOD: return new SbJScriptModule( "" ); case SBXID_JSCRIPTMETH: - return new SbJScriptMethod( "", SbxVARIANT, NULL ); + return new SbJScriptMethod( "", SbxVARIANT, nullptr ); } } - return NULL; + return nullptr; } SbxObject* SbiFactory::CreateObject( const OUString& rClass ) { if( rClass.equalsIgnoreAsciiCase( "StarBASIC" ) ) { - return new StarBASIC( NULL ); + return new StarBASIC( nullptr ); } else if( rClass.equalsIgnoreAsciiCase( "StarBASICModule" ) ) { @@ -461,7 +461,7 @@ SbxObject* SbiFactory::CreateObject( const OUString& rClass ) { } } - return NULL; + return nullptr; } @@ -476,7 +476,7 @@ public: SbxBase* SbOLEFactory::Create( sal_uInt16, sal_uInt32 ) { // Not supported - return NULL; + return nullptr; } SbxObject* SbOLEFactory::CreateObject( const OUString& rClassName ) @@ -499,7 +499,7 @@ public: SbxBase* SbFormFactory::Create( sal_uInt16, sal_uInt32 ) { // Not supported - return NULL; + return nullptr; } SbxObject* SbFormFactory::CreateObject( const OUString& rClassName ) @@ -526,7 +526,7 @@ SbxObject* SbFormFactory::CreateObject( const OUString& rClassName ) } } } - return 0; + return nullptr; } @@ -581,8 +581,8 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ) { SbxBase* pObjBase = pVar->GetObject(); SbxObject* pSrcObj = dynamic_cast( pObjBase ); - SbxObject* pDestObj = NULL; - if( pSrcObj != NULL ) + SbxObject* pDestObj = nullptr; + if( pSrcObj != nullptr ) pDestObj = cloneTypeObjectImpl( *pSrcObj ); pNewProp->PutObject( pDestObj ); } @@ -603,12 +603,12 @@ public: SbxBase* SbTypeFactory::Create( sal_uInt16, sal_uInt32 ) { // Not supported - return NULL; + return nullptr; } SbxObject* SbTypeFactory::CreateObject( const OUString& rClassName ) { - SbxObject* pRet = NULL; + SbxObject* pRet = nullptr; SbModule* pMod = GetSbData()->pMod; if( pMod ) { @@ -691,7 +691,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) // Search for own copy of ImplMethod SbxVariable* p = pMethods->Find( pImplMethod->GetName(), SbxCLASS_METHOD ); - SbMethod* pImplMethodCopy = p ? dynamic_cast( p ) : NULL; + SbMethod* pImplMethodCopy = p ? dynamic_cast( p ) : nullptr; if( !pImplMethodCopy ) { OSL_FAIL( "Found no ImplMethod copy" ); @@ -738,12 +738,12 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) { SbxBase* pObjBase = pProp->GetObject(); SbxObject* pObj = dynamic_cast( pObjBase ); - if( pObj != NULL ) + if( pObj != nullptr ) { OUString aObjClass = pObj->GetClassName(); SbClassModuleObject* pClassModuleObj = dynamic_cast( pObjBase ); - if( pClassModuleObj != NULL ) + if( pClassModuleObj != nullptr ) { SbModule* pLclClassModule = pClassModuleObj->getClassModule(); SbClassModuleObject* pNewObj = new SbClassModuleObject( pLclClassModule ); @@ -784,8 +784,8 @@ SbClassModuleObject::~SbClassModuleObject() // Must be deleted by base class dtor because this data // is not owned by the SbClassModuleObject object - pImage = NULL; - pBreaks = NULL; + pImage = nullptr; + pBreaks = nullptr; } void SbClassModuleObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) @@ -885,7 +885,7 @@ void SbClassFactory::RemoveClassModule( SbModule* pClassModule ) SbxBase* SbClassFactory::Create( sal_uInt16, sal_uInt32 ) { // Not supported - return NULL; + return nullptr; } SbxObject* SbClassFactory::CreateObject( const OUString& rClassName ) @@ -903,7 +903,7 @@ SbxObject* SbClassFactory::CreateObject( const OUString& rClassName ) } } SbxVariable* pVar = xToUseClassModules->Find( rClassName, SbxCLASS_OBJECT ); - SbxObject* pRet = NULL; + SbxObject* pRet = nullptr; if( pVar ) { SbModule* pVarMod = static_cast(pVar); @@ -915,7 +915,7 @@ SbxObject* SbClassFactory::CreateObject( const OUString& rClassName ) SbModule* SbClassFactory::FindClass( const OUString& rClassName ) { SbxVariable* pVar = xClassModules->Find( rClassName, SbxCLASS_DONTCARE ); - SbModule* pMod = pVar ? static_cast(pVar) : NULL; + SbModule* pMod = pVar ? static_cast(pVar) : nullptr; return pMod; } @@ -923,7 +923,7 @@ StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic ) : SbxObject( OUString("StarBASIC") ), bDocBasic( bIsDocBasic ) { SetParent( p ); - pLibInfo = NULL; + pLibInfo = nullptr; bNoRtl = bBreak = false; bVBAEnabled = false; pModules = new SbxArray; @@ -946,7 +946,7 @@ StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic ) pRtl = new SbiStdObject(OUString(RTLNAME), this ); // Search via StarBasic is always global SetFlag( SbxFlagBits::GlobalSearch ); - pVBAGlobals = NULL; + pVBAGlobals = nullptr; bQuit = false; if( bDocBasic ) @@ -970,22 +970,22 @@ StarBASIC::~StarBASIC() if( !--GetSbData()->nInst ) { RemoveFactory( GetSbData()->pSbFac ); - delete GetSbData()->pSbFac; GetSbData()->pSbFac = NULL; + delete GetSbData()->pSbFac; GetSbData()->pSbFac = nullptr; RemoveFactory( GetSbData()->pUnoFac ); - delete GetSbData()->pUnoFac; GetSbData()->pUnoFac = NULL; + delete GetSbData()->pUnoFac; GetSbData()->pUnoFac = nullptr; RemoveFactory( GetSbData()->pTypeFac ); - delete GetSbData()->pTypeFac; GetSbData()->pTypeFac = NULL; + delete GetSbData()->pTypeFac; GetSbData()->pTypeFac = nullptr; RemoveFactory( GetSbData()->pClassFac ); - delete GetSbData()->pClassFac; GetSbData()->pClassFac = NULL; + delete GetSbData()->pClassFac; GetSbData()->pClassFac = nullptr; RemoveFactory( GetSbData()->pOLEFac ); - delete GetSbData()->pOLEFac; GetSbData()->pOLEFac = NULL; + delete GetSbData()->pOLEFac; GetSbData()->pOLEFac = nullptr; RemoveFactory( GetSbData()->pFormFac ); - delete GetSbData()->pFormFac; GetSbData()->pFormFac = NULL; + delete GetSbData()->pFormFac; GetSbData()->pFormFac = nullptr; if( SbiGlobals::pGlobals ) { delete SbiGlobals::pGlobals; - SbiGlobals::pGlobals = 0; + SbiGlobals::pGlobals = nullptr; } } else if( bDocBasic ) @@ -1008,9 +1008,9 @@ StarBASIC::~StarBASIC() for( sal_uInt16 i = 0 ; i < uCount ; i++ ) { SbxVariable* pListenerObj = xUnoListeners->Get( i ); - pListenerObj->SetParent( NULL ); + pListenerObj->SetParent( nullptr ); } - xUnoListeners = NULL; + xUnoListeners = nullptr; } clearUnoMethodsForBasic( this ); @@ -1077,7 +1077,7 @@ SbModule* StarBASIC::MakeModule32( const OUString& rName, const ModuleInfo& mInf SAL_INFO( "basic", "create module " << rName << " type mInfo " << mInfo.ModuleType); - SbModule* p = NULL; + SbModule* p = nullptr; switch ( mInfo.ModuleType ) { case ModuleType::DOCUMENT: @@ -1130,7 +1130,7 @@ void StarBASIC::Remove( SbxVariable* pVar ) // #87540 Can be last reference! SbxVariableRef xVar = pVar; pModules->Remove( pVar ); - pVar->SetParent( 0 ); + pVar->SetParent( nullptr ); EndListening( pVar->GetBroadcaster() ); } else @@ -1162,7 +1162,7 @@ SbModule* StarBASIC::FindModule( const OUString& rName ) return p; } } - return NULL; + return nullptr; } @@ -1173,7 +1173,7 @@ struct ClassModuleRunInitItem bool m_bRunInitDone; ClassModuleRunInitItem() - : m_pModule( NULL ) + : m_pModule( nullptr ) , m_bProcessing( false ) , m_bRunInitDone( false ) {} @@ -1196,7 +1196,7 @@ void SbModule::implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassMod rItem.m_bProcessing = true; SbModule* pModule = rItem.m_pModule; - if( pModule->pClassData != NULL ) + if( pModule->pClassData != nullptr ) { StringVector& rReqTypes = pModule->pClassData->maRequiredTypes; if( rReqTypes.size() > 0 ) @@ -1300,7 +1300,7 @@ void StarBASIC::DeInitAllModules() for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = static_cast(pModules->Get( nMod )); - if( pModule->pImage && !pModule->isProxyModule() && 0 == dynamic_cast( pModule) ) + if( pModule->pImage && !pModule->isProxyModule() && nullptr == dynamic_cast( pModule) ) { pModule->pImage->bInit = false; } @@ -1325,8 +1325,8 @@ void StarBASIC::DeInitAllModules() // If this fails again a conventional search over objects is performend. SbxVariable* StarBASIC::Find( const OUString& rName, SbxClassType t ) { - SbxVariable* pRes = NULL; - SbModule* pNamed = NULL; + SbxVariable* pRes = nullptr; + SbModule* pNamed = nullptr; // "Extended" search in Runtime Lib // but only if SbiRuntime has not set the flag if( !bNoRtl ) @@ -1418,11 +1418,11 @@ SbxBase* StarBASIC::FindSBXInCurrentScope( const OUString& rName ) { if( !GetSbData()->pInst ) { - return NULL; + return nullptr; } if( !GetSbData()->pInst->pRun ) { - return NULL; + return nullptr; } return GetSbData()->pInst->pRun->FindElementExtern( rName ); } @@ -1445,7 +1445,7 @@ void StarBASIC::Stop() bool StarBASIC::IsRunning() { - return GetSbData()->pInst != NULL; + return GetSbData()->pInst != nullptr; } /************************************************************************** @@ -1462,7 +1462,7 @@ SbMethod* StarBASIC::GetActiveMethod( sal_uInt16 nLevel ) } else { - return NULL; + return nullptr; } } @@ -1893,7 +1893,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer ) { SbxVariable* pVar = pObjs->Get( nObj ); StarBASIC* pBasic = dynamic_cast( pVar ); - ppDeleteTab[nObj] = pBasic ? NULL : pVar; + ppDeleteTab[nObj] = pBasic ? nullptr : pVar; } for( nObj = 0 ; nObj < nObjCount ; nObj++ ) { @@ -1924,7 +1924,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer ) { return false; } - else if( 0 != dynamic_cast( pMod) ) + else if( nullptr != dynamic_cast( pMod) ) { // assign Ref, so that pMod will be deleted SbModuleRef xRef = pMod; @@ -1986,16 +1986,16 @@ bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, css::uno::Any& aOut Reference< frame::XModel > StarBASIC::GetModelFromBasic( SbxObject* pBasic ) { - OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" ); + OSL_PRECOND( pBasic != nullptr, "getModelFromBasic: illegal call!" ); if ( !pBasic ) { - return NULL; + return nullptr; } // look for the ThisComponent variable, first in the parent (which // might be the document's Basic), then in the parent's parent (which might be // the application Basic) const OUString sThisComponent( "ThisComponent"); - SbxVariable* pThisComponent = NULL; + SbxVariable* pThisComponent = nullptr; SbxObject* pLookup = pBasic->GetParent(); while ( pLookup && !pThisComponent ) @@ -2007,7 +2007,7 @@ Reference< frame::XModel > StarBASIC::GetModelFromBasic( SbxObject* pBasic ) { OSL_TRACE("Failed to get ThisComponent"); // the application Basic, at the latest, should have this variable - return NULL; + return nullptr; } Any aThisComponentAny( sbxToUnoValue( pThisComponent ) ); @@ -2023,7 +2023,7 @@ Reference< frame::XModel > StarBASIC::GetModelFromBasic( SbxObject* pBasic ) } if ( !xModel.is() ) { - return NULL; + return nullptr; } #if OSL_DEBUG_LEVEL > 0 OSL_TRACE("Have model ThisComponent points to url %s", @@ -2055,8 +2055,8 @@ static const char pItemStr[] = "Item"; static const char pRemoveStr[] = "Remove"; static sal_uInt16 nCountHash = 0, nAddHash, nItemHash, nRemoveHash; -SbxInfoRef BasicCollection::xAddInfo = NULL; -SbxInfoRef BasicCollection::xItemInfo = NULL; +SbxInfoRef BasicCollection::xAddInfo = nullptr; +SbxInfoRef BasicCollection::xItemInfo = nullptr; BasicCollection::BasicCollection( const OUString& rClass ) : SbxObject( rClass ) @@ -2292,7 +2292,7 @@ void BasicCollection::CollItem( SbxArray* pPar_ ) SetError( ERRCODE_SBX_WRONG_ARGS ); return; } - SbxVariable* pRes = NULL; + SbxVariable* pRes = nullptr; SbxVariable* p = pPar_->Get( 1 ); sal_Int32 nIndex = implGetIndex( p ); if( nIndex >= 0 && nIndex < (sal_Int32)xItemArray->Count32() ) @@ -2311,7 +2311,7 @@ void BasicCollection::CollItem( SbxArray* pPar_ ) void BasicCollection::CollRemove( SbxArray* pPar_ ) { - if( pPar_ == NULL || pPar_->Count() != 2 ) + if( pPar_ == nullptr || pPar_->Count() != 2 ) { SetError( ERRCODE_SBX_WRONG_ARGS ); return; @@ -2325,11 +2325,11 @@ void BasicCollection::CollRemove( SbxArray* pPar_ ) // Correct for stack if necessary SbiInstance* pInst = GetSbData()->pInst; - SbiRuntime* pRT = pInst ? pInst->pRun : NULL; + SbiRuntime* pRT = pInst ? pInst->pRun : nullptr; if( pRT ) { SbiForStack* pStack = pRT->FindForStackItemForCollection( this ); - if( pStack != NULL ) + if( pStack != nullptr ) { if( pStack->nCurCollectionIndex >= nIndex ) { diff --git a/basic/source/classes/sbintern.cxx b/basic/source/classes/sbintern.cxx index 4e2c72d28e8b..26b02161d2bf 100644 --- a/basic/source/classes/sbintern.cxx +++ b/basic/source/classes/sbintern.cxx @@ -25,7 +25,7 @@ #include "codegen.hxx" #include -SbiGlobals* SbiGlobals::pGlobals = 0; +SbiGlobals* SbiGlobals::pGlobals = nullptr; SbiGlobals* GetSbData() { @@ -36,15 +36,15 @@ SbiGlobals* GetSbData() SbiGlobals::SbiGlobals() { - pInst = NULL; - pSbFac= NULL; - pUnoFac = NULL; - pTypeFac = NULL; - pClassFac = NULL; - pOLEFac = NULL; - pFormFac = NULL; - pMod = NULL; - pCompMod = NULL; // JSM + pInst = nullptr; + pSbFac= nullptr; + pUnoFac = nullptr; + pTypeFac = nullptr; + pClassFac = nullptr; + pOLEFac = nullptr; + pFormFac = nullptr; + pMod = nullptr; + pCompMod = nullptr; // JSM nInst = 0; nCode = 0; nLine = 0; @@ -52,10 +52,10 @@ SbiGlobals::SbiGlobals() bCompiler = false; bGlobalInitErr = false; bRunInit = false; - pTransliterationWrapper = NULL; + pTransliterationWrapper = nullptr; bBlockCompilerError = false; - pAppBasMgr = NULL; - pMSOMacroRuntimLib = NULL; + pAppBasMgr = nullptr; + pMSOMacroRuntimLib = nullptr; } SbiGlobals::~SbiGlobals() diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 4d7c18924742..0a05bbfee05d 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -132,7 +132,7 @@ bool SbUnoObject::getDefaultPropName( SbUnoObject* pUnoObj, OUString& sDfltProp SbxVariable* getDefaultProp( SbxVariable* pRef ) { - SbxVariable* pDefaultProp = NULL; + SbxVariable* pDefaultProp = nullptr; if ( pRef->GetType() == SbxOBJECT ) { SbxObject* pObj = dynamic_cast(pRef); @@ -258,7 +258,7 @@ SbUnoObject* createOLEObject_Impl( const OUString& aType ) } } - SbUnoObject* pUnoObj = NULL; + SbUnoObject* pUnoObj = nullptr; if( xOLEFactory.is() ) { // some type names available in VBA can not be directly used in COM @@ -530,7 +530,7 @@ SbxDataType unoToSbxType( const Reference< XIdlClass >& xIdlClass ) return eRetType; } -static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int32 >& indices, Sequence< sal_Int32 >& sizes, const Any& aValue, sal_Int32& dimension, bool bIsZeroIndex, Type* pType = NULL ) +static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int32 >& indices, Sequence< sal_Int32 >& sizes, const Any& aValue, sal_Int32& dimension, bool bIsZeroIndex, Type* pType = nullptr ) { Type aType = aValue.getValueType(); TypeClass eTypeClass = aType.getTypeClass(); @@ -541,7 +541,7 @@ static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int { Reference< XIdlClass > xIdlTargetClass = TypeToIdlClass( aType ); Reference< XIdlArray > xIdlArray = xIdlTargetClass->getArray(); - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; aType.getDescription( &pTD ); Type aElementType( reinterpret_cast(pTD)->pType ); ::typelib_typedescription_release( pTD ); @@ -635,7 +635,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) // If the object is invalid deliver null if( pSbUnoObject->getUnoAny().getValueType().getTypeClass() == TypeClass_VOID ) { - pVar->PutObject( NULL ); + pVar->PutObject( nullptr ); } else { @@ -654,7 +654,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) NativeObjectWrapper aNativeObjectWrapper; if ( (aValue >>= aWrap) ) { - SbxDimArray* pArray = NULL; + SbxDimArray* pArray = nullptr; Sequence< sal_Int32 > indices; Sequence< sal_Int32 > sizes; sal_Int32 dimension = 0; @@ -736,7 +736,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) // If the object is invalid deliver null if( pSbUnoObject->getUnoAny().getValueType().getTypeClass() == TypeClass_VOID ) { - pVar->PutObject( NULL ); + pVar->PutObject( nullptr ); } else { @@ -760,7 +760,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) Reference< XIdlArray > xIdlArray = xIdlTargetClass->getArray(); sal_Int32 i, nLen = xIdlArray->getLen( aValue ); - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; aType.getDescription( &pTD ); OSL_ASSERT( pTD && pTD->eTypeClass == typelib_TypeClass_SEQUENCE ); Type aElementType( reinterpret_cast(pTD)->pType ); @@ -875,7 +875,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) return aRetType; } - if( 0 != dynamic_cast( &xObj) ) + if( nullptr != dynamic_cast( &xObj) ) { SbxBase* pObj = static_cast(xObj); SbxDimArray* pArray = static_cast(pObj); @@ -969,12 +969,12 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) } } // No array, but ... - else if( 0 != dynamic_cast( &xObj) ) + else if( nullptr != dynamic_cast( &xObj) ) { aRetType = static_cast(static_cast(xObj))->getUnoAny().getValueType(); } // SbUnoAnyObject? - else if( 0 != dynamic_cast( &xObj) ) + else if( nullptr != dynamic_cast( &xObj) ) { aRetType = static_cast(static_cast(xObj))->getValue().getValueType(); } @@ -997,9 +997,9 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType SbxBaseRef xObj = pVar->GetObject(); if( xObj.Is() ) { - if( 0 != dynamic_cast( &xObj) ) + if( nullptr != dynamic_cast( &xObj) ) return static_cast(static_cast(xObj))->getValue(); - if( 0 != dynamic_cast( &xObj) ) + if( nullptr != dynamic_cast( &xObj) ) { Any aRetAny; SbClassModuleObject* pClassModuleObj = static_cast(static_cast(xObj)); @@ -1007,11 +1007,11 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) ) return aRetAny; } - if( 0 == dynamic_cast( &xObj) ) + if( nullptr == dynamic_cast( &xObj) ) { // Create NativeObjectWrapper to identify object in case of callbacks SbxObject* pObj = dynamic_cast( pVar->GetObject() ); - if( pObj != NULL ) + if( pObj != nullptr ) { NativeObjectWrapper aNativeObjectWrapper; sal_uInt32 nIndex = lcl_registerNativeObjectWrapper( pObj ); @@ -1197,7 +1197,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper if( eBaseType == SbxOBJECT ) { SbxBaseRef xObj = pVar->GetObject(); - if( xObj.Is() && 0 != dynamic_cast( &xObj) ) + if( xObj.Is() && nullptr != dynamic_cast( &xObj) ) { return static_cast(static_cast(xObj))->getValue(); } @@ -1252,11 +1252,11 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper } SbxBaseRef pObj = pVar->GetObject(); - if( pObj && 0 != dynamic_cast( &pObj) ) + if( pObj && nullptr != dynamic_cast( &pObj) ) { aRetVal = static_cast(static_cast(pObj))->getUnoAny(); } - else if( pObj && 0 != dynamic_cast( &pObj) ) + else if( pObj && nullptr != dynamic_cast( &pObj) ) { aRetVal = static_cast(static_cast(pObj))->getUnoAny(); } @@ -1278,7 +1278,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper Reference< XIdlClass > xIdlClass; SbxBaseRef pObj = pVar->GetObject(); - if( pObj && 0 != dynamic_cast( &pObj) ) + if( pObj && nullptr != dynamic_cast( &pObj) ) { Any aUnoAny = static_cast(static_cast(pObj))->getUnoAny(); aUnoAny >>= xIdlClass; @@ -1314,7 +1314,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper case TypeClass_SEQUENCE: { SbxBaseRef xObj = pVar->GetObject(); - if( xObj && 0 != dynamic_cast( &xObj) ) + if( xObj && nullptr != dynamic_cast( &xObj) ) { SbxBase* pObj = static_cast(xObj); SbxDimArray* pArray = static_cast(pObj); @@ -1335,7 +1335,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper // Element-Type OUString aClassName = xIdlTargetClass->getName(); - typelib_TypeDescription * pSeqTD = 0; + typelib_TypeDescription * pSeqTD = nullptr; typelib_typedescription_getByName( &pSeqTD, aClassName.pData ); OSL_ASSERT( pSeqTD ); Type aElemType( reinterpret_cast(pSeqTD)->pType ); @@ -1370,7 +1370,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper else if( nDims > 1 ) { // Element-Type - typelib_TypeDescription * pSeqTD = 0; + typelib_TypeDescription * pSeqTD = nullptr; Type aCurType( rType ); sal_Int32 nSeqLevel = 0; Type aElemType; @@ -1474,7 +1474,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, bool bOLEAutomation, sal_uInt32 nParamCount ) { - AutomationNamedArgsSbxArray* pArgNamesArray = NULL; + AutomationNamedArgsSbxArray* pArgNamesArray = nullptr; if( bOLEAutomation ) pArgNamesArray = dynamic_cast( pParams ); @@ -1792,7 +1792,7 @@ OUString Impl_GetSupportedInterfaces(SbUnoObject& rUnoObj) } else { - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; rType.getDescription( &pTD ); aRet.append( "*** ERROR: No IdlClass for type \"" ); @@ -2125,7 +2125,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) // take over the value from Uno to Sbx unoToSbxValue( pVar, aRetAny ); if( pParams && bCanBeConsideredAMethod ) - pVar->SetParameters( NULL ); + pVar->SetParameters( nullptr ); } catch( const Exception& ) @@ -2305,7 +2305,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) // remove parameter here, because this was not done anymore in unoToSbxValue() // for arrays if( pParams ) - pVar->SetParameters( NULL ); + pVar->SetParameters( nullptr ); } catch( const Exception& ) { @@ -2469,7 +2469,7 @@ void SbUnoObject::doIntrospection() // Start of a list of all SbUnoMethod-Instances -static SbUnoMethod* pFirst = NULL; +static SbUnoMethod* pFirst = nullptr; void clearUnoMethodsForBasic( StarBASIC* pBasic ) { @@ -2495,8 +2495,8 @@ void clearUnoMethodsForBasic( StarBASIC* pBasic ) if( pMeth->pNext ) pMeth->pNext->pPrev = pMeth->pPrev; - pMeth->pPrev = NULL; - pMeth->pNext = NULL; + pMeth->pPrev = nullptr; + pMeth->pNext = nullptr; pMeth->SbxValue::Clear(); pObject->SbxValue::Clear(); @@ -2534,11 +2534,11 @@ SbUnoMethod::SbUnoMethod , mbInvocation( bInvocation ) { m_xUnoMethod = xUnoMethod_; - pParamInfoSeq = NULL; + pParamInfoSeq = nullptr; // enregister the method in a list pNext = pFirst; - pPrev = NULL; + pPrev = nullptr; pFirst = this; if( pNext ) pNext->pPrev = this; @@ -2888,7 +2888,7 @@ SbUnoObject* Impl_CreateUnoStruct( const OUString& aClassName ) // get CoreReflection Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); if( !xCoreReflection.is() ) - return NULL; + return nullptr; // search for the class Reference< XIdlClass > xClass; @@ -2897,12 +2897,12 @@ SbUnoObject* Impl_CreateUnoStruct( const OUString& aClassName ) if( xHarryName.is() && xHarryName->hasByHierarchicalName( aClassName ) ) xClass = xCoreReflection->forName( aClassName ); if( !xClass.is() ) - return NULL; + return nullptr; // Is it really a struct? TypeClass eType = xClass->getTypeClass(); if ( ( eType != TypeClass_STRUCT ) && ( eType != TypeClass_EXCEPTION ) ) - return NULL; + return nullptr; // create an instance Any aNewAny; @@ -2917,7 +2917,7 @@ SbUnoObject* Impl_CreateUnoStruct( const OUString& aClassName ) SbxBase* SbUnoFactory::Create( sal_uInt16, sal_uInt32 ) { // Via SbxId nothing works in Uno - return NULL; + return nullptr; } SbxObject* SbUnoFactory::CreateObject( const OUString& rClassName ) @@ -3020,12 +3020,12 @@ void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) } else { - refVar->PutObject( NULL ); + refVar->PutObject( nullptr ); } } else { - refVar->PutObject( NULL ); + refVar->PutObject( nullptr ); } } @@ -3075,12 +3075,12 @@ void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar, } else { - refVar->PutObject( NULL ); + refVar->PutObject( nullptr ); } } else { - refVar->PutObject( NULL ); + refVar->PutObject( nullptr ); } } @@ -3120,7 +3120,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) // get the Uno-Object SbxBaseRef pObj = rPar.Get( 1 )->GetObject(); - if( !(pObj && 0 != dynamic_cast( &pObj)) ) + if( !(pObj && nullptr != dynamic_cast( &pObj)) ) { return; } @@ -3186,7 +3186,7 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) return; } SbxBaseRef pObj = rPar.Get( 1 )->GetObject(); - if( !(pObj && 0 != dynamic_cast( &pObj)) ) + if( !(pObj && nullptr != dynamic_cast( &pObj)) ) { return; } @@ -3221,7 +3221,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) return; } SbxBaseRef pObj1 = xParam1->GetObject(); - if( !(pObj1 && 0 != dynamic_cast( &pObj1 )) ) + if( !(pObj1 && nullptr != dynamic_cast( &pObj1 )) ) { return; } @@ -3240,7 +3240,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) return; } SbxBaseRef pObj2 = xParam2->GetObject(); - if( !(pObj2 && 0 != dynamic_cast( &pObj2 )) ) + if( !(pObj2 && nullptr != dynamic_cast( &pObj2 )) ) { return; } @@ -3360,7 +3360,7 @@ VBAConstantHelper::isVBAConstantType( const OUString& rName ) SbxVariable* VBAConstantHelper::getVBAConstant( const OUString& rName ) { - SbxVariable* pConst = NULL; + SbxVariable* pConst = nullptr; init(); OUString sKey( rName ); @@ -3382,7 +3382,7 @@ VBAConstantHelper::getVBAConstant( const OUString& rName ) SbUnoClass* findUnoClass( const OUString& rName ) { // #105550 Check if module exists - SbUnoClass* pUnoClass = NULL; + SbUnoClass* pUnoClass = nullptr; Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl(); if( xTypeAccess->hasByHierarchicalName( rName ) ) @@ -3535,7 +3535,7 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType ) SbUnoService* findUnoService( const OUString& rName ) { - SbUnoService* pSbUnoService = NULL; + SbUnoService* pSbUnoService = nullptr; Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl(); if( xTypeAccess->hasByHierarchicalName( rName ) ) @@ -3754,7 +3754,7 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) -static SbUnoServiceCtor* pFirstCtor = NULL; +static SbUnoServiceCtor* pFirstCtor = nullptr; void clearUnoServiceCtors() { @@ -3769,7 +3769,7 @@ void clearUnoServiceCtors() SbUnoServiceCtor::SbUnoServiceCtor( const OUString& aName_, Reference< XServiceConstructorDescription > xServiceCtorDesc ) : SbxMethod( aName_, SbxOBJECT ) , m_xServiceCtorDesc( xServiceCtorDesc ) - , pNext(0) + , pNext(nullptr) { } @@ -3779,7 +3779,7 @@ SbUnoServiceCtor::~SbUnoServiceCtor() SbxInfo* SbUnoServiceCtor::GetInfo() { - SbxInfo* pRet = NULL; + SbxInfo* pRet = nullptr; return pRet; } @@ -3787,7 +3787,7 @@ SbxInfo* SbUnoServiceCtor::GetInfo() SbUnoSingleton* findUnoSingleton( const OUString& rName ) { - SbUnoSingleton* pSbUnoSingleton = NULL; + SbUnoSingleton* pSbUnoSingleton = nullptr; Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl(); if( xTypeAccess->hasByHierarchicalName( rName ) ) @@ -3959,7 +3959,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet // Methods of Listener void BasicAllListener_Impl::firing( const AllEventObject& Event ) throw ( RuntimeException, std::exception ) { - firing_impl( Event, NULL ); + firing_impl( Event, nullptr ); } Any BasicAllListener_Impl::approveFiring( const AllEventObject& Event ) throw ( RuntimeException, std::exception ) @@ -4250,7 +4250,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) Reference< XIdlClass > xIdlClass; SbxBaseRef pObj = pVal->GetObject(); - if( pObj && 0 != dynamic_cast( &pObj) ) + if( pObj && nullptr != dynamic_cast( &pObj) ) { Any aUnoAny = static_cast(static_cast(pObj))->getUnoAny(); aUnoAny >>= xIdlClass; @@ -4345,7 +4345,7 @@ ModuleInvocationProxy::ModuleInvocationProxy( const OUString& aPrefix, SbxObject , m_xScopeObj( xScopeObj ) , m_aListeners( m_aMutex ) { - m_bProxyIsClassModuleObject = xScopeObj.Is() && 0 != dynamic_cast( &xScopeObj ); + m_bProxyIsClassModuleObject = xScopeObj.Is() && nullptr != dynamic_cast( &xScopeObj ); } Reference< XIntrospectionAccess > SAL_CALL ModuleInvocationProxy::getIntrospection() throw(std::exception) @@ -4366,8 +4366,8 @@ void SAL_CALL ModuleInvocationProxy::setValue(const OUString& rProperty, const A aPropertyFunctionName += rProperty; SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxCLASS_METHOD ); - SbMethod* pMeth = p != NULL ? dynamic_cast( p ) : NULL; - if( pMeth == NULL ) + SbMethod* pMeth = p != nullptr ? dynamic_cast( p ) : nullptr; + if( pMeth == nullptr ) { // TODO: Check vba behavior concernig missing function //StarBASIC::Error( ERRCODE_BASIC_NO_METHOD, aFunctionName ); @@ -4384,7 +4384,7 @@ void SAL_CALL ModuleInvocationProxy::setValue(const OUString& rProperty, const A SbxVariableRef xValue = new SbxVariable; pMeth->SetParameters( xArray ); pMeth->Call( xValue ); - pMeth->SetParameters( NULL ); + pMeth->SetParameters( nullptr ); // TODO: OutParameter? @@ -4406,8 +4406,8 @@ Any SAL_CALL ModuleInvocationProxy::getValue(const OUString& rProperty) aPropertyFunctionName += rProperty; SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxCLASS_METHOD ); - SbMethod* pMeth = p != NULL ? dynamic_cast( p ) : NULL; - if( pMeth == NULL ) + SbMethod* pMeth = p != nullptr ? dynamic_cast( p ) : nullptr; + if( pMeth == nullptr ) { // TODO: Check vba behavior concernig missing function //StarBASIC::Error( ERRCODE_BASIC_NO_METHOD, aFunctionName ); @@ -4463,8 +4463,8 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction, } SbxVariable* p = xScopeObj->Find( aFunctionName, SbxCLASS_METHOD ); - SbMethod* pMeth = p != NULL ? dynamic_cast( p ) : NULL; - if( pMeth == NULL ) + SbMethod* pMeth = p != nullptr ? dynamic_cast( p ) : nullptr; + if( pMeth == nullptr ) { // TODO: Check vba behavior concernig missing function //StarBASIC::Error( ERRCODE_BASIC_NO_METHOD, aFunctionName ); @@ -4492,7 +4492,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction, pMeth->SetParameters( xArray ); pMeth->Call( xValue ); aRet = sbxToUnoValue( xValue ); - pMeth->SetParameters( NULL ); + pMeth->SetParameters( nullptr ); if( bSetRescheduleBack ) pInst->EnableReschedule( bOldReschedule ); @@ -4510,7 +4510,7 @@ void SAL_CALL ModuleInvocationProxy::dispose() EventObject aEvent( static_cast(this) ); m_aListeners.disposeAndClear( aEvent ); - m_xScopeObj = NULL; + m_xScopeObj = nullptr; } void SAL_CALL ModuleInvocationProxy::addEventListener( const Reference< XEventListener >& xListener ) @@ -4590,8 +4590,8 @@ static DisposeItemVector::iterator lcl_findItemForBasic( StarBASIC* pBasic ) static StarBasicDisposeItem* lcl_getOrCreateItemForBasic( StarBASIC* pBasic ) { DisposeItemVector::iterator it = lcl_findItemForBasic( pBasic ); - StarBasicDisposeItem* pItem = (it != GaDisposeItemVector.end()) ? *it : NULL; - if( pItem == NULL ) + StarBasicDisposeItem* pItem = (it != GaDisposeItemVector.end()) ? *it : nullptr; + if( pItem == nullptr ) { pItem = new StarBasicDisposeItem( pBasic ); GaDisposeItemVector.push_back( pItem ); @@ -4703,7 +4703,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP Reference< XComponent > xComponent( xProxy, UNO_QUERY ); if( xComponent.is() ) { - StarBASIC* pParentBasic = NULL; + StarBASIC* pParentBasic = nullptr; SbxObject* pCurObject = this; do { @@ -4711,9 +4711,9 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP pParentBasic = dynamic_cast( pObjParent ); pCurObject = pObjParent; } - while( pParentBasic == NULL && pCurObject != NULL ); + while( pParentBasic == nullptr && pCurObject != nullptr ); - OSL_ASSERT( pParentBasic != NULL ); + OSL_ASSERT( pParentBasic != nullptr ); registerComponentToBeDisposedForBasic( xComponent, pParentBasic ); } @@ -4734,8 +4734,8 @@ bool handleToStringForCOMObjects( SbxObject* pObj, SbxValue* pVal ) { bool bSuccess = false; - SbUnoObject* pUnoObj = NULL; - if( pObj != NULL && (pUnoObj = dynamic_cast( pObj)) != NULL ) + SbUnoObject* pUnoObj = nullptr; + if( pObj != nullptr && (pUnoObj = dynamic_cast( pObj)) != nullptr ) { // Only for native COM objects if( pUnoObj->isNativeCOMObject() ) @@ -4758,7 +4758,7 @@ Any StructRefInfo::getValue() Any aRet; uno_any_destruct( &aRet, reinterpret_cast< uno_ReleaseFunc >(cpp_release) ); - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; maType.getDescription(&pTD); uno_any_construct( &aRet, getInst(), pTD, @@ -4809,7 +4809,7 @@ void SbUnoStructRefObject::initMemberCache() if ( mbMemberCacheInit ) return; sal_Int32 nAll = 0; - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; maMemberInfo.getType().getDescription(&pTD); typelib_CompoundTypeDescription * pCompTypeDescr = reinterpret_cast(pTD); for ( ; pCompTypeDescr; pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription ) diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index ed7102bc0cde..084db8cd82d7 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -227,7 +227,7 @@ Sequence< Type > SAL_CALL DocObjectWrapper::getTypes() Reference< XIntrospectionAccess > SAL_CALL DocObjectWrapper::getIntrospection( ) throw (RuntimeException, std::exception) { - return NULL; + return nullptr; } Any SAL_CALL @@ -319,7 +319,7 @@ DocObjectWrapper::invoke( const OUString& aFunctionName, const Sequence< Any >& // get return value aReturn = sbxToUnoValue( xReturn ); - pMethod->SetParameters( NULL ); + pMethod->SetParameters( nullptr ); return aReturn; } @@ -385,7 +385,7 @@ Any SAL_CALL DocObjectWrapper::queryInterface( const Type& aType ) SbMethodRef DocObjectWrapper::getMethod( const OUString& aName ) throw (RuntimeException, std::exception) { - SbMethodRef pMethod = NULL; + SbMethodRef pMethod = nullptr; if ( m_pMod ) { SbxFlagBits nSaveFlgs = m_pMod->GetFlags(); @@ -400,7 +400,7 @@ SbMethodRef DocObjectWrapper::getMethod( const OUString& aName ) throw (RuntimeE SbPropertyRef DocObjectWrapper::getProperty( const OUString& aName ) throw (RuntimeException, std::exception) { - SbPropertyRef pProperty = NULL; + SbPropertyRef pProperty = nullptr; if ( m_pMod ) { SbxFlagBits nSaveFlgs = m_pMod->GetFlags(); @@ -483,7 +483,7 @@ IMPL_STATIC_LINK_NOARG_TYPED( AsyncQuitHandler, OnAsyncQuit, void*, void ) SbModule::SbModule( const OUString& rName, bool bVBACompat ) : SbxObject( "StarBASICModule" ), - pImage( NULL ), pBreaks( NULL ), pClassData( NULL ), mbVBACompat( bVBACompat ), pDocObject( NULL ), bIsProxyModule( false ) + pImage( nullptr ), pBreaks( nullptr ), pClassData( nullptr ), mbVBACompat( bVBACompat ), pDocObject( nullptr ), bIsProxyModule( false ) { SetName( rName ); SetFlag( SbxFlagBits::ExtSearch | SbxFlagBits::GlobalSearch ); @@ -491,7 +491,7 @@ SbModule::SbModule( const OUString& rName, bool bVBACompat ) // #i92642: Set name property to intitial name SbxVariable* pNameProp = pProps->Find( "Name", SbxCLASS_PROPERTY ); - if( pNameProp != NULL ) + if( pNameProp != nullptr ) { pNameProp->PutString( GetName() ); } @@ -503,7 +503,7 @@ SbModule::~SbModule() delete pImage; delete pBreaks; delete pClassData; - mxWrapper = NULL; + mxWrapper = nullptr; } uno::Reference< script::XInvocation > @@ -518,12 +518,12 @@ SbModule::GetUnoModule() bool SbModule::IsCompiled() const { - return pImage != 0; + return pImage != nullptr; } const SbxObject* SbModule::FindType( const OUString& aTypeName ) const { - return pImage ? pImage->FindType( aTypeName ) : NULL; + return pImage ? pImage->FindType( aTypeName ) : nullptr; } @@ -531,7 +531,7 @@ const SbxObject* SbModule::FindType( const OUString& aTypeName ) const void SbModule::StartDefinitions() { - delete pImage; pImage = NULL; + delete pImage; pImage = nullptr; if( pClassData ) pClassData->clear(); @@ -559,7 +559,7 @@ void SbModule::StartDefinitions() SbMethod* SbModule::GetMethod( const OUString& rName, SbxDataType t ) { SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD ); - SbMethod* pMeth = p ? dynamic_cast( p ) : NULL; + SbMethod* pMeth = p ? dynamic_cast( p ) : nullptr; if( p && !pMeth ) { pMethods->Remove( p ); @@ -591,7 +591,7 @@ SbMethod* SbModule::GetMethod( const OUString& rName, SbxDataType t ) SbProperty* SbModule::GetProperty( const OUString& rName, SbxDataType t ) { SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY ); - SbProperty* pProp = p ? dynamic_cast( p ) : NULL; + SbProperty* pProp = p ? dynamic_cast( p ) : nullptr; if( p && !pProp ) { pProps->Remove( p ); @@ -610,7 +610,7 @@ SbProperty* SbModule::GetProperty( const OUString& rName, SbxDataType t ) SbProcedureProperty* SbModule::GetProcedureProperty( const OUString& rName, SbxDataType t ) { SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY ); - SbProcedureProperty* pProp = p ? dynamic_cast( p ) : NULL; + SbProcedureProperty* pProp = p ? dynamic_cast( p ) : nullptr; if( p && !pProp ) { pProps->Remove( p ); @@ -629,7 +629,7 @@ SbProcedureProperty* SbModule::GetProcedureProperty( const OUString& rName, SbxD SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth ) { SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD ); - SbIfaceMapperMethod* pMapperMethod = p ? dynamic_cast( p ) : NULL; + SbIfaceMapperMethod* pMapperMethod = p ? dynamic_cast( p ) : nullptr; if( p && !pMapperMethod ) { pMethods->Remove( p ); @@ -679,7 +679,7 @@ void SbModule::EndDefinitions( bool bNewState ) void SbModule::Clear() { - delete pImage; pImage = NULL; + delete pImage; pImage = nullptr; if( pClassData ) pClassData->clear(); SbxObject::Clear(); @@ -692,7 +692,7 @@ SbxVariable* SbModule::Find( const OUString& rName, SbxClassType t ) SbxVariable* pRes = SbxObject::Find( rName, t ); if ( bIsProxyModule && !GetSbData()->bRunInit ) { - return NULL; + return nullptr; } if( !pRes && pImage ) { @@ -764,7 +764,7 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) aVals.eType = SbxVARIANT; SbxArray* pArg = pVar->GetParameters(); - sal_uInt16 nVarParCount = (pArg != NULL) ? pArg->Count() : 0; + sal_uInt16 nVarParCount = (pArg != nullptr) ? pArg->Count() : 0; if( nVarParCount > 1 ) { SbxArrayRef xMethParameters = new SbxArray; @@ -777,7 +777,7 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) pMethVar->SetParameters( xMethParameters ); pMethVar->Get( aVals ); - pMethVar->SetParameters( NULL ); + pMethVar->SetParameters( nullptr ); } else { @@ -789,7 +789,7 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } else if( pHint->GetId() == SBX_HINT_DATACHANGED ) { - SbxVariable* pMethVar = NULL; + SbxVariable* pMethVar = nullptr; bool bSet = pProcProperty->isSet(); if( bSet ) @@ -817,7 +817,7 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SbxValues aVals; pMethVar->Get( aVals ); - pMethVar->SetParameters( NULL ); + pMethVar->SetParameters( nullptr ); } } } @@ -919,7 +919,7 @@ void SbModule::SetSource32( const OUString& r ) eLastTok = eCurTok; } // Definition of the method - SbMethod* pMeth = NULL; + SbMethod* pMeth = nullptr; if( eEndTok != NIL ) { sal_uInt16 nLine1 = aTok.GetLine(); @@ -1069,7 +1069,7 @@ void SbModule::Run( SbMethod* pMeth ) static sal_uInt16 nMaxCallLevel = 0; - bool bDelInst = ( GetSbData()->pInst == NULL ); + bool bDelInst = ( GetSbData()->pInst == nullptr ); bool bQuit = false; StarBASICRef xBasic; uno::Reference< frame::XModel > xModel; @@ -1214,7 +1214,7 @@ void SbModule::Run( SbMethod* pMeth ) clearNativeObjectWrapperVector(); SAL_WARN_IF(GetSbData()->pInst->nCallLvl != 0,"basic","BASIC-Call-Level > 0"); - delete GetSbData()->pInst, GetSbData()->pInst = NULL, bDelInst = false; + delete GetSbData()->pInst, GetSbData()->pInst = nullptr, bDelInst = false; // #i30690 SolarMutexGuard aSolarGuard; @@ -1259,7 +1259,7 @@ void SbModule::Run( SbMethod* pMeth ) ClearUnoObjectsInRTL_Impl( xBasic ); delete GetSbData()->pInst; - GetSbData()->pInst = NULL; + GetSbData()->pInst = nullptr; } if ( pBasic && pBasic->IsDocBasic() && pBasic->IsQuitApplication() && !GetSbData()->pInst ) bQuit = true; @@ -1284,7 +1284,7 @@ void SbModule::RunInit() SbModule* pOldMod = GetSbData()->pMod; GetSbData()->pMod = this; // The init code starts always here - SbiRuntime* pRt = new SbiRuntime( this, NULL, 0 ); + SbiRuntime* pRt = new SbiRuntime( this, nullptr, 0 ); pRt->pNext = GetSbData()->pInst->pRun; GetSbData()->pInst->pRun = pRt; @@ -1359,22 +1359,22 @@ void SbModule::ClearPrivateVars() void SbModule::implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic ) { - if( pVar->SbxValue::GetType() != SbxOBJECT || 0 != dynamic_cast( pVar) ) + if( pVar->SbxValue::GetType() != SbxOBJECT || nullptr != dynamic_cast( pVar) ) return; SbxObject* pObj = dynamic_cast( pVar->GetObject() ); - if( pObj != NULL ) + if( pObj != nullptr ) { SbxObject* p = pObj; SbModule* pMod = dynamic_cast( p ); - if( pMod != NULL ) + if( pMod != nullptr ) pMod->ClearVarsDependingOnDeletedBasic( pDeletedBasic ); - while( (p = p->GetParent()) != NULL ) + while( (p = p->GetParent()) != nullptr ) { StarBASIC* pBasic = dynamic_cast( p ); - if( pBasic != NULL && pBasic == pDeletedBasic ) + if( pBasic != nullptr && pBasic == pDeletedBasic ) { pVar->SbxValue::Clear(); break; @@ -1419,7 +1419,7 @@ void StarBASIC::ClearAllModuleVars() { SbModule* pModule = static_cast(pModules->Get( nMod )); // Initialise only, if the startcode was already executed - if( pModule->pImage && pModule->pImage->bInit && !pModule->isProxyModule() && 0 == dynamic_cast( pModule) ) + if( pModule->pImage && pModule->pImage->bInit && !pModule->isProxyModule() && nullptr == dynamic_cast( pModule) ) pModule->ClearPrivateVars(); } @@ -1524,7 +1524,7 @@ const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, break; } } - return NULL; + return nullptr; } // Test, if a line contains STMNT-Opcodes @@ -1535,7 +1535,7 @@ bool SbModule::IsBreakable( sal_uInt16 nLine ) const return false; const sal_uInt8* p = reinterpret_cast(pImage->GetCode()); sal_uInt16 nl, nc; - while( ( p = FindNextStmnt( p, nl, nc ) ) != NULL ) + while( ( p = FindNextStmnt( p, nl, nc ) ) != nullptr ) if( nl == nLine ) return true; return false; @@ -1599,7 +1599,7 @@ bool SbModule::ClearBP( sal_uInt16 nLine ) break; } if( pBreaks->empty() ) - delete pBreaks, pBreaks = NULL; + delete pBreaks, pBreaks = nullptr; } return bRes; } @@ -1607,7 +1607,7 @@ bool SbModule::ClearBP( sal_uInt16 nLine ) void SbModule::ClearAllBP() { delete pBreaks; - pBreaks = NULL; + pBreaks = nullptr; } void @@ -1893,7 +1893,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH aVals.eType = SbxVARIANT; SbxArray* pArg = pVar->GetParameters(); - sal_uInt16 nVarParCount = (pArg != NULL) ? pArg->Count() : 0; + sal_uInt16 nVarParCount = (pArg != nullptr) ? pArg->Count() : 0; if( nVarParCount > 1 ) { SbxArrayRef xMethParameters = new SbxArray; @@ -1906,7 +1906,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH pMeth->SetParameters( xMethParameters ); pMeth->Get( aVals ); - pMeth->SetParameters( NULL ); + pMeth->SetParameters( nullptr ); } else { @@ -1918,7 +1918,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH } else if( pHint->GetId() == SBX_HINT_DATACHANGED ) { - SbxVariable* pMeth = NULL; + SbxVariable* pMeth = nullptr; bool bSet = pProcProperty->isSet(); if( bSet ) @@ -1946,7 +1946,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH SbxValues aVals; pMeth->Get( aVals ); - pMeth->SetParameters( NULL ); + pMeth->SetParameters( nullptr ); } } } @@ -1999,7 +1999,7 @@ SbMethod::SbMethod( const OUString& r, SbxDataType t, SbModule* p ) nLine1 = nLine2 = 0; refStatics = new SbxArray; - mCaller = 0; + mCaller = nullptr; // HACK due to 'Referenz could not be saved' SetFlag( SbxFlagBits::NoModify ); } @@ -2137,7 +2137,7 @@ ErrCode SbMethod::Call( SbxValue* pRet, SbxVariable* pCaller ) // Release objects pMod_->ReleaseRef(); pBasic->ReleaseRef(); - mCaller = 0; + mCaller = nullptr; return nErr; } @@ -2161,7 +2161,7 @@ void SbMethod::Broadcast( sal_uInt32 nHintId ) // Block broadcasts while creating new method SfxBroadcaster* pSave = pCst; - pCst = NULL; + pCst = nullptr; SbMethod* pThisCopy = new SbMethod( *this ); SbMethodRef xHolder = pThisCopy; if( mpPar.Is() ) @@ -2170,7 +2170,7 @@ void SbMethod::Broadcast( sal_uInt32 nHintId ) if( GetType() != SbxVOID ) { mpPar->PutDirect( pThisCopy, 0 ); } - SetParameters( NULL ); + SetParameters( nullptr ); } pCst = pSave; @@ -2178,7 +2178,7 @@ void SbMethod::Broadcast( sal_uInt32 nHintId ) SbxFlagBits nSaveFlags = GetFlags(); SetFlag( SbxFlagBits::ReadWrite ); - pCst = NULL; + pCst = nullptr; Put( pThisCopy->GetValues_Impl() ); pCst = pSave; SetFlags( nSaveFlags ); @@ -2242,7 +2242,7 @@ SbObjModule::GetObject() SbxVariable* SbObjModule::Find( const OUString& rName, SbxClassType t ) { - SbxVariable* pVar = NULL; + SbxVariable* pVar = nullptr; if ( pDocObject) pVar = pDocObject->Find( rName, t ); if ( !pVar ) @@ -2482,8 +2482,8 @@ void SbUserFormModule::ResetApiObj( bool bTriggerTerminateEvent ) { triggerTerminateEvent(); } - pDocObject = NULL; - m_xDialog = NULL; + pDocObject = nullptr; + m_xDialog = nullptr; } void SbUserFormModule::triggerMethod( const OUString& aMethodToRun ) @@ -2523,7 +2523,7 @@ void SbUserFormModule::triggerMethod( const OUString& aMethodToRun, Sequence< An { aArguments[i] = sbxToUnoValue( xArray->Get( static_cast< sal_uInt16 >(i) + 1) ); } - pMeth->SetParameters( NULL ); + pMeth->SetParameters( nullptr ); } else { @@ -2699,7 +2699,7 @@ void SbUserFormModule::InitObject() uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY_THROW ); // the dialog must be disposed at the end! - StarBASIC* pParentBasic = NULL; + StarBASIC* pParentBasic = nullptr; SbxObject* pCurObject = this; do { @@ -2707,9 +2707,9 @@ void SbUserFormModule::InitObject() pParentBasic = dynamic_cast( pObjParent ); pCurObject = pObjParent; } - while( pParentBasic == NULL && pCurObject != NULL ); + while( pParentBasic == nullptr && pCurObject != nullptr ); - SAL_WARN_IF( pParentBasic == NULL, "basic", "pParentBasic == NULL" ); + SAL_WARN_IF( pParentBasic == nullptr, "basic", "pParentBasic == NULL" ); registerComponentToBeDisposedForBasic( xComponent, pParentBasic ); // if old listener object exists, remove it from dialog and document model diff --git a/basic/source/comp/basiccharclass.cxx b/basic/source/comp/basiccharclass.cxx index 415e64fb6371..ecc40a769bb8 100644 --- a/basic/source/comp/basiccharclass.cxx +++ b/basic/source/comp/basiccharclass.cxx @@ -33,8 +33,8 @@ bool BasicCharClass::isLetter( sal_Unicode c ) bool BasicCharClass::isLetterUnicode( sal_Unicode c ) { - static CharClass* pCharClass = NULL; - if( pCharClass == NULL ) + static CharClass* pCharClass = nullptr; + if( pCharClass == nullptr ) pCharClass = new CharClass( Application::GetSettings().GetLanguageTag() ); // can we get pCharClass to accept a sal_Unicode instead of this waste? return pCharClass->isLetter( OUString(c), 0 ); diff --git a/basic/source/comp/buffer.cxx b/basic/source/comp/buffer.cxx index 141186f8007d..1a4405caa379 100644 --- a/basic/source/comp/buffer.cxx +++ b/basic/source/comp/buffer.cxx @@ -32,8 +32,8 @@ SbiBuffer::SbiBuffer( SbiParser* p, short n ) pParser = p; n = ( (n + 15 ) / 16 ) * 16; if( !n ) n = 16; - pBuf = NULL; - pCur = NULL; + pBuf = nullptr; + pCur = nullptr; nInc = n; nSize = nOff = 0; @@ -50,8 +50,8 @@ SbiBuffer::~SbiBuffer() char* SbiBuffer::GetBuffer() { char* p = pBuf; - pBuf = NULL; - pCur = NULL; + pBuf = nullptr; + pCur = nullptr; return p; } @@ -79,7 +79,7 @@ bool SbiBuffer::Check( sal_Int32 n ) char* p; if( ( nSize + nn ) > UP_LIMIT ) { - p = NULL; + p = nullptr; } else { @@ -89,7 +89,7 @@ bool SbiBuffer::Check( sal_Int32 n ) { pParser->Error( ERRCODE_BASIC_PROG_TOO_LARGE ); nInc = 0; - delete[] pBuf; pBuf = NULL; + delete[] pBuf; pBuf = nullptr; return false; } else diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 5cafbaa78db4..4c202edf8bba 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -219,7 +219,7 @@ void SbiCodeGen::Save() } } } - SbMethod* pMeth = NULL; + SbMethod* pMeth = nullptr; for( sal_uInt16 nPass = 0 ; nPass < nPassCount ; nPass++ ) { if( nPass == 1 ) @@ -336,7 +336,7 @@ void SbiCodeGen::Save() { nUserData |= PARAM_INFO_WITHBRACKETS; } - SbxParamInfo* pParam = NULL; + SbxParamInfo* pParam = nullptr; if( nUserData ) { pParam = const_cast(pInfo->GetParam( i )); @@ -491,7 +491,7 @@ class BufferTransformer : public PCodeVisitor< T > sal_uInt8* m_pStart; SbiBuffer m_ConvertedBuf; public: - BufferTransformer():m_pStart(NULL), m_ConvertedBuf( NULL, 1024 ) {} + BufferTransformer():m_pStart(nullptr), m_ConvertedBuf( nullptr, 1024 ) {} virtual void start( sal_uInt8* pStart ) override { m_pStart = pStart; } virtual void processOpCode0( SbiOpcode eOp ) override { diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index c4673712708c..fdca04d88826 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -47,10 +47,10 @@ SbiSymDef* SbiParser::VarDecl( SbiDimList** ppDim, bool bStatic, bool bConst ) Next(); bWithEvents = true; } - if( !TestSymbol() ) return NULL; + if( !TestSymbol() ) return nullptr; SbxDataType t = eScanType; SbiSymDef* pDef = bConst ? new SbiConstDef( aSym ) : new SbiSymDef( aSym ); - SbiDimList* pDim = NULL; + SbiDimList* pDim = nullptr; // Brackets? if( Peek() == LPAREN ) { @@ -167,7 +167,7 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, bool bAsNewAlreadyParsed ) // Take over in the string pool rDef.SetTypeId( aGblStrings.Add( aCompleteName ) ); - if( rDef.IsNew() && pProc == NULL ) + if( rDef.IsNew() && pProc == nullptr ) aRequiredTypes.push_back( aCompleteName ); } eType = SbxOBJECT; @@ -305,7 +305,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) } bool bDefined = false; - while( ( pDef = VarDecl( &pDim, bStatic, bConst ) ) != NULL ) + while( ( pDef = VarDecl( &pDim, bStatic, bConst ) ) != nullptr ) { /*fprintf(stderr, "Actual sub: \n"); fprintf(stderr, "Symbol name: %s\n",OUStringToOString(pDef->GetName(),RTL_TEXTENCODING_UTF8).getStr());*/ @@ -325,7 +325,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) if( pOld && !(eOp == _REDIM || eOp == _REDIMP) ) { if( pDef->GetScope() == SbLOCAL && pOld->GetScope() != SbLOCAL ) - pOld = NULL; + pOld = nullptr; } if( pOld ) { @@ -390,7 +390,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) if( nFixedStringLength >= 0 ) nOpnd2 |= (SBX_FIXED_LEN_STRING_FLAG + (sal_uInt32(nFixedStringLength) << 17)); // len = all bits above 0x10000 - if( pDim != NULL && pDim->GetDims() > 0 ) + if( pDim != nullptr && pDim->GetDims() > 0 ) nOpnd2 |= SBX_TYPE_VAR_TO_DIM_FLAG; aGen.Gen( eOp2, pDef->GetId(), nOpnd2 ); @@ -404,7 +404,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) if( !bCompatible && !pDef->IsNew() ) { OUString aTypeName( aGblStrings.Find( pDef->GetTypeId() ) ); - if( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) == NULL ) + if( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) == nullptr ) { if( CodeCompleteOptions::IsExtendedTypeDeclaration() ) { @@ -425,7 +425,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) { if( eOp == _REDIMP ) { - SbiExpression aExpr( this, *pDef, NULL ); + SbiExpression aExpr( this, *pDef, nullptr ); aExpr.Gen(); aGen.Gen( _REDIMP_ERASE ); @@ -490,7 +490,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) // Delete the var at REDIM beforehand if( eOp == _REDIM ) { - SbiExpression aExpr( this, *pDef, NULL ); + SbiExpression aExpr( this, *pDef, nullptr ); aExpr.Gen(); if ( bVBASupportOn ) // delete the array but @@ -503,7 +503,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) } else if( eOp == _REDIMP ) { - SbiExpression aExpr( this, *pDef, NULL ); + SbiExpression aExpr( this, *pDef, nullptr ); aExpr.Gen(); aGen.Gen( _REDIMP_ERASE ); } @@ -589,7 +589,7 @@ void SbiParser::DefType( bool bPrivate ) SbxObject *pType = new SbxObject(aSym); std::unique_ptr pElem; - SbiDimList* pDim = NULL; + SbiDimList* pDim = nullptr; bool bDone = false; while( !bDone && !IsEof() ) @@ -666,7 +666,7 @@ void SbiParser::DefType( bool bPrivate ) { OUString aTypeName( aGblStrings.Find( nElemTypeId ) ); SbxObject* pTypeObj = static_cast< SbxObject* >( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) ); - if( pTypeObj != NULL ) + if( pTypeObj != nullptr ) { SbxObject* pCloneObj = cloneTypeObjectImpl( *pTypeObj ); pTypeElem->PutObject( pCloneObj ); @@ -675,7 +675,7 @@ void SbiParser::DefType( bool bPrivate ) } pTypeMembers->Insert( pTypeElem, pTypeMembers->Count() ); } - delete pDim, pDim = NULL; + delete pDim, pDim = nullptr; pElem.reset(); } } @@ -723,21 +723,21 @@ void SbiParser::DefEnum( bool bPrivate ) switch( Peek() ) { case ENDENUM : - pElem = NULL; + pElem = nullptr; bDone = true; Next(); break; case EOLN : case REM : - pElem = NULL; + pElem = nullptr; Next(); break; default: { // TODO: Check existing! - pDim = NULL; + pDim = nullptr; pElem = VarDecl( &pDim, false, true ); if( !pElem ) { @@ -830,7 +830,7 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl ) { bool bFunc = ( eCurTok == FUNCTION ); bool bProp = ( eCurTok == GET || eCurTok == SET || eCurTok == LET ); - if( !TestSymbol() ) return NULL; + if( !TestSymbol() ) return nullptr; OUString aName( aSym ); SbxDataType eType = eScanType; SbiProcDef* pDef = new SbiProcDef( this, aName, true ); @@ -936,7 +936,7 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl ) Next(); bParamArray = true; } - SbiSymDef* pPar = VarDecl( NULL, false, false ); + SbiSymDef* pPar = VarDecl( nullptr, false, false ); if( !pPar ) { break; @@ -1041,7 +1041,7 @@ void SbiParser::DefDeclare( bool bPrivate ) // Declared as a variable Error( ERRCODE_BASIC_BAD_DECLARATION, pDef->GetName() ); delete pDef; - pDef = NULL; + pDef = nullptr; } else { @@ -1214,7 +1214,7 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate ) // Declared as a variable Error( ERRCODE_BASIC_BAD_DECLARATION, pDef->GetName() ); delete pDef; - pProc = NULL; + pProc = nullptr; bError_ = true; } // #100027: Multiple declaration -> Error @@ -1226,7 +1226,7 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate ) { Error( ERRCODE_BASIC_PROC_DEFINED, pDef->GetName() ); delete pDef; - pProc = NULL; + pProc = nullptr; bError_ = true; } } @@ -1282,7 +1282,7 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate ) pProc->GetLabels().CheckRefs(); CloseBlock(); aGen.Gen( _LEAVE ); - pProc = NULL; + pProc = nullptr; } // STATIC variable|procedure diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx index 93b8c8226e67..c1c74a0b2121 100644 --- a/basic/source/comp/exprgen.cxx +++ b/basic/source/comp/exprgen.cxx @@ -82,7 +82,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode ) } else if( IsOperand() ) { - SbiExprNode* pWithParent_ = NULL; + SbiExprNode* pWithParent_ = nullptr; SbiOpcode eOp; if( aVar.pDef->GetScope() == SbPARAM ) { @@ -108,7 +108,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode ) } } // special treatment for WITH - else if( (pWithParent_ = GetWithParent()) != NULL ) + else if( (pWithParent_ = GetWithParent()) != nullptr ) { eOp = _ELEM; // .-Term in WITH } @@ -133,7 +133,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode ) } for( SbiExprNode* p = this; p; p = p->aVar.pNext ) { - if( p == this && pWithParent_ != NULL ) + if( p == this && pWithParent_ != nullptr ) { pWithParent_->Gen(rGen); } diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index 1fecc7f17cc1..3bd9693e58b0 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -29,7 +29,7 @@ SbiExprNode::SbiExprNode( SbiExprNode* l, SbiToken t, SbiExprNode* r ) : pLeft(l), pRight(r), - pWithParent(NULL), + pWithParent(nullptr), eNodeType(SbxNODE), eType(SbxVARIANT), // Nodes are always Variant eTok(t), @@ -39,7 +39,7 @@ SbiExprNode::SbiExprNode( SbiExprNode* l, SbiToken t, SbiExprNode* r ) : SbiExprNode::SbiExprNode( double n, SbxDataType t ): nVal(n), - pWithParent(NULL), + pWithParent(nullptr), eNodeType(SbxNUMVAL), eType(t), eTok(NIL), @@ -49,7 +49,7 @@ SbiExprNode::SbiExprNode( double n, SbxDataType t ): SbiExprNode::SbiExprNode( const OUString& rVal ): aStrVal(rVal), - pWithParent(NULL), + pWithParent(nullptr), eNodeType(SbxSTRVAL), eType(SbxSTRING), eTok(NIL), @@ -58,7 +58,7 @@ SbiExprNode::SbiExprNode( const OUString& rVal ): } SbiExprNode::SbiExprNode( const SbiSymDef& r, SbxDataType t, SbiExprList* l ) : - pWithParent(NULL), + pWithParent(nullptr), eNodeType(SbxVARVAL), eTok(NIL), bError(false) @@ -66,15 +66,15 @@ SbiExprNode::SbiExprNode( const SbiSymDef& r, SbxDataType t, SbiExprList* l ) : eType = ( t == SbxVARIANT ) ? r.GetType() : t; aVar.pDef = const_cast(&r); aVar.pPar = l; - aVar.pvMorePar = NULL; - aVar.pNext= NULL; + aVar.pvMorePar = nullptr; + aVar.pNext= nullptr; } // #120061 TypeOf SbiExprNode::SbiExprNode( SbiExprNode* l, sal_uInt16 nId ) : nTypeStrId(nId), pLeft(l), - pWithParent(NULL), + pWithParent(nullptr), eNodeType(SbxTYPEOF), eType(SbxBOOL), eTok(NIL), @@ -85,7 +85,7 @@ SbiExprNode::SbiExprNode( SbiExprNode* l, sal_uInt16 nId ) : // new SbiExprNode::SbiExprNode( sal_uInt16 nId ) : nTypeStrId(nId), - pWithParent(NULL), + pWithParent(nullptr), eNodeType(SbxNEW), eType(SbxOBJECT), eTok(NIL), @@ -94,7 +94,7 @@ SbiExprNode::SbiExprNode( sal_uInt16 nId ) : } SbiExprNode::SbiExprNode() : - pWithParent(NULL), + pWithParent(nullptr), eNodeType(SbxDUMMY), eType(SbxVARIANT), eTok(NIL), @@ -124,7 +124,7 @@ SbiSymDef* SbiExprNode::GetVar() if( eNodeType == SbxVARVAL ) return aVar.pDef; else - return NULL; + return nullptr; } SbiSymDef* SbiExprNode::GetRealVar() @@ -133,7 +133,7 @@ SbiSymDef* SbiExprNode::GetRealVar() if( p ) return p->GetVar(); else - return NULL; + return nullptr; } // From 1995-12-18 @@ -147,7 +147,7 @@ SbiExprNode* SbiExprNode::GetRealNode() return p; } else - return NULL; + return nullptr; } // This method transform the type, if it fits into the Integer range diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 5850072bad31..b6ed8da20e77 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -36,7 +36,7 @@ SbiExpression::SbiExpression( SbiParser* p, SbiExprType t, nParenLevel = 0; eCurExpr = t; m_eMode = eMode; - pNext = NULL; + pNext = nullptr; pExpr = (t != SbSTDEXPR ) ? Term( pKeywordSymbolInfo ) : Boolean(); if( t != SbSYMBOL ) { @@ -59,7 +59,7 @@ SbiExpression::SbiExpression( SbiParser* p, double n, SbxDataType t ) nParenLevel = 0; eCurExpr = SbOPERAND; m_eMode = EXPRMODE_STANDARD; - pNext = NULL; + pNext = nullptr; pExpr = new SbiExprNode( n, t ); pExpr->Optimize(pParser); } @@ -71,7 +71,7 @@ SbiExpression::SbiExpression( SbiParser* p, const SbiSymDef& r, SbiExprList* pPa nParenLevel = 0; eCurExpr = SbOPERAND; m_eMode = EXPRMODE_STANDARD; - pNext = NULL; + pNext = nullptr; pExpr = new SbiExprNode( r, SbxVARIANT, pPar ); } @@ -175,8 +175,8 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) { SbiExprNode* pWithVar = pParser->GetWithVar(); // #26608: get to the node-chain's end to pass the correct object - SbiSymDef* pDef = pWithVar ? pWithVar->GetRealVar() : NULL; - SbiExprNode* pNd = NULL; + SbiSymDef* pDef = pWithVar ? pWithVar->GetRealVar() : nullptr; + SbiExprNode* pNd = nullptr; if( !pDef ) { pParser->Next(); @@ -197,13 +197,13 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) return pNd; } - SbiToken eTok = (pKeywordSymbolInfo == NULL) ? pParser->Next() : pKeywordSymbolInfo->m_eTok; + SbiToken eTok = (pKeywordSymbolInfo == nullptr) ? pParser->Next() : pKeywordSymbolInfo->m_eTok; // memorize the parsing's begin pParser->LockColumn(); - OUString aSym( (pKeywordSymbolInfo == NULL) ? pParser->GetSym() : pKeywordSymbolInfo->m_aKeywordSymbol ); - SbxDataType eType = (pKeywordSymbolInfo == NULL) ? pParser->GetType() : pKeywordSymbolInfo->m_eSbxDataType; - SbiParameters* pPar = NULL; - SbiExprListVector* pvMoreParLcl = NULL; + OUString aSym( (pKeywordSymbolInfo == nullptr) ? pParser->GetSym() : pKeywordSymbolInfo->m_aKeywordSymbol ); + SbxDataType eType = (pKeywordSymbolInfo == nullptr) ? pParser->GetType() : pKeywordSymbolInfo->m_eSbxDataType; + SbiParameters* pPar = nullptr; + SbiExprListVector* pvMoreParLcl = nullptr; // are there parameters following? SbiToken eNextTok = pParser->Peek(); // is it a known parameter? @@ -234,7 +234,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) // i75443 check for additional sets of parameters while( eTok == LPAREN ) { - if( pvMoreParLcl == NULL ) + if( pvMoreParLcl == nullptr ) { pvMoreParLcl = new SbiExprListVector(); } @@ -277,7 +277,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) SbxArray* pModMethods = rMod.GetMethods(); if( pModMethods->Find( aSym, SbxCLASS_DONTCARE ) ) { - pDef = NULL; + pDef = nullptr; } } if( !pDef ) @@ -414,12 +414,12 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) if( bError ) { - return NULL; + return nullptr; } OUString aSym( pParser->GetSym() ); SbxDataType eType = pParser->GetType(); - SbiParameters* pPar = NULL; - SbiExprListVector* pvMoreParLcl = NULL; + SbiParameters* pPar = nullptr; + SbiExprListVector* pvMoreParLcl = nullptr; eTok = pParser->Peek(); if( DoParametersFollow( pParser, eCurExpr, eTok ) ) @@ -432,7 +432,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) // i109624 check for additional sets of parameters while( eTok == LPAREN ) { - if( pvMoreParLcl == NULL ) + if( pvMoreParLcl == nullptr ) { pvMoreParLcl = new SbiExprListVector(); } @@ -590,7 +590,7 @@ SbiExprNode* SbiExpression::Unary() case MINUS: eTok = NEG; pParser->Next(); - pNd = new SbiExprNode( Unary(), eTok, NULL ); + pNd = new SbiExprNode( Unary(), eTok, nullptr ); break; case NOT: if( pParser->IsVBASupportOn() ) @@ -600,7 +600,7 @@ SbiExprNode* SbiExpression::Unary() else { pParser->Next(); - pNd = new SbiExprNode( Unary(), eTok, NULL ); + pNd = new SbiExprNode( Unary(), eTok, nullptr ); } break; case PLUS: @@ -762,13 +762,13 @@ SbiExprNode* SbiExpression::Comp() SbiExprNode* SbiExpression::VBA_Not() { - SbiExprNode* pNd = NULL; + SbiExprNode* pNd = nullptr; SbiToken eTok = pParser->Peek(); if( eTok == NOT ) { pParser->Next(); - pNd = new SbiExprNode( VBA_Not(), eTok, NULL ); + pNd = new SbiExprNode( VBA_Not(), eTok, nullptr ); } else { @@ -923,7 +923,7 @@ short SbiConstExpression::GetShortValue() SbiExprList::SbiExprList( SbiParser* p ) { pParser = p; - pFirst = NULL; + pFirst = nullptr; nExpr = nDim = 0; bError = false; @@ -1020,7 +1020,7 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa return; } // read in parameter table and lay down in correct order! - SbiExpression* pLast = NULL; + SbiExpression* pLast = nullptr; OUString aName; while( !bError ) { @@ -1089,7 +1089,7 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa pExpr->GetName() = aName; } } - pExpr->pNext = NULL; + pExpr->pNext = nullptr; if( !pLast ) { pFirst = pLast = pExpr; @@ -1162,7 +1162,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) if( pParser->Peek() != RPAREN ) { - SbiExpression *pExpr1, *pExpr2, *pLast = NULL; + SbiExpression *pExpr1, *pExpr2, *pLast = nullptr; SbiToken eTok; for( ;; ) { @@ -1189,7 +1189,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) else { pExpr1->SetBased(); - pExpr1->pNext = NULL; + pExpr1->pNext = nullptr; bConst = bConst && pExpr1->IsIntConstant(); bError = bError || !pExpr1->IsValid(); if( !pLast ) diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 29533876dfb2..48acf02fa837 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -106,7 +106,7 @@ static const SbiStatement StmntTable [] = { { WITH, &SbiParser::With, N, Y, }, // WITH { WRITE, &SbiParser::Write, N, Y, }, // WRITE -{ NIL, NULL, N, N } +{ NIL, nullptr, N, N } }; @@ -119,9 +119,9 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm ) { eCurExpr = SbSYMBOL; eEndTok = NIL; - pProc = NULL; - pStack = NULL; - pWithVar = NULL; + pProc = nullptr; + pStack = nullptr; + pWithVar = nullptr; nBase = 0; bText = bGblDefs = @@ -479,7 +479,7 @@ SbiExprNode* SbiParser::GetWithVar() return p->pWithVar; p = p->pNext; } - return NULL; + return nullptr; } diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index 96ec24c7dbd1..fad8e0618935 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -959,7 +959,7 @@ bool SbModule::Compile() bool bRet = IsCompiled(); if( bRet ) { - if( 0 == dynamic_cast( this) ) + if( nullptr == dynamic_cast( this) ) pBasic->ClearAllModuleVars(); RemoveVars(); // remove 'this' Modules variables // clear all method statics @@ -971,7 +971,7 @@ bool SbModule::Compile() } // #i31510 Init other libs only if Basic isn't running - if( GetSbData()->pInst == NULL ) + if( GetSbData()->pInst == nullptr ) { SbxObject* pParent_ = pBasic->GetParent(); if( pParent_ ) diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 85b6c823d501..21188e1359cf 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -26,7 +26,7 @@ SbiScanner::SbiScanner( const OUString& rBuf, StarBASIC* p ) : aBuf( rBuf ) { pBasic = p; - pLine = NULL; + pLine = nullptr; nVal = 0; eScanType = SbxVARIANT; nErrors = 0; @@ -48,7 +48,7 @@ SbiScanner::SbiScanner( const OUString& rBuf, StarBASIC* p ) : aBuf( rBuf ) bInStatement = bPrevLineExtentsComment = false; bHash = true; - pSaveLine = NULL; + pSaveLine = nullptr; } SbiScanner::~SbiScanner() @@ -537,7 +537,7 @@ PrevLineCommentLbl: if( bCompatible && pLine[ nLen - 1 ] == '_' && pLine[ nLen - 2 ] == ' ' ) bPrevLineExtentsComment = true; nCol2 = nCol2 + nLen; - pLine = NULL; + pLine = nullptr; } return true; @@ -545,7 +545,7 @@ PrevLineCommentLbl: eoln: if( nCol && *--pLine == '_' ) { - pLine = NULL; + pLine = nullptr; bool bRes = NextSym(); if( bVBASupportOn && aSym[0] == '.' ) { @@ -559,7 +559,7 @@ eoln: } else { - pLine = NULL; + pLine = nullptr; nLine = nOldLine; nCol1 = nOldCol1; nCol2 = nOldCol2; diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index a0390af65d1e..ba20518753db 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -90,7 +90,7 @@ short SbiStringPool::Add( double n, SbxDataType t ) SbiSymPool::SbiSymPool( SbiStringPool& r, SbiSymScope s, SbiParser* pP ) : rStrings( r ), pParser( pP ) { eScope = s; - pParent = NULL; + pParent = nullptr; nCur = nProcId = 0; } @@ -108,7 +108,7 @@ SbiSymDef* SbiSymPool::First() SbiSymDef* SbiSymPool::Next() { if (m_Data.size() <= ++nCur) - return NULL; + return nullptr; else return m_Data[ nCur ].get(); } @@ -195,7 +195,7 @@ SbiSymDef* SbiSymPool::Find( const OUString& rName ) } else { - return NULL; + return nullptr; } } @@ -206,7 +206,7 @@ SbiSymDef* SbiSymPool::Get( sal_uInt16 n ) { if (m_Data.size() <= n) { - return NULL; + return nullptr; } else { @@ -283,7 +283,7 @@ SbiSymDef::SbiSymDef( const OUString& rName ) : aName( rName ) bChained = bGlobal = false; pIn = - pPool = NULL; + pPool = nullptr; nDefaultId = 0; nFixedStringLength = -1; } @@ -295,12 +295,12 @@ SbiSymDef::~SbiSymDef() SbiProcDef* SbiSymDef::GetProcDef() { - return NULL; + return nullptr; } SbiConstDef* SbiSymDef::GetConstDef() { - return NULL; + return nullptr; } @@ -431,7 +431,7 @@ void SbiProcDef::SetType( SbxDataType t ) void SbiProcDef::Match( SbiProcDef* pOld ) { - SbiSymDef *pn=NULL; + SbiSymDef *pn=nullptr; // parameter 0 is the function name sal_uInt16 i; for( i = 1; i < aParams.GetSize(); i++ ) diff --git a/basic/source/inc/codegen.hxx b/basic/source/inc/codegen.hxx index d50994be5e09..70da5867274f 100644 --- a/basic/source/inc/codegen.hxx +++ b/basic/source/inc/codegen.hxx @@ -69,7 +69,7 @@ class PCodeBuffConvertor PCodeBuffConvertor(const PCodeBuffConvertor& ) = delete; PCodeBuffConvertor& operator = ( const PCodeBuffConvertor& ) = delete; public: - PCodeBuffConvertor( sal_uInt8* pCode, T nSize ): m_nSize( nSize ), m_pStart( pCode ), m_pCnvtdBuf( NULL ), m_nCnvtdSize( 0 ){ convert(); } + PCodeBuffConvertor( sal_uInt8* pCode, T nSize ): m_nSize( nSize ), m_pStart( pCode ), m_pCnvtdBuf( nullptr ), m_nCnvtdSize( 0 ){ convert(); } S GetSize(){ return m_nCnvtdSize; } void convert(); // Caller owns the buffer returned diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx index 0df028181a3d..ac2cce82e3d2 100644 --- a/basic/source/inc/expr.hxx +++ b/basic/source/inc/expr.hxx @@ -120,7 +120,7 @@ public: SbiExprNode(); SbiExprNode( double, SbxDataType ); SbiExprNode( const OUString& ); - SbiExprNode( const SbiSymDef&, SbxDataType, SbiExprList* = NULL ); + SbiExprNode( const SbiSymDef&, SbxDataType, SbiExprList* = nullptr ); SbiExprNode( SbiExprNode*, SbiToken, SbiExprNode* ); SbiExprNode( SbiExprNode*, sal_uInt16 ); // #120061 TypeOf SbiExprNode( sal_uInt16 ); // new @@ -167,7 +167,7 @@ protected: bool bByVal; // true: ByVal-Parameter bool bBracket; // true: Parameter list with brackets sal_uInt16 nParenLevel; - SbiExprNode* Term( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); + SbiExprNode* Term( const KeywordSymbolInfo* pKeywordSymbolInfo = nullptr ); SbiExprNode* ObjTerm( SbiSymDef& ); SbiExprNode* Operand( bool bUsedForTypeOf = false ); SbiExprNode* Unary(); @@ -183,9 +183,9 @@ protected: SbiExprNode* Boolean(); public: SbiExpression( SbiParser*, SbiExprType = SbSTDEXPR, - SbiExprMode eMode = EXPRMODE_STANDARD, const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // parsing Ctor + SbiExprMode eMode = EXPRMODE_STANDARD, const KeywordSymbolInfo* pKeywordSymbolInfo = nullptr ); // parsing Ctor SbiExpression( SbiParser*, double, SbxDataType = SbxDOUBLE ); - SbiExpression( SbiParser*, const SbiSymDef&, SbiExprList* = NULL ); + SbiExpression( SbiParser*, const SbiSymDef&, SbiExprList* = nullptr ); ~SbiExpression(); OUString& GetName() { return aArgName; } void SetBased() { bBased = true; } diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx index e88820b6bc35..e286ffd8284d 100644 --- a/basic/source/inc/namecont.hxx +++ b/basic/source/inc/namecont.hxx @@ -86,7 +86,7 @@ public: NameContainer( const css::uno::Type& rType ) : mnElementCount( 0 ) , mType( rType ) - , mpxEventSource( NULL ) + , mpxEventSource( nullptr ) , maContainerListeners( m_aMutex ) , maChangesListeners( m_aMutex ) {} diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx index a1e44ef1dff5..e5b42762e76b 100644 --- a/basic/source/inc/parser.hxx +++ b/basic/source/inc/parser.hxx @@ -50,7 +50,7 @@ class SbiParser : public SbiTokenizer void DefProc( bool bStatic, bool bPrivate ); // read in procedure void DefVar( SbiOpcode eOp, bool bStatic ); // read in DIM/REDIM void TypeDecl( SbiSymDef&, bool bAsNewAlreadyParsed=false ); // AS-declaration - void OpenBlock( SbiToken, SbiExprNode* = NULL ); + void OpenBlock( SbiToken, SbiExprNode* = nullptr ); void CloseBlock(); bool Channel( bool bAlways=false ); // parse channel number void StmntBlock( SbiToken ); @@ -96,7 +96,7 @@ public: bool TestComma(); void TestEoln(); - void Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // let or call + void Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo = nullptr ); // let or call void ErrorStmnt(); // ERROR n void BadBlock(); // LOOP/WEND/NEXT void NoIf(); // ELSE/ELSE IF without IF diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 06cc060053fa..e3fabf3e0bad 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -71,12 +71,12 @@ struct SbiForStack { // for/next stack: css::uno::Reference< css::container::XEnumeration > xEnumeration; SbiForStack() - : pNext(NULL) + : pNext(nullptr) , eForType(FOR_TO) , nCurCollectionIndex(0) - , pArrayCurIndices(NULL) - , pArrayLowerBounds(NULL) - , pArrayUpperBounds(NULL) + , pArrayCurIndices(nullptr) + , pArrayLowerBounds(nullptr) + , pArrayUpperBounds(nullptr) {} ~SbiForStack() { @@ -199,7 +199,7 @@ public: // offer NumberFormatter also static static SvNumberFormatter* PrepareNumberFormatter( sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx, - LanguageType* peFormatterLangType=NULL, DateFormat* peFormatterDateFormat=NULL ); + LanguageType* peFormatterLangType=nullptr, DateFormat* peFormatterDateFormat=nullptr ); }; // chainable items to keep references temporary @@ -208,7 +208,7 @@ struct RefSaveItem SbxVariableRef xRef; RefSaveItem* pNext; - RefSaveItem() { pNext = NULL; } + RefSaveItem() { pNext = nullptr; } }; @@ -285,7 +285,7 @@ class SbiRuntime { RefSaveItem* pToClearItem = pRefSaveList; pRefSaveList = pToClearItem->pNext; - pToClearItem->xRef = NULL; + pToClearItem->xRef = nullptr; pToClearItem->pNext = pItemStoreList; pItemStoreList = pToClearItem; } diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx index 3207d5912e5e..e939bbc23c54 100644 --- a/basic/source/inc/scanner.hxx +++ b/basic/source/inc/scanner.hxx @@ -66,7 +66,7 @@ protected: bool bInStatement; void GenError( SbError ); public: - SbiScanner( const OUString&, StarBASIC* = NULL ); + SbiScanner( const OUString&, StarBASIC* = nullptr ); ~SbiScanner(); void EnableErrors() { bError = false; } diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx index a136f39293f1..4b2f42ad1523 100644 --- a/basic/source/inc/token.hxx +++ b/basic/source/inc/token.hxx @@ -122,7 +122,7 @@ class TokenLabelInfo public: TokenLabelInfo(); TokenLabelInfo( const TokenLabelInfo& rInfo ) - : m_pTokenCanBeLabelTab( NULL ) + : m_pTokenCanBeLabelTab( nullptr ) { (void)rInfo; } ~TokenLabelInfo(); @@ -143,7 +143,7 @@ protected: bool bAs; // last keyword was AS bool bErrorIsSymbol; // Handle Error token as Symbol, not keyword public: - SbiTokenizer( const OUString&, StarBASIC* = NULL ); + SbiTokenizer( const OUString&, StarBASIC* = nullptr ); ~SbiTokenizer(); inline bool IsEof() { return bEof; } diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 8b84e75e7646..6e4b35bf0eb4 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -125,7 +125,7 @@ IMPL_LINK_NOARG_TYPED( SbiInputDialog, Cancel, Button *, void ) } SbiStream::SbiStream() - : pStrm(0) + : pStrm(nullptr) , nExpandOnWriteTo(0) , nLine(0) , nLen(0) @@ -622,7 +622,7 @@ SbError SbiStream::Open MapError(); if( nError ) { - delete pStrm, pStrm = NULL; + delete pStrm, pStrm = nullptr; } return nError; } @@ -633,7 +633,7 @@ SbError SbiStream::Close() { MapError(); delete pStrm; - pStrm = NULL; + pStrm = nullptr; } nChan = 0; return nError; @@ -762,7 +762,7 @@ SbiIoSystem::SbiIoSystem() { for( short i = 0; i < CHANNELS; i++ ) { - pChan[ i ] = NULL; + pChan[ i ] = nullptr; } nChan = 0; nError = 0; @@ -796,7 +796,7 @@ void SbiIoSystem::Open(short nCh, const OString& rName, StreamMode nMode, SbiStr nError = pChan[ nCh ]->Open( nCh, rName, nMode, nFlags, nLen ); if( nError ) { - delete pChan[ nCh ], pChan[ nCh ] = NULL; + delete pChan[ nCh ], pChan[ nCh ] = nullptr; } } nChan = 0; @@ -817,7 +817,7 @@ void SbiIoSystem::Close() { nError = pChan[ nChan ]->Close(); delete pChan[ nChan ]; - pChan[ nChan ] = NULL; + pChan[ nChan ] = nullptr; } nChan = 0; } @@ -831,7 +831,7 @@ void SbiIoSystem::Shutdown() { SbError n = pChan[ i ]->Close(); delete pChan[ i ]; - pChan[ i ] = NULL; + pChan[ i ] = nullptr; if( n && !nError ) { nError = n; @@ -913,7 +913,7 @@ void SbiIoSystem::Write(const OUString& rBuf, short n) SbiStream* SbiIoSystem::GetStream( short nChannel ) const { - SbiStream* pRet = 0; + SbiStream* pRet = nullptr; if( nChannel >= 0 && nChannel < CHANNELS ) { pRet = pChan[ nChannel ]; @@ -929,7 +929,7 @@ void SbiIoSystem::CloseAll() { SbError n = pChan[ i ]->Close(); delete pChan[ i ]; - pChan[ i ] = NULL; + pChan[ i ] = nullptr; if( n && !nError ) { nError = n; diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 76ef40e392de..1639b5fed8c5 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -443,7 +443,7 @@ RTLFUNC(CurDir) StarBASIC::Error( ERRCODE_BASIC_NO_MEMORY ); return; } - if( getcwd( pMem.get(), nSize-1 ) != NULL ) + if( getcwd( pMem.get(), nSize-1 ) != nullptr ) { rPar.Get(0)->PutString( OUString::createFromAscii(pMem.get()) ); return; @@ -2124,7 +2124,7 @@ RTLFUNC(DateValue) else { // #39629 check GetSbData()->pInst, can be called from the URL line - SvNumberFormatter* pFormatter = NULL; + SvNumberFormatter* pFormatter = nullptr; if( GetSbData()->pInst ) { pFormatter = GetSbData()->pInst->GetNumberFormatter(); @@ -2194,7 +2194,7 @@ RTLFUNC(TimeValue) } else { - SvNumberFormatter* pFormatter = NULL; + SvNumberFormatter* pFormatter = nullptr; if( GetSbData()->pInst ) pFormatter = GetSbData()->pInst->GetNumberFormatter(); else @@ -2405,7 +2405,7 @@ RTLFUNC(Time) double nDays = (double)nSeconds * ( 1.0 / (24.0*3600.0) ); Color* pCol; - SvNumberFormatter* pFormatter = NULL; + SvNumberFormatter* pFormatter = nullptr; sal_uInt32 nIndex; if( GetSbData()->pInst ) { @@ -2462,7 +2462,7 @@ RTLFUNC(Date) OUString aRes; Color* pCol; - SvNumberFormatter* pFormatter = NULL; + SvNumberFormatter* pFormatter = nullptr; sal_uInt32 nIndex; if( GetSbData()->pInst ) { @@ -2528,7 +2528,7 @@ RTLFUNC(IsObject) SbUnoClass* pUnoClass; bool bObject; - if( pObj && NULL != ( pUnoClass=dynamic_cast( pObj) ) ) + if( pObj && nullptr != ( pUnoClass=dynamic_cast( pObj) ) ) { bObject = pUnoClass->getUnoClass().is(); } @@ -2588,7 +2588,7 @@ RTLFUNC(IsEmpty) } else { - SbxVariable* pVar = NULL; + SbxVariable* pVar = nullptr; if( SbiRuntime::isVBAEnabled() ) { pVar = getDefaultProp( rPar.Get(1) ); @@ -2710,7 +2710,7 @@ OUString implSetupWildcard( const OUString& rFileParam, SbiRTLData* pRTLData ) static sal_Char cWild2 = '?'; delete pRTLData->pWildCard; - pRTLData->pWildCard = NULL; + pRTLData->pWildCard = nullptr; pRTLData->sFullNameToBeChecked.clear(); OUString aFileParam = rFileParam; @@ -3006,7 +3006,7 @@ RTLFUNC(Dir) if( nRet != FileBase::E_None ) { delete pRTLData->pDir; - pRTLData->pDir = NULL; + pRTLData->pDir = nullptr; rPar.Get(0)->PutString( OUString() ); return; } @@ -3053,7 +3053,7 @@ RTLFUNC(Dir) if( nRet != FileBase::E_None ) { delete pRTLData->pDir; - pRTLData->pDir = NULL; + pRTLData->pDir = nullptr; aPath.clear(); break; } @@ -3255,7 +3255,7 @@ RTLFUNC(FileDateTime) Color* pCol; - SvNumberFormatter* pFormatter = NULL; + SvNumberFormatter* pFormatter = nullptr; sal_uInt32 nIndex; if( GetSbData()->pInst ) { @@ -3718,7 +3718,7 @@ RTLFUNC(Shell) ++iter; sal_uInt16 nParamCount = sal::static_int_cast< sal_uInt16 >(aTokenList.size() - 1 ); - rtl_uString** pParamList = NULL; + rtl_uString** pParamList = nullptr; if( nParamCount ) { pParamList = new rtl_uString*[nParamCount]; @@ -3726,7 +3726,7 @@ RTLFUNC(Shell) { const OUString& rParamStr = (*iter); const OUString aTempStr( rParamStr.getStr(), rParamStr.getLength()); - pParamList[iList] = NULL; + pParamList[iList] = nullptr; rtl_uString_assign(&(pParamList[iList]), aTempStr.pData); } } @@ -3737,9 +3737,9 @@ RTLFUNC(Shell) pParamList, nParamCount, nOptions, - NULL, - NULL, - NULL, 0, + nullptr, + nullptr, + nullptr, 0, &pApp ) == osl_Process_E_None; // 53521 only free process handle on success @@ -4414,7 +4414,7 @@ RTLFUNC(StrConv) refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); - refVar->SetParameters( NULL ); + refVar->SetParameters( nullptr ); return; } rPar.Get(0)->PutString(aNewStr); diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 8f5dedd4f81a..d42947f28fb4 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -122,10 +122,10 @@ RTLFUNC(CallByName) // 1. parameter is object SbxBase* pObjVar = static_cast(rPar.Get(1)->GetObject()); - SbxObject* pObj = NULL; + SbxObject* pObj = nullptr; if( pObjVar ) pObj = dynamic_cast( pObjVar ); - if( !pObj && pObjVar && 0 != dynamic_cast( pObjVar) ) + if( !pObj && pObjVar && nullptr != dynamic_cast( pObjVar) ) { SbxBase* pObjVarObj = static_cast(pObjVar)->GetObject(); pObj = dynamic_cast( pObjVarObj ); @@ -144,7 +144,7 @@ RTLFUNC(CallByName) //SbxObject* pFindObj = NULL; SbxVariable* pFindVar = pObj->Find( aNameStr, SbxCLASS_DONTCARE ); - if( pFindVar == NULL ) + if( pFindVar == nullptr ) { StarBASIC::Error( ERRCODE_BASIC_PROC_UNDEFINED ); return; @@ -182,8 +182,8 @@ RTLFUNC(CallByName) { SbxVariableRef rFindVar = pFindVar; SbiInstance* pInst = GetSbData()->pInst; - SbiRuntime* pRT = pInst ? pInst->pRun : NULL; - if( pRT != NULL ) + SbiRuntime* pRT = pInst ? pInst->pRun : nullptr; + if( pRT != nullptr ) { pRT->StepSET_Impl( pValVar, rFindVar ); } @@ -193,7 +193,7 @@ RTLFUNC(CallByName) case vbMethod: { SbMethod* pMeth = dynamic_cast( pFindVar ); - if( pMeth == NULL ) + if( pMeth == nullptr ) { StarBASIC::Error( ERRCODE_BASIC_PROC_UNDEFINED ); return; @@ -217,7 +217,7 @@ RTLFUNC(CallByName) if( xArray.Is() ) pMeth->SetParameters( xArray ); pMeth->Call( refVar ); - pMeth->SetParameters( NULL ); + pMeth->SetParameters( nullptr ); } break; default: @@ -850,7 +850,7 @@ RTLFUNC(Array) refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); - refVar->SetParameters( NULL ); + refVar->SetParameters( nullptr ); } @@ -890,7 +890,7 @@ RTLFUNC(DimArray) refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); - refVar->SetParameters( NULL ); + refVar->SetParameters( nullptr ); } /* @@ -931,7 +931,7 @@ RTLFUNC(FindObject) OUString aNameStr = rPar.Get(1)->GetOUString(); SbxBase* pFind = StarBASIC::FindSBXInCurrentScope( aNameStr ); - SbxObject* pFindObj = NULL; + SbxObject* pFindObj = nullptr; if( pFind ) { pFindObj = dynamic_cast( pFind ); @@ -955,12 +955,12 @@ RTLFUNC(FindPropertyObject) } SbxBase* pObjVar = static_cast(rPar.Get(1)->GetObject()); - SbxObject* pObj = NULL; + SbxObject* pObj = nullptr; if( pObjVar ) { pObj = dynamic_cast( pObjVar ); } - if( !pObj && pObjVar && 0 != dynamic_cast( pObjVar) ) + if( !pObj && pObjVar && nullptr != dynamic_cast( pObjVar) ) { SbxBase* pObjVarObj = static_cast(pObjVar)->GetObject(); pObj = dynamic_cast( pObjVarObj ); @@ -968,7 +968,7 @@ RTLFUNC(FindPropertyObject) OUString aNameStr = rPar.Get(2)->GetOUString(); - SbxObject* pFindObj = NULL; + SbxObject* pFindObj = nullptr; if( pObj ) { SbxVariable* pFindVar = pObj->Find( aNameStr, SbxCLASS_OBJECT ); @@ -1269,7 +1269,7 @@ void PutGet( SbxArray& rPar, bool bPut ) pStrm->Seek( nFilePos ); } - SbxDimArray* pArr = 0; + SbxDimArray* pArr = nullptr; SbxVariable* pVar = rPar.Get(3); if( pVar->GetType() & SbxARRAY ) { @@ -1841,7 +1841,7 @@ RTLFUNC(Split) refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); - refVar->SetParameters( NULL ); + refVar->SetParameters( nullptr ); } // MonthName(month[, abbreviate]) @@ -2017,7 +2017,7 @@ IntervalInfo const * getIntervalInfo( const OUString& rStringCode ) return &aIntervalTable[i]; } } - return NULL; + return nullptr; } inline void implGetDayMonthYear( sal_Int16& rnYear, sal_Int16& rnMonth, sal_Int16& rnDay, double dDate ) @@ -2295,7 +2295,7 @@ RTLFUNC(DateDiff) } double implGetDateOfFirstDayInFirstWeek - ( sal_Int16 nYear, sal_Int16& nFirstDay, sal_Int16& nFirstWeek, bool* pbError = NULL ) + ( sal_Int16 nYear, sal_Int16& nFirstDay, sal_Int16& nFirstWeek, bool* pbError = nullptr ) { SbError nError = 0; if( nFirstDay < 0 || nFirstDay > 7 ) @@ -2534,7 +2534,7 @@ RTLFUNC(FormatDateTime) // Dienstag, 21. December 2004 case 1: { - SvNumberFormatter* pFormatter = NULL; + SvNumberFormatter* pFormatter = nullptr; if( GetSbData()->pInst ) { pFormatter = GetSbData()->pInst->GetNumberFormatter(); @@ -3290,7 +3290,7 @@ RTLFUNC(Me) SbModule* pActiveModule = GetSbData()->pInst->GetActiveModule(); SbClassModuleObject* pClassModuleObject = dynamic_cast( pActiveModule ); SbxVariableRef refVar = rPar.Get(0); - if( pClassModuleObject == NULL ) + if( pClassModuleObject == nullptr ) { SbObjModule* pMod = dynamic_cast( pActiveModule ); if ( pMod ) diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx index 221ac9629e2e..276bc425d961 100644 --- a/basic/source/runtime/props.cxx +++ b/basic/source/runtime/props.cxx @@ -80,7 +80,7 @@ RTLFUNC(Nothing) (void)bWrite; // return an empty object - rPar.Get( 0 )->PutObject( NULL ); + rPar.Get( 0 )->PutObject( nullptr ); } RTLFUNC(Null) diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index a4054790c5bf..e1fd7686ef9f 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -250,16 +250,16 @@ SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// all opcodes with two operands SbiRTLData::SbiRTLData() { - pDir = 0; + pDir = nullptr; nDirFlags = 0; nCurDirPos = 0; - pWildCard = NULL; + pWildCard = nullptr; } SbiRTLData::~SbiRTLData() { delete pDir; - pDir = 0; + pDir = nullptr; delete pWildCard; } @@ -312,8 +312,8 @@ SbiInstance::SbiInstance( StarBASIC* p ) , nErl(0) , bReschedule(true) , bCompatibility(false) - , pRun(NULL) - , pNext(NULL) + , pRun(nullptr) + , pNext(nullptr) , nCallLvl(0) , nBreakCallLvl(0) { @@ -542,7 +542,7 @@ SbModule* SbiInstance::GetActiveModule() } else { - return NULL; + return nullptr; } } @@ -553,7 +553,7 @@ SbMethod* SbiInstance::GetCaller( sal_uInt16 nLevel ) { p = p->pNext; } - return p ? p->GetCaller() : NULL; + return p ? p->GetCaller() : nullptr; } // SbiInstance @@ -562,18 +562,18 @@ SbMethod* SbiInstance::GetCaller( sal_uInt16 nLevel ) SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart ) : rBasic( *static_cast(pm->pParent) ), pInst( GetSbData()->pInst ), - pMod( pm ), pMeth( pe ), pImg( pMod->pImage ), mpExtCaller(0), m_nLastTime(0) + pMod( pm ), pMeth( pe ), pImg( pMod->pImage ), mpExtCaller(nullptr), m_nLastTime(0) { nFlags = pe ? pe->GetDebugFlags() : 0; pIosys = pInst->GetIoSystem(); - pArgvStk = NULL; - pGosubStk = NULL; - pForStk = NULL; - pError = NULL; + pArgvStk = nullptr; + pGosubStk = nullptr; + pForStk = nullptr; + pError = nullptr; pErrCode = pErrStmnt = - pRestart = NULL; - pNext = NULL; + pRestart = nullptr; + pNext = nullptr; pCode = pStmnt = reinterpret_cast(pImg->GetCode()) + nStart; bRun = @@ -592,8 +592,8 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart ) refExprStk = new SbxArray; SetVBAEnabled( pMod->IsVBACompat() ); SetParameters( pe ? pe->GetParameters() : nullptr ); - pRefSaveList = NULL; - pItemStoreList = NULL; + pRefSaveList = nullptr; + pItemStoreList = nullptr; } SbiRuntime::~SbiRuntime() @@ -624,7 +624,7 @@ void SbiRuntime::SetVBAEnabled(bool bEnabled ) } else { - mpExtCaller = 0; + mpExtCaller = nullptr; } } @@ -638,13 +638,13 @@ void SbiRuntime::SetParameters( SbxArray* pParams ) // for the return value refParams->Put( pMeth, 0 ); - SbxInfo* pInfo = pMeth ? pMeth->GetInfo() : NULL; + SbxInfo* pInfo = pMeth ? pMeth->GetInfo() : nullptr; sal_uInt16 nParamCount = pParams ? pParams->Count() : 1; if( nParamCount > 1 ) { for( sal_uInt16 i = 1 ; i < nParamCount ; i++ ) { - const SbxParamInfo* p = pInfo ? pInfo->GetParam( i ) : NULL; + const SbxParamInfo* p = pInfo ? pInfo->GetParam( i ) : nullptr; // #111897 ParamArray if( p && (p->nUserData & PARAM_INFO_PARAMARRAY) != 0 ) @@ -665,7 +665,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams ) refParams->Put( pArrayVar, i ); // Block ParamArray for missing parameter - pInfo = NULL; + pInfo = nullptr; break; } @@ -836,7 +836,7 @@ bool SbiRuntime::Step() else { bLetParentHandleThis = true; - pError = NULL; //terminate the handler + pError = nullptr; //terminate the handler } if ( bLetParentHandleThis ) { @@ -844,11 +844,11 @@ bool SbiRuntime::Step() // consider superior error handlers // there's no error handler -> find one farther above - SbiRuntime* pRtErrHdl = NULL; + SbiRuntime* pRtErrHdl = nullptr; SbiRuntime* pRt = this; - while( NULL != (pRt = pRt->pNext) ) + while( nullptr != (pRt = pRt->pNext) ) { - if( !pRt->bError || pRt->pError != NULL ) + if( !pRt->bError || pRt->pError != nullptr ) { pRtErrHdl = pRt; break; @@ -897,7 +897,7 @@ void SbiRuntime::Error( SbError n, bool bVBATranslationAlreadyDone ) sal_Int32 nVBAErrorNumber = translateErrorToVba( nError, aMsg ); SbxVariable* pSbxErrObjVar = SbxErrObject::getErrObject(); SbxErrObject* pGlobErr = static_cast< SbxErrObject* >( pSbxErrObjVar ); - if( pGlobErr != NULL ) + if( pGlobErr != nullptr ) { pGlobErr->setNumberAndDescription( nVBAErrorNumber, aMsg ); } @@ -995,7 +995,7 @@ SbxVariableRef SbiRuntime::PopVar() // methods hold themselves in parameter 0 if( dynamic_cast(xVar.get()) != nullptr ) { - xVar->SetParameters(0); + xVar->SetParameters(nullptr); } return xVar; } @@ -1035,15 +1035,15 @@ void SbiRuntime::TOSMakeTemp() p->Broadcast( SBX_HINT_DATAWANTED ); } - SbxVariable* pDflt = NULL; - if ( bVBAEnabled && ( p->GetType() == SbxOBJECT || p->GetType() == SbxVARIANT ) && ((pDflt = getDefaultProp(p)) != NULL) ) + SbxVariable* pDflt = nullptr; + if ( bVBAEnabled && ( p->GetType() == SbxOBJECT || p->GetType() == SbxVARIANT ) && ((pDflt = getDefaultProp(p)) != nullptr) ) { pDflt->Broadcast( SBX_HINT_DATAWANTED ); // replacing new p on stack causes object pointed by // pDft->pParent to be deleted, when p2->Compute() is // called below pParent is accessed ( but its deleted ) // so set it to NULL now - pDflt->SetParent( NULL ); + pDflt->SetParent( nullptr ); p = new SbxVariable( *pDflt ); p->SetFlag( SbxFlagBits::ReadWrite ); refExprStk->Put( p, nExprLvl - 1 ); @@ -1090,7 +1090,7 @@ void SbiRuntime::PopGosub() void SbiRuntime::ClearGosubStack() { SbiGosubStack* p; - while(( p = pGosubStk ) != NULL ) + while(( p = pGosubStk ) != nullptr ) { pGosubStk = p->pNext, delete p; } @@ -1156,8 +1156,8 @@ void SbiRuntime::PushForEach() pForStk = p; SbxVariableRef xObjVar = PopVar(); - SbxBase* pObj = xObjVar.Is() ? xObjVar->GetObject() : NULL; - if( pObj == NULL ) + SbxBase* pObj = xObjVar.Is() ? xObjVar->GetObject() : nullptr; + if( pObj == nullptr ) { Error( ERRCODE_BASIC_NO_OBJECT ); return; @@ -1261,15 +1261,15 @@ SbiForStack* SbiRuntime::FindForStackItemForCollection( class BasicCollection* p { for (SbiForStack *p = pForStk; p; p = p->pNext) { - SbxVariable* pVar = p->refEnd.Is() ? p->refEnd.get() : NULL; - if( p->eForType == FOR_EACH_COLLECTION && pVar != NULL && + SbxVariable* pVar = p->refEnd.Is() ? p->refEnd.get() : nullptr; + if( p->eForType == FOR_EACH_COLLECTION && pVar != nullptr && dynamic_cast( pVar) == pCollection ) { return p; } } - return NULL; + return nullptr; } @@ -1378,14 +1378,14 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) } } - static SbxVariable* pTRUE = NULL; - static SbxVariable* pFALSE = NULL; + static SbxVariable* pTRUE = nullptr; + static SbxVariable* pFALSE = nullptr; // why do this on non-windows ? // why do this at all ? // I dumbly follow the pattern :-/ if ( bVBAEnabled && ( p1->IsNull() || p2->IsNull() ) ) { - static SbxVariable* pNULL = NULL; + static SbxVariable* pNULL = nullptr; if( !pNULL ) { @@ -1635,11 +1635,11 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe return false; } // #115826: Exclude ProcedureProperties to avoid call to Property Get procedure - else if( 0 != dynamic_cast( &refVar) ) + else if( nullptr != dynamic_cast( &refVar) ) return false; SbxObjectRef xValObj = static_cast(refVal->GetObject()); - if( !xValObj.Is() || 0 != dynamic_cast( &xValObj) ) + if( !xValObj.Is() || nullptr != dynamic_cast( &xValObj) ) return false; SbUnoObject* pUnoVal = dynamic_cast( static_cast(xValObj.get()) ); @@ -1755,8 +1755,8 @@ struct DimAsNewRecoverItem SbModule* m_pClassModule; DimAsNewRecoverItem() - : m_pObjParent( NULL ) - , m_pClassModule( NULL ) + : m_pObjParent( nullptr ) + , m_pClassModule( nullptr ) {} DimAsNewRecoverItem( const OUString& rObjClass, const OUString& rObjName, @@ -1833,7 +1833,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b } else if( !(eValType & SbxARRAY) ) { - refVal = NULL; + refVal = nullptr; } } } @@ -1888,7 +1888,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b { // check if lhs is a null object // if it is then use the object not the default property - SbxObject* pObj = NULL; + SbxObject* pObj = nullptr; pObj = dynamic_cast( refVar.get() ); @@ -1900,7 +1900,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b SbxBase* pObjVarObj = refVar->GetObject(); pObj = dynamic_cast( pObjVarObj ); } - SbxVariable* pDflt = NULL; + SbxVariable* pDflt = nullptr; if ( pObj && !bObjAssign ) { // lhs is either a valid object || or has a defaultProp @@ -1927,8 +1927,8 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b Reference< XInterface > xComListener; SbxBase* pObj = refVal->GetObject(); - SbUnoObject* pUnoObj = (pObj != NULL) ? dynamic_cast( pObj ) : NULL; - if( pUnoObj != NULL ) + SbUnoObject* pUnoObj = (pObj != nullptr) ? dynamic_cast( pObj ) : nullptr; + if( pUnoObj != nullptr ) { Any aControlAny = pUnoObj->getUnoAny(); OUString aDeclareClassName = refVar->GetDeclareClassName(); @@ -1954,10 +1954,10 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b } if ( bDimAsNew ) { - if( 0 == dynamic_cast( &refVar) ) + if( nullptr == dynamic_cast( &refVar) ) { SbxBase* pValObjBase = refVal->GetObject(); - if( pValObjBase == NULL ) + if( pValObjBase == nullptr ) { if( xPrevVarObj.Is() ) { @@ -1967,7 +1967,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b if( it != rDimAsNewRecoverHash.end() ) { const DimAsNewRecoverItem& rItem = it->second; - if( rItem.m_pClassModule != NULL ) + if( rItem.m_pClassModule != nullptr ) { SbClassModuleObject* pNewObj = new SbClassModuleObject( rItem.m_pClassModule ); pNewObj->SetName( rItem.m_aObjName ); @@ -1992,13 +1992,13 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b { // Store information to instantiate object later SbxObject* pValObj = dynamic_cast( pValObjBase ); - if( pValObj != NULL ) + if( pValObj != nullptr ) { OUString aObjClass = pValObj->GetClassName(); SbClassModuleObject* pClassModuleObj = dynamic_cast( pValObjBase ); DimAsNewRecoverHash &rDimAsNewRecoverHash = GaDimAsNewRecoverHash::get(); - if( pClassModuleObj != NULL ) + if( pClassModuleObj != nullptr ) { SbModule* pClassModule = pClassModuleObj->getClassModule(); rDimAsNewRecoverHash[refVar] = @@ -2007,7 +2007,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b else if( aObjClass.equalsIgnoreAsciiCase( "Collection" ) ) { rDimAsNewRecoverHash[refVar] = - DimAsNewRecoverItem( aObjClass, pValObj->GetName(), pValObj->GetParent(), NULL ); + DimAsNewRecoverItem( aObjClass, pValObj->GetName(), pValObj->GetParent(), nullptr ); } } } @@ -2146,7 +2146,7 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar ) } SbxDataType eType = refVar->GetType(); lcl_clearImpl( refVar, eType ); - refRedim = NULL; + refRedim = nullptr; } SbxArray* pDims = refVar->GetParameters(); // must have an even number of arguments @@ -2189,7 +2189,7 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar ) refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); refVar->SetFlags( nSavFlags ); - refVar->SetParameters( NULL ); + refVar->SetParameters( nullptr ); } } @@ -2281,7 +2281,7 @@ void SbiRuntime::StepREDIMP() 0, pActualIndices.get(), pLowerBounds.get(), pUpperBounds.get() ); } - refRedimpArray = NULL; + refRedimpArray = nullptr; } } @@ -2439,9 +2439,9 @@ void SbiRuntime::StepARGV() SbxVariableRef pVal = PopVar(); // Before fix of #94916: - if( 0 != dynamic_cast( &pVal) - || 0 != dynamic_cast( &pVal) - || 0 != dynamic_cast( &pVal) ) + if( nullptr != dynamic_cast( &pVal) + || nullptr != dynamic_cast( &pVal) + || nullptr != dynamic_cast( &pVal) ) { // evaluate methods and properties! SbxVariable* pRes = new SbxVariable( *pVal ); @@ -2638,7 +2638,7 @@ void SbiRuntime::StepENDCASE() void SbiRuntime::StepSTDERROR() { - pError = NULL; bError = true; + pError = nullptr; bError = true; pInst->aErrorMsg.clear(); pInst->nErr = 0L; pInst->nErl = 0; @@ -2848,7 +2848,7 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 ) { OUString aAlias( pImg->GetString( static_cast( nOp1 ) ) ); SbxVariableRef pVal = PopVar(); - if( bVBAEnabled && ( 0 != dynamic_cast( &pVal) || 0 != dynamic_cast( &pVal) || 0 != dynamic_cast( &pVal) ) ) + if( bVBAEnabled && ( nullptr != dynamic_cast( &pVal) || nullptr != dynamic_cast( &pVal) || nullptr != dynamic_cast( &pVal) ) ) { // named variables ( that are Any especially properties ) can be empty at this point and need a broadcast if ( pVal->GetType() == SbxEMPTY ) @@ -3027,7 +3027,7 @@ void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 ) case FOR_EACH_ARRAY: { SbiForStack* p = pForStk; - if( p->pArrayCurIndices == NULL ) + if( p->pArrayCurIndices == nullptr ) { bEndLoop = true; } @@ -3060,7 +3060,7 @@ void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 ) if( !bFoundNext ) { delete[] p->pArrayCurIndices; - p->pArrayCurIndices = NULL; + p->pArrayCurIndices = nullptr; } } break; @@ -3209,10 +3209,10 @@ bool SbiRuntime::implIsClass( SbxObject* pObj, const OUString& aClass ) OUString aObjClass = pObj->GetClassName(); SbModule* pClassMod = GetSbData()->pClassFac->FindClass( aObjClass ); SbClassData* pClassData; - if( pClassMod && (pClassData=pClassMod->pClassData) != NULL ) + if( pClassMod && (pClassData=pClassMod->pClassData) != nullptr ) { SbxVariable* pClassVar = pClassData->mxIfaces->Find( aClass, SbxCLASS_DONTCARE ); - bRet = (pClassVar != NULL); + bRet = (pClassVar != nullptr); } } } @@ -3227,7 +3227,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal, SbxDataType t = refVal->GetType(); SbxVariable* pVal = refVal.get(); // we don't know the type of uno properties that are (maybevoid) - if ( t == SbxEMPTY && 0 != dynamic_cast( &refVal) ) + if ( t == SbxEMPTY && nullptr != dynamic_cast( &refVal) ) { SbUnoProperty* pProp = static_cast(pVal); t = pProp->getRealType(); @@ -3264,7 +3264,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal, bOk = true; SbClassModuleObject* pClassModuleObject = dynamic_cast( pObj ); - if( pClassModuleObject != NULL ) + if( pClassModuleObject != nullptr ) pClassModuleObject->triggerInitializeEvent(); } } @@ -3352,13 +3352,13 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt if( bIsVBAInterOp ) { StarBASIC* pMSOMacroRuntimeLib = GetSbData()->pMSOMacroRuntimLib; - if( pMSOMacroRuntimeLib != NULL ) + if( pMSOMacroRuntimeLib != nullptr ) { pMSOMacroRuntimeLib->ResetFlag( SbxFlagBits::ExtSearch ); } } - SbxVariable* pElem = NULL; + SbxVariable* pElem = nullptr; if( !pObj ) { Error( ERRCODE_BASIC_NO_OBJECT ); @@ -3413,7 +3413,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt SbiInstance* pInst_ = GetSbData()->pInst; if( pInst_ && pInst_->IsCompatibility() && pObj != pElem->GetParent() ) { - pElem = NULL; // Found but in wrong module! + pElem = nullptr; // Found but in wrong module! } // Interfaces: Use SbxFlagBits::ExtFound } @@ -3564,7 +3564,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt SbxVariable* pNew = new SbxMethod(*pMethod); //OLD: SbxVariable* pNew = new SbxVariable( *pElem ); - pElem->SetParameters(0); + pElem->SetParameters(nullptr); pNew->SetFlag( SbxFlagBits::ReadWrite ); if( bSet ) @@ -3577,13 +3577,13 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt // definitely we want this for VBA where properties are often // collections ( which need index access ), but lets only do // this if we actually have params following - else if( bVBAEnabled && 0 != dynamic_cast( pElem) && pElem->GetParameters() ) + else if( bVBAEnabled && nullptr != dynamic_cast( pElem) && pElem->GetParameters() ) { SbxVariableRef refTemp = pElem; // dissolve the notify while copying variable SbxVariable* pNew = new SbxVariable( *pElem ); - pElem->SetParameters( NULL ); + pElem->SetParameters( nullptr ); pElem = pNew; } } @@ -3596,10 +3596,10 @@ SbxBase* SbiRuntime::FindElementExtern( const OUString& rName ) // don't expect pMeth to be != 0, as there are none set // in the RunInit yet - SbxVariable* pElem = NULL; + SbxVariable* pElem = nullptr; if( !pMod || rName.isEmpty() ) { - return NULL; + return nullptr; } if( refLocals ) { @@ -3714,7 +3714,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 ) } } } - else if( bVBAEnabled && p->GetType() == SbxOBJECT && (0 == dynamic_cast( p) || !p->IsBroadcaster()) ) + else if( bVBAEnabled && p->GetType() == SbxOBJECT && (nullptr == dynamic_cast( p) || !p->IsBroadcaster()) ) { // Check for default method with named parameters SbxBaseRef xObj = p->GetObject(); @@ -3735,7 +3735,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 ) if ( !sDefaultMethod.isEmpty() ) { SbxVariable* meth = pUnoObj->Find( sDefaultMethod, SbxCLASS_METHOD ); - if( meth != NULL ) + if( meth != nullptr ) { pInfo = meth->GetInfo(); } @@ -3791,7 +3791,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 ) } else { - p->SetParameters( NULL ); + p->SetParameters( nullptr ); } } @@ -3832,13 +3832,13 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) // #42940, set parameter 0 to NULL so that var doesn't contain itself if( pPar ) { - pPar->Put( NULL, 0 ); + pPar->Put( nullptr, 0 ); } } // consider index-access for UnoObjects else if( pElem->GetType() == SbxOBJECT && - 0 == dynamic_cast( pElem) && - ( !bVBAEnabled || 0 == dynamic_cast( pElem) ) ) + nullptr == dynamic_cast( pElem) && + ( !bVBAEnabled || nullptr == dynamic_cast( pElem) ) ) { pPar = pElem->GetParameters(); if ( pPar ) @@ -3898,7 +3898,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) } else { - pElem->PutObject( NULL ); + pElem->PutObject( nullptr ); } } } @@ -3955,7 +3955,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) } // #42940, set parameter 0 to NULL so that var doesn't contain itself - pPar->Put( NULL, 0 ); + pPar->Put( nullptr, 0 ); } else if (BasicCollection* pCol = dynamic_cast(static_cast(pObj))) { @@ -3967,7 +3967,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) else if( bVBAEnabled ) // !pObj { SbxArray* pParam = pElem->GetParameters(); - if( pParam != NULL && !pElem->IsSet( SbxFlagBits::VarToDim ) ) + if( pParam != nullptr && !pElem->IsSet( SbxFlagBits::VarToDim ) ) { Error( ERRCODE_BASIC_NO_OBJECT ); } @@ -4073,7 +4073,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { if( t == SbxOBJECT ) { - p->PutObject( NULL ); + p->PutObject( nullptr ); } else { @@ -4160,7 +4160,7 @@ void SbiRuntime::StepCASEIS( sal_uInt32 nOp1, sal_uInt32 nOp2 ) void SbiRuntime::StepCALL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { OUString aName = pImg->GetString( static_cast( nOp1 & 0x7FFF ) ); - SbxArray* pArgs = NULL; + SbxArray* pArgs = nullptr; if( nOp1 & 0x8000 ) { pArgs = refArgv; @@ -4178,7 +4178,7 @@ void SbiRuntime::StepCALL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) void SbiRuntime::StepCALLC( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { OUString aName = pImg->GetString( static_cast( nOp1 & 0x7FFF ) ); - SbxArray* pArgs = NULL; + SbxArray* pArgs = nullptr; if( nOp1 & 0x8000 ) { pArgs = refArgv; @@ -4464,7 +4464,7 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) implCopyDimArray_DCREATE( pArray, pOldArray, nDims - 1, 0, pActualIndices.get(), pLowerBounds.get(), pUpperBounds.get() ); } - refRedimpArray = NULL; + refRedimpArray = nullptr; } } @@ -4521,7 +4521,7 @@ void SbiRuntime::StepLOCAL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) refLocals = new SbxArray; } OUString aName( pImg->GetString( static_cast( nOp1 ) ) ); - if( refLocals->Find( aName, SbxCLASS_DONTCARE ) == NULL ) + if( refLocals->Find( aName, SbxCLASS_DONTCARE ) == nullptr ) { SbxDataType t = (SbxDataType)(nOp2 & 0xffff); SbxVariable* p = new SbxVariable( t ); @@ -4658,11 +4658,11 @@ void SbiRuntime::StepFIND_G( sal_uInt32 nOp1, sal_uInt32 nOp2 ) SbxVariable* SbiRuntime::StepSTATIC_Impl( OUString& aName, SbxDataType& t ) { - SbxVariable* p = NULL; + SbxVariable* p = nullptr; if ( pMeth ) { SbxArray* pStatics = pMeth->GetStatics(); - if( pStatics && ( pStatics->Find( aName, SbxCLASS_DONTCARE ) == NULL ) ) + if( pStatics && ( pStatics->Find( aName, SbxCLASS_DONTCARE ) == nullptr ) ) { p = new SbxVariable( t ); if( t != SbxVARIANT ) diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 52c8653a3e6b..20ee4157ae75 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -67,14 +67,14 @@ struct Methods { static Methods aMethods[] = { { "Abs", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Abs),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "Array", SbxOBJECT, _FUNCTION, RTLNAME(Array),0 }, { "Asc", SbxLONG, 1 | _FUNCTION, RTLNAME(Asc),0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "AscW", SbxLONG, 1 | _FUNCTION | _COMPATONLY, RTLNAME(Asc),0}, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "Atn", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Atn),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "ATTR_ARCHIVE", SbxINTEGER, _CPROP, RTLNAME(ATTR_ARCHIVE),0 }, { "ATTR_DIRECTORY", SbxINTEGER, _CPROP, RTLNAME(ATTR_DIRECTORY),0 }, { "ATTR_HIDDEN", SbxINTEGER, _CPROP, RTLNAME(ATTR_HIDDEN),0 }, @@ -85,220 +85,220 @@ static Methods aMethods[] = { { "Beep", SbxNULL, _FUNCTION, RTLNAME(Beep),0 }, { "Blue", SbxINTEGER, 1 | _FUNCTION | _NORMONLY, RTLNAME(Blue),0 }, - { "RGB-Value", SbxLONG, 0,NULL,0 }, + { "RGB-Value", SbxLONG, 0,nullptr,0 }, { "CallByName", SbxVARIANT, 3 | _FUNCTION, RTLNAME(CallByName),0 }, - { "Object", SbxOBJECT, 0,NULL,0 }, - { "ProcedureName",SbxSTRING, 0,NULL,0 }, - { "CallType", SbxINTEGER, 0,NULL,0 }, + { "Object", SbxOBJECT, 0,nullptr,0 }, + { "ProcedureName",SbxSTRING, 0,nullptr,0 }, + { "CallType", SbxINTEGER, 0,nullptr,0 }, { "CBool", SbxBOOL, 1 | _FUNCTION, RTLNAME(CBool),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CByte", SbxBYTE, 1 | _FUNCTION, RTLNAME(CByte),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CCur", SbxCURRENCY, 1 | _FUNCTION, RTLNAME(CCur),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CDate", SbxDATE, 1 | _FUNCTION, RTLNAME(CDate),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CDateFromUnoDate", SbxDATE, 1 | _FUNCTION, RTLNAME(CDateFromUnoDate),0 }, - { "UnoDate", SbxOBJECT, 0,NULL,0 }, + { "UnoDate", SbxOBJECT, 0,nullptr,0 }, { "CDateToUnoDate", SbxOBJECT, 1 | _FUNCTION, RTLNAME(CDateToUnoDate),0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, { "CDateFromUnoTime", SbxDATE, 1 | _FUNCTION, RTLNAME(CDateFromUnoTime),0 }, - { "UnoTime", SbxOBJECT, 0,NULL,0 }, + { "UnoTime", SbxOBJECT, 0,nullptr,0 }, { "CDateToUnoTime", SbxOBJECT, 1 | _FUNCTION, RTLNAME(CDateToUnoTime),0 }, - { "Time", SbxDATE, 0,NULL,0 }, + { "Time", SbxDATE, 0,nullptr,0 }, { "CDateFromUnoDateTime", SbxDATE, 1 | _FUNCTION, RTLNAME(CDateFromUnoDateTime),0 }, - { "UnoDateTime", SbxOBJECT, 0,NULL,0 }, + { "UnoDateTime", SbxOBJECT, 0,nullptr,0 }, { "CDateToUnoDateTime", SbxOBJECT, 1 | _FUNCTION, RTLNAME(CDateToUnoDateTime),0 }, - { "DateTime", SbxDATE, 0,NULL,0 }, + { "DateTime", SbxDATE, 0,nullptr,0 }, { "CDateFromIso", SbxDATE, 1 | _FUNCTION, RTLNAME(CDateFromIso),0 }, - { "IsoDate", SbxSTRING, 0,NULL,0 }, + { "IsoDate", SbxSTRING, 0,nullptr,0 }, { "CDateToIso", SbxSTRING, 1 | _FUNCTION, RTLNAME(CDateToIso),0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, { "CDec", SbxDECIMAL, 1 | _FUNCTION, RTLNAME(CDec),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CDbl", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(CDbl),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CF_BITMAP", SbxINTEGER, _CPROP, RTLNAME(CF_BITMAP),0 }, { "CF_METAFILEPICT",SbxINTEGER, _CPROP, RTLNAME(CF_METAFILEPICT),0 }, { "CF_TEXT", SbxINTEGER, _CPROP, RTLNAME(CF_TEXT),0 }, { "ChDir", SbxNULL, 1 | _FUNCTION, RTLNAME(ChDir),0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "ChDrive", SbxNULL, 1 | _FUNCTION, RTLNAME(ChDrive),0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "Choose", SbxVARIANT, 2 | _FUNCTION, RTLNAME(Choose),0 }, - { "Index", SbxINTEGER, 0,NULL,0 }, - { "Expression", SbxVARIANT, 0,NULL,0 }, + { "Index", SbxINTEGER, 0,nullptr,0 }, + { "Expression", SbxVARIANT, 0,nullptr,0 }, { "Chr", SbxSTRING, 1 | _FUNCTION, RTLNAME(Chr),0 }, - { "string", SbxINTEGER, 0,NULL,0 }, + { "string", SbxINTEGER, 0,nullptr,0 }, { "ChrW", SbxSTRING, 1 | _FUNCTION | _COMPATONLY, RTLNAME(ChrW),0}, - { "string", SbxINTEGER, 0,NULL,0 }, + { "string", SbxINTEGER, 0,nullptr,0 }, { "CInt", SbxINTEGER, 1 | _FUNCTION, RTLNAME(CInt),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CLEAR_ALLTABS", SbxINTEGER, _CPROP, RTLNAME(CLEAR_ALLTABS),0 }, { "CLEAR_TAB", SbxINTEGER, _CPROP, RTLNAME(CLEAR_TAB),0 }, { "CLng", SbxLONG, 1 | _FUNCTION, RTLNAME(CLng),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CompatibilityMode", SbxBOOL, 1 | _FUNCTION, RTLNAME(CompatibilityMode),0}, - { "bEnable", SbxBOOL, 0,NULL,0 }, + { "bEnable", SbxBOOL, 0,nullptr,0 }, { "ConvertFromUrl", SbxSTRING, 1 | _FUNCTION, RTLNAME(ConvertFromUrl),0 }, - { "Url", SbxSTRING, 0,NULL,0 }, + { "Url", SbxSTRING, 0,nullptr,0 }, { "ConvertToUrl", SbxSTRING, 1 | _FUNCTION, RTLNAME(ConvertToUrl),0 }, - { "SystemPath", SbxSTRING, 0,NULL,0 }, + { "SystemPath", SbxSTRING, 0,nullptr,0 }, { "Cos", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Cos),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "CreateObject", SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateObject ),0 }, - { "class", SbxSTRING, 0,NULL,0 }, + { "class", SbxSTRING, 0,nullptr,0 }, { "CreateUnoListener",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoListener ),0 }, - { "prefix", SbxSTRING, 0,NULL,0 }, - { "typename", SbxSTRING, 0,NULL,0 }, + { "prefix", SbxSTRING, 0,nullptr,0 }, + { "typename", SbxSTRING, 0,nullptr,0 }, { "CreateUnoDialog",SbxOBJECT, 2 | _FUNCTION, RTLNAME( CreateUnoDialog ),0 }, - { "dialoglibrary",SbxOBJECT, 0,NULL,0 }, - { "dialogname", SbxSTRING, 0,NULL,0 }, + { "dialoglibrary",SbxOBJECT, 0,nullptr,0 }, + { "dialogname", SbxSTRING, 0,nullptr,0 }, { "CreateUnoService",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoService ),0 }, - { "servicename", SbxSTRING, 0,NULL,0 }, + { "servicename", SbxSTRING, 0,nullptr,0 }, { "CreateUnoServiceWithArguments",SbxOBJECT, 2 | _FUNCTION, RTLNAME( CreateUnoServiceWithArguments ),0 }, - { "servicename", SbxSTRING, 0,NULL,0 }, - { "arguments", SbxARRAY, 0,NULL,0 }, + { "servicename", SbxSTRING, 0,nullptr,0 }, + { "arguments", SbxARRAY, 0,nullptr,0 }, { "CreateUnoStruct",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoStruct ),0 }, - { "classname", SbxSTRING, 0,NULL,0 }, + { "classname", SbxSTRING, 0,nullptr,0 }, { "CreateUnoValue", SbxOBJECT, 2 | _FUNCTION, RTLNAME( CreateUnoValue ),0 }, - { "type", SbxSTRING, 0,NULL,0 }, - { "value", SbxVARIANT, 0,NULL,0 }, + { "type", SbxSTRING, 0,nullptr,0 }, + { "value", SbxVARIANT, 0,nullptr,0 }, { "CreatePropertySet",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreatePropertySet ),0 }, - { "values", SbxARRAY, 0,NULL,0 }, + { "values", SbxARRAY, 0,nullptr,0 }, { "CSng", SbxSINGLE, 1 | _FUNCTION, RTLNAME(CSng),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CStr", SbxSTRING, 1 | _FUNCTION, RTLNAME(CStr),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CurDir", SbxSTRING, 1 | _FUNCTION, RTLNAME(CurDir),0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "CVar", SbxVARIANT, 1 | _FUNCTION, RTLNAME(CVar),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "CVErr", SbxVARIANT, 1 | _FUNCTION, RTLNAME(CVErr),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, { "DDB", SbxDOUBLE, 5 | _FUNCTION | _COMPATONLY, RTLNAME(DDB),0 }, - { "Cost", SbxDOUBLE, 0, NULL,0 }, - { "Salvage", SbxDOUBLE, 0, NULL,0 }, - { "Life", SbxDOUBLE, 0, NULL,0 }, - { "Period", SbxDOUBLE, 0, NULL,0 }, - { "Factor", SbxVARIANT, _OPT, NULL,0 }, + { "Cost", SbxDOUBLE, 0, nullptr,0 }, + { "Salvage", SbxDOUBLE, 0, nullptr,0 }, + { "Life", SbxDOUBLE, 0, nullptr,0 }, + { "Period", SbxDOUBLE, 0, nullptr,0 }, + { "Factor", SbxVARIANT, _OPT, nullptr,0 }, { "Date", SbxDATE, _LFUNCTION,RTLNAME(Date),0 }, { "DateAdd", SbxDATE, 3 | _FUNCTION, RTLNAME(DateAdd),0 }, - { "Interval", SbxSTRING, 0,NULL,0 }, - { "Number", SbxLONG, 0,NULL,0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Interval", SbxSTRING, 0,nullptr,0 }, + { "Number", SbxLONG, 0,nullptr,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, { "DateDiff", SbxDOUBLE, 5 | _FUNCTION, RTLNAME(DateDiff),0 }, - { "Interval", SbxSTRING, 0,NULL,0 }, - { "Date1", SbxDATE, 0,NULL,0 }, - { "Date2", SbxDATE, 0,NULL,0 }, - { "Firstdayofweek" , SbxINTEGER, _OPT,NULL,0 }, - { "Firstweekofyear", SbxINTEGER, _OPT,NULL,0 }, + { "Interval", SbxSTRING, 0,nullptr,0 }, + { "Date1", SbxDATE, 0,nullptr,0 }, + { "Date2", SbxDATE, 0,nullptr,0 }, + { "Firstdayofweek" , SbxINTEGER, _OPT,nullptr,0 }, + { "Firstweekofyear", SbxINTEGER, _OPT,nullptr,0 }, { "DatePart", SbxLONG, 4 | _FUNCTION, RTLNAME(DatePart),0 }, - { "Interval", SbxSTRING, 0,NULL,0 }, - { "Date", SbxDATE, 0,NULL,0 }, - { "Firstdayofweek" , SbxINTEGER, _OPT, NULL,0 }, - { "Firstweekofyear", SbxINTEGER, _OPT, NULL,0 }, + { "Interval", SbxSTRING, 0,nullptr,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, + { "Firstdayofweek" , SbxINTEGER, _OPT, nullptr,0 }, + { "Firstweekofyear", SbxINTEGER, _OPT, nullptr,0 }, { "DateSerial", SbxDATE, 3 | _FUNCTION, RTLNAME(DateSerial),0 }, - { "Year", SbxINTEGER, 0,NULL,0 }, - { "Month", SbxINTEGER, 0,NULL,0 }, - { "Day", SbxINTEGER, 0,NULL,0 }, + { "Year", SbxINTEGER, 0,nullptr,0 }, + { "Month", SbxINTEGER, 0,nullptr,0 }, + { "Day", SbxINTEGER, 0,nullptr,0 }, { "DateValue", SbxDATE, 1 | _FUNCTION, RTLNAME(DateValue),0 }, - { "String", SbxSTRING, 0,NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, { "Day", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Day),0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, { "Ddeexecute", SbxNULL, 2 | _FUNCTION, RTLNAME(DDEExecute),0 }, - { "Channel", SbxLONG, 0,NULL,0 }, - { "Command", SbxSTRING, 0,NULL,0 }, + { "Channel", SbxLONG, 0,nullptr,0 }, + { "Command", SbxSTRING, 0,nullptr,0 }, { "Ddeinitiate", SbxINTEGER, 2 | _FUNCTION, RTLNAME(DDEInitiate),0 }, - { "Application", SbxSTRING, 0,NULL,0 }, - { "Topic", SbxSTRING, 0,NULL,0 }, + { "Application", SbxSTRING, 0,nullptr,0 }, + { "Topic", SbxSTRING, 0,nullptr,0 }, { "Ddepoke", SbxNULL, 3 | _FUNCTION, RTLNAME(DDEPoke),0 }, - { "Channel", SbxLONG, 0,NULL,0 }, - { "Item", SbxSTRING, 0,NULL,0 }, - { "Data", SbxSTRING, 0,NULL,0 }, + { "Channel", SbxLONG, 0,nullptr,0 }, + { "Item", SbxSTRING, 0,nullptr,0 }, + { "Data", SbxSTRING, 0,nullptr,0 }, { "Dderequest", SbxSTRING, 2 | _FUNCTION, RTLNAME(DDERequest),0 }, - { "Channel", SbxLONG, 0,NULL,0 }, - { "Item", SbxSTRING, 0,NULL,0 }, + { "Channel", SbxLONG, 0,nullptr,0 }, + { "Item", SbxSTRING, 0,nullptr,0 }, { "Ddeterminate", SbxNULL, 1 | _FUNCTION, RTLNAME(DDETerminate),0 }, - { "Channel", SbxLONG, 0,NULL,0 }, + { "Channel", SbxLONG, 0,nullptr,0 }, { "Ddeterminateall", SbxNULL, _FUNCTION, RTLNAME(DDETerminateAll),0 }, { "DimArray", SbxOBJECT, _FUNCTION, RTLNAME(DimArray),0 }, { "Dir", SbxSTRING, 2 | _FUNCTION, RTLNAME(Dir),0 }, - { "FileSpec", SbxSTRING, _OPT, NULL,0 }, - { "attrmask", SbxINTEGER, _OPT, NULL,0 }, + { "FileSpec", SbxSTRING, _OPT, nullptr,0 }, + { "attrmask", SbxINTEGER, _OPT, nullptr,0 }, { "DoEvents", SbxINTEGER, _FUNCTION, RTLNAME(DoEvents),0 }, { "DumpAllObjects", SbxEMPTY, 2 | _SUB, RTLNAME(DumpAllObjects),0 }, - { "FileSpec", SbxSTRING, 0,NULL,0 }, - { "DumpAll", SbxINTEGER, _OPT, NULL,0 }, + { "FileSpec", SbxSTRING, 0,nullptr,0 }, + { "DumpAll", SbxINTEGER, _OPT, nullptr,0 }, { "Empty", SbxVARIANT, _CPROP, RTLNAME(Empty),0 }, { "EqualUnoObjects",SbxBOOL, 2 | _FUNCTION, RTLNAME(EqualUnoObjects),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "EnableReschedule", SbxNULL, 1 | _FUNCTION, RTLNAME(EnableReschedule),0}, - { "bEnable", SbxBOOL, 0,NULL,0 }, + { "bEnable", SbxBOOL, 0,nullptr,0 }, { "Environ", SbxSTRING, 1 | _FUNCTION, RTLNAME(Environ),0 }, - { "Environmentstring",SbxSTRING, 0,NULL,0 }, + { "Environmentstring",SbxSTRING, 0,nullptr,0 }, { "EOF", SbxBOOL, 1 | _FUNCTION, RTLNAME(EOF),0 }, - { "Channel", SbxINTEGER, 0,NULL,0 }, + { "Channel", SbxINTEGER, 0,nullptr,0 }, { "Erl", SbxLONG, _ROPROP, RTLNAME( Erl ),0 }, { "Err", SbxVARIANT, _RWPROP, RTLNAME( Err ),0 }, { "Error", SbxSTRING, 1 | _FUNCTION, RTLNAME( Error ),0 }, - { "code", SbxLONG, 0,NULL,0 }, + { "code", SbxLONG, 0,nullptr,0 }, { "Exp", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Exp),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "False", SbxBOOL, _CPROP, RTLNAME(False),0 }, { "FileAttr", SbxINTEGER, 2 | _FUNCTION, RTLNAME(FileAttr),0 }, - { "Channel", SbxINTEGER, 0,NULL,0 }, - { "Attributes", SbxINTEGER, 0,NULL,0 }, + { "Channel", SbxINTEGER, 0,nullptr,0 }, + { "Attributes", SbxINTEGER, 0,nullptr,0 }, { "FileCopy", SbxNULL, 2 | _FUNCTION, RTLNAME(FileCopy),0 }, - { "Source", SbxSTRING, 0,NULL,0 }, - { "Destination", SbxSTRING, 0,NULL,0 }, + { "Source", SbxSTRING, 0,nullptr,0 }, + { "Destination", SbxSTRING, 0,nullptr,0 }, { "FileDateTime", SbxSTRING, 1 | _FUNCTION, RTLNAME(FileDateTime),0 }, - { "filename", SbxSTRING, 0,NULL,0 }, + { "filename", SbxSTRING, 0,nullptr,0 }, { "FileExists", SbxBOOL, 1 | _FUNCTION, RTLNAME(FileExists),0 }, - { "filename", SbxSTRING, 0,NULL,0 }, + { "filename", SbxSTRING, 0,nullptr,0 }, { "FileLen", SbxLONG, 1 | _FUNCTION, RTLNAME(FileLen),0 }, - { "filename", SbxSTRING, 0,NULL,0 }, + { "filename", SbxSTRING, 0,nullptr,0 }, { "FindObject", SbxOBJECT, 1 | _FUNCTION, RTLNAME(FindObject),0 }, - { "Name", SbxSTRING, 0,NULL,0 }, + { "Name", SbxSTRING, 0,nullptr,0 }, { "FindPropertyObject", SbxOBJECT, 2 | _FUNCTION, RTLNAME(FindPropertyObject),0 }, - { "Object", SbxOBJECT, 0,NULL,0 }, - { "Name", SbxSTRING, 0,NULL,0 }, + { "Object", SbxOBJECT, 0,nullptr,0 }, + { "Name", SbxSTRING, 0,nullptr,0 }, { "Fix", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Fix),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "Format", SbxSTRING, 2 | _FUNCTION, RTLNAME(Format),0 }, - { "expression", SbxVARIANT, 0,NULL,0 }, - { "format", SbxSTRING, _OPT, NULL,0 }, + { "expression", SbxVARIANT, 0,nullptr,0 }, + { "format", SbxSTRING, _OPT, nullptr,0 }, { "FormatDateTime", SbxSTRING, 2 | _FUNCTION | _COMPATONLY, RTLNAME(FormatDateTime),0 }, - { "Date", SbxDATE, 0,NULL,0 }, - { "NamedFormat", SbxINTEGER, _OPT, NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, + { "NamedFormat", SbxINTEGER, _OPT, nullptr,0 }, { "Frac", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Frac),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "FRAMEANCHORCHAR", SbxINTEGER, _CPROP, RTLNAME(FRAMEANCHORCHAR),0 }, { "FRAMEANCHORPAGE", SbxINTEGER, _CPROP, RTLNAME(FRAMEANCHORPAGE),0 }, { "FRAMEANCHORPARA", SbxINTEGER, _CPROP, RTLNAME(FRAMEANCHORPARA),0 }, { "FreeFile", SbxINTEGER, _FUNCTION, RTLNAME(FreeFile),0 }, { "FreeLibrary", SbxNULL, 1 | _FUNCTION, RTLNAME(FreeLibrary),0 }, - { "Modulename", SbxSTRING, 0,NULL,0 }, + { "Modulename", SbxSTRING, 0,nullptr,0 }, { "FV", SbxDOUBLE, 5 | _FUNCTION | _COMPATONLY, RTLNAME(FV),0 }, - { "Rate", SbxDOUBLE, 0, NULL,0 }, - { "NPer", SbxDOUBLE, 0, NULL,0 }, - { "Pmt", SbxDOUBLE, 0, NULL,0 }, - { "PV", SbxVARIANT, _OPT, NULL,0 }, - { "Due", SbxVARIANT, _OPT, NULL,0 }, + { "Rate", SbxDOUBLE, 0, nullptr,0 }, + { "NPer", SbxDOUBLE, 0, nullptr,0 }, + { "Pmt", SbxDOUBLE, 0, nullptr,0 }, + { "PV", SbxVARIANT, _OPT, nullptr,0 }, + { "Due", SbxVARIANT, _OPT, nullptr,0 }, { "Get", SbxNULL, 3 | _FUNCTION, RTLNAME(Get),0 }, - { "filenumber", SbxINTEGER, 0,NULL,0 }, - { "recordnumber", SbxLONG, 0,NULL,0 }, - { "variablename", SbxVARIANT, 0,NULL,0 }, + { "filenumber", SbxINTEGER, 0,nullptr,0 }, + { "recordnumber", SbxLONG, 0,nullptr,0 }, + { "variablename", SbxVARIANT, 0,nullptr,0 }, { "GetAttr", SbxINTEGER, 1 | _FUNCTION, RTLNAME(GetAttr),0 }, - { "filename", SbxSTRING, 0,NULL,0 }, + { "filename", SbxSTRING, 0,nullptr,0 }, { "GetDefaultContext", SbxOBJECT, 0 | _FUNCTION, RTLNAME(GetDefaultContext),0 }, { "GetDialogZoomFactorX", SbxDOUBLE, _FUNCTION,RTLNAME(GetDialogZoomFactorX),0 }, { "GetDialogZoomFactorY", SbxDOUBLE, _FUNCTION,RTLNAME(GetDialogZoomFactorY),0 }, @@ -311,14 +311,14 @@ static Methods aMethods[] = { { "GetSystemType", SbxINTEGER, _FUNCTION,RTLNAME(GetSystemType),0 }, { "GlobalScope", SbxOBJECT, _FUNCTION,RTLNAME(GlobalScope),0 }, { "Green", SbxINTEGER, 1 | _FUNCTION | _NORMONLY, RTLNAME(Green),0 }, - { "RGB-Value", SbxLONG, 0,NULL,0 }, + { "RGB-Value", SbxLONG, 0,nullptr,0 }, { "HasUnoInterfaces", SbxBOOL, 1 | _FUNCTION, RTLNAME(HasUnoInterfaces),0}, - { "InterfaceName",SbxSTRING, 0,NULL,0 }, + { "InterfaceName",SbxSTRING, 0,nullptr,0 }, { "Hex", SbxSTRING, 1 | _FUNCTION, RTLNAME(Hex),0 }, - { "number", SbxLONG, 0,NULL,0 }, + { "number", SbxLONG, 0,nullptr,0 }, { "Hour", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Hour),0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, { "IDABORT", SbxINTEGER, _CPROP, RTLNAME(IDABORT),0 }, { "IDCANCEL", SbxINTEGER, _CPROP, RTLNAME(IDCANCEL),0 }, @@ -328,87 +328,87 @@ static Methods aMethods[] = { { "IDYES", SbxINTEGER, _CPROP, RTLNAME(IDYES),0 }, { "Iif", SbxVARIANT, 3 | _FUNCTION, RTLNAME(Iif),0 }, - { "Bool", SbxBOOL, 0,NULL,0 }, - { "Variant1", SbxVARIANT, 0,NULL,0 }, - { "Variant2", SbxVARIANT, 0,NULL,0 }, + { "Bool", SbxBOOL, 0,nullptr,0 }, + { "Variant1", SbxVARIANT, 0,nullptr,0 }, + { "Variant2", SbxVARIANT, 0,nullptr,0 }, { "Input", SbxSTRING, 2 | _FUNCTION | _COMPATONLY, RTLNAME(Input),0}, - { "Number", SbxLONG, 0,NULL,0 }, - { "FileNumber", SbxLONG, 0,NULL,0 }, + { "Number", SbxLONG, 0,nullptr,0 }, + { "FileNumber", SbxLONG, 0,nullptr,0 }, { "InputBox", SbxSTRING, 5 | _FUNCTION, RTLNAME(InputBox),0 }, - { "Prompt", SbxSTRING, 0,NULL,0 }, - { "Title", SbxSTRING, _OPT, NULL,0 }, - { "Default", SbxSTRING, _OPT, NULL,0 }, - { "XPosTwips", SbxLONG, _OPT, NULL,0 }, - { "YPosTwips", SbxLONG, _OPT, NULL,0 }, + { "Prompt", SbxSTRING, 0,nullptr,0 }, + { "Title", SbxSTRING, _OPT, nullptr,0 }, + { "Default", SbxSTRING, _OPT, nullptr,0 }, + { "XPosTwips", SbxLONG, _OPT, nullptr,0 }, + { "YPosTwips", SbxLONG, _OPT, nullptr,0 }, { "InStr", SbxLONG, 4 | _FUNCTION, RTLNAME(InStr),0 }, - { "Start", SbxSTRING, _OPT, NULL,0 }, - { "String1", SbxSTRING, 0,NULL,0 }, - { "String2", SbxSTRING, 0,NULL,0 }, - { "Compare", SbxINTEGER, _OPT, NULL,0 }, + { "Start", SbxSTRING, _OPT, nullptr,0 }, + { "String1", SbxSTRING, 0,nullptr,0 }, + { "String2", SbxSTRING, 0,nullptr,0 }, + { "Compare", SbxINTEGER, _OPT, nullptr,0 }, { "InStrRev", SbxLONG, 4 | _FUNCTION | _COMPATONLY, RTLNAME(InStrRev),0}, - { "String1", SbxSTRING, 0,NULL,0 }, - { "String2", SbxSTRING, 0,NULL,0 }, - { "Start", SbxSTRING, _OPT, NULL,0 }, - { "Compare", SbxINTEGER, _OPT, NULL,0 }, + { "String1", SbxSTRING, 0,nullptr,0 }, + { "String2", SbxSTRING, 0,nullptr,0 }, + { "Start", SbxSTRING, _OPT, nullptr,0 }, + { "Compare", SbxINTEGER, _OPT, nullptr,0 }, { "Int", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Int),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "IPmt", SbxDOUBLE, 6 | _FUNCTION | _COMPATONLY, RTLNAME(IPmt),0 }, - { "Rate", SbxDOUBLE, 0, NULL,0 }, - { "Per", SbxDOUBLE, 0, NULL,0 }, - { "NPer", SbxDOUBLE, 0, NULL,0 }, - { "PV", SbxDOUBLE, 0, NULL,0 }, - { "FV", SbxVARIANT, _OPT, NULL,0 }, - { "Due", SbxVARIANT, _OPT, NULL,0 }, + { "Rate", SbxDOUBLE, 0, nullptr,0 }, + { "Per", SbxDOUBLE, 0, nullptr,0 }, + { "NPer", SbxDOUBLE, 0, nullptr,0 }, + { "PV", SbxDOUBLE, 0, nullptr,0 }, + { "FV", SbxVARIANT, _OPT, nullptr,0 }, + { "Due", SbxVARIANT, _OPT, nullptr,0 }, { "IRR", SbxDOUBLE, 2 | _FUNCTION | _COMPATONLY, RTLNAME(IRR),0 }, - { "ValueArray", SbxARRAY, 0, NULL,0 }, - { "Guess", SbxVARIANT, _OPT, NULL,0 }, + { "ValueArray", SbxARRAY, 0, nullptr,0 }, + { "Guess", SbxVARIANT, _OPT, nullptr,0 }, { "IsArray", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsArray),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "IsDate", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsDate),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "IsEmpty", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsEmpty),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "IsError", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsError),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "IsMissing", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsMissing),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "IsNull", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsNull),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "IsNumeric", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsNumeric),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "IsObject", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsObject),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "IsUnoStruct", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsUnoStruct),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "Join", SbxSTRING, 2 | _FUNCTION, RTLNAME(Join),0 }, - { "list", SbxOBJECT, 0,NULL,0 }, - { "delimiter", SbxSTRING, 0,NULL,0 }, + { "list", SbxOBJECT, 0,nullptr,0 }, + { "delimiter", SbxSTRING, 0,nullptr,0 }, { "Kill", SbxNULL, 1 | _FUNCTION, RTLNAME(Kill),0 }, - { "filespec", SbxSTRING, 0,NULL,0 }, + { "filespec", SbxSTRING, 0,nullptr,0 }, { "LBound", SbxLONG, 1 | _FUNCTION, RTLNAME(LBound),0 }, - { "Variant", SbxVARIANT, 0,NULL,0 }, + { "Variant", SbxVARIANT, 0,nullptr,0 }, { "LCase", SbxSTRING, 1 | _FUNCTION, RTLNAME(LCase),0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "Left", SbxSTRING, 2 | _FUNCTION, RTLNAME(Left),0 }, - { "String", SbxSTRING, 0,NULL,0 }, - { "Count", SbxLONG, 0,NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, + { "Count", SbxLONG, 0,nullptr,0 }, { "Len", SbxLONG, 1 | _FUNCTION, RTLNAME(Len),0 }, - { "StringOrVariant", SbxVARIANT, 0,NULL,0 }, + { "StringOrVariant", SbxVARIANT, 0,nullptr,0 }, { "LenB", SbxLONG, 1 | _FUNCTION, RTLNAME(Len),0 }, - { "StringOrVariant", SbxVARIANT, 0,NULL,0 }, + { "StringOrVariant", SbxVARIANT, 0,nullptr,0 }, { "Load", SbxNULL, 1 | _FUNCTION, RTLNAME(Load),0 }, - { "object", SbxOBJECT, 0,NULL,0 }, + { "object", SbxOBJECT, 0,nullptr,0 }, { "LoadPicture", SbxOBJECT, 1 | _FUNCTION, RTLNAME(LoadPicture),0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "Loc", SbxLONG, 1 | _FUNCTION, RTLNAME(Loc),0 }, - { "Channel", SbxINTEGER, 0,NULL,0 }, + { "Channel", SbxINTEGER, 0,nullptr,0 }, { "Lof", SbxLONG, 1 | _FUNCTION, RTLNAME(Lof),0 }, - { "Channel", SbxINTEGER, 0,NULL,0 }, + { "Channel", SbxINTEGER, 0,nullptr,0 }, { "Log", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Log),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "LTrim", SbxSTRING, 1 | _FUNCTION, RTLNAME(LTrim),0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "MB_ABORTRETRYIGNORE", SbxINTEGER, _CPROP, RTLNAME(MB_ABORTRETRYIGNORE),0}, { "MB_APPLMODAL", SbxINTEGER, _CPROP, RTLNAME(MB_APPLMODAL),0 }, @@ -428,199 +428,199 @@ static Methods aMethods[] = { { "Me", SbxOBJECT, 0 | _FUNCTION | _COMPATONLY, RTLNAME(Me),0 }, { "Mid", SbxSTRING, 3 | _LFUNCTION,RTLNAME(Mid),0 }, - { "String", SbxSTRING, 0,NULL,0 }, - { "StartPos", SbxLONG, 0,NULL,0 }, - { "Length", SbxLONG, _OPT, NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, + { "StartPos", SbxLONG, 0,nullptr,0 }, + { "Length", SbxLONG, _OPT, nullptr,0 }, { "Minute", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Minute),0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, { "MIRR", SbxDOUBLE, 2 | _FUNCTION | _COMPATONLY, RTLNAME(MIRR),0 }, - { "ValueArray", SbxARRAY, 0, NULL,0 }, - { "FinanceRate", SbxDOUBLE, 0, NULL,0 }, - { "ReinvestRate", SbxDOUBLE, 0, NULL,0 }, + { "ValueArray", SbxARRAY, 0, nullptr,0 }, + { "FinanceRate", SbxDOUBLE, 0, nullptr,0 }, + { "ReinvestRate", SbxDOUBLE, 0, nullptr,0 }, { "MkDir", SbxNULL, 1 | _FUNCTION, RTLNAME(MkDir),0 }, - { "pathname", SbxSTRING, 0,NULL,0 }, + { "pathname", SbxSTRING, 0,nullptr,0 }, { "Month", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Month),0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, { "MonthName", SbxSTRING, 2 | _FUNCTION | _COMPATONLY, RTLNAME(MonthName),0 }, - { "Month", SbxINTEGER, 0,NULL,0 }, - { "Abbreviate", SbxBOOL, _OPT, NULL,0 }, + { "Month", SbxINTEGER, 0,nullptr,0 }, + { "Abbreviate", SbxBOOL, _OPT, nullptr,0 }, { "MsgBox", SbxINTEGER, 5 | _FUNCTION, RTLNAME(MsgBox),0 }, - { "Prompt", SbxSTRING, 0,NULL,0 }, - { "Buttons", SbxINTEGER, _OPT, NULL,0 }, - { "Title", SbxSTRING, _OPT, NULL,0 }, - { "Helpfile", SbxSTRING, _OPT, NULL,0 }, - { "Context", SbxINTEGER, _OPT, NULL,0 }, + { "Prompt", SbxSTRING, 0,nullptr,0 }, + { "Buttons", SbxINTEGER, _OPT, nullptr,0 }, + { "Title", SbxSTRING, _OPT, nullptr,0 }, + { "Helpfile", SbxSTRING, _OPT, nullptr,0 }, + { "Context", SbxINTEGER, _OPT, nullptr,0 }, { "Nothing", SbxOBJECT, _CPROP, RTLNAME(Nothing),0 }, { "Now", SbxDATE, _FUNCTION, RTLNAME(Now),0 }, { "NPer", SbxDOUBLE, 5 | _FUNCTION | _COMPATONLY, RTLNAME(NPer),0 }, - { "Rate", SbxDOUBLE, 0, NULL,0 }, - { "Pmt", SbxDOUBLE, 0, NULL,0 }, - { "PV", SbxDOUBLE, 0, NULL,0 }, - { "FV", SbxVARIANT, _OPT, NULL,0 }, - { "Due", SbxVARIANT, _OPT, NULL,0 }, + { "Rate", SbxDOUBLE, 0, nullptr,0 }, + { "Pmt", SbxDOUBLE, 0, nullptr,0 }, + { "PV", SbxDOUBLE, 0, nullptr,0 }, + { "FV", SbxVARIANT, _OPT, nullptr,0 }, + { "Due", SbxVARIANT, _OPT, nullptr,0 }, { "NPV", SbxDOUBLE, 2 | _FUNCTION | _COMPATONLY, RTLNAME(NPV),0 }, - { "Rate", SbxDOUBLE, 0, NULL,0 }, - { "ValueArray", SbxARRAY, 0, NULL,0 }, + { "Rate", SbxDOUBLE, 0, nullptr,0 }, + { "ValueArray", SbxARRAY, 0, nullptr,0 }, { "Null", SbxNULL, _CPROP, RTLNAME(Null),0 }, { "Oct", SbxSTRING, 1 | _FUNCTION, RTLNAME(Oct),0 }, - { "number", SbxLONG, 0,NULL,0 }, + { "number", SbxLONG, 0,nullptr,0 }, { "Partition", SbxSTRING, 4 | _FUNCTION, RTLNAME(Partition),0 }, - { "number", SbxLONG, 0,NULL,0 }, - { "start", SbxLONG, 0,NULL,0 }, - { "stop", SbxLONG, 0,NULL,0 }, - { "interval", SbxLONG, 0,NULL,0 }, + { "number", SbxLONG, 0,nullptr,0 }, + { "start", SbxLONG, 0,nullptr,0 }, + { "stop", SbxLONG, 0,nullptr,0 }, + { "interval", SbxLONG, 0,nullptr,0 }, { "Pi", SbxDOUBLE, _CPROP, RTLNAME(PI),0 }, { "Pmt", SbxDOUBLE, 5 | _FUNCTION | _COMPATONLY, RTLNAME(Pmt),0 }, - { "Rate", SbxDOUBLE, 0, NULL,0 }, - { "NPer", SbxDOUBLE, 0, NULL,0 }, - { "PV", SbxDOUBLE, 0, NULL,0 }, - { "FV", SbxVARIANT, _OPT, NULL,0 }, - { "Due", SbxVARIANT, _OPT, NULL,0 }, + { "Rate", SbxDOUBLE, 0, nullptr,0 }, + { "NPer", SbxDOUBLE, 0, nullptr,0 }, + { "PV", SbxDOUBLE, 0, nullptr,0 }, + { "FV", SbxVARIANT, _OPT, nullptr,0 }, + { "Due", SbxVARIANT, _OPT, nullptr,0 }, { "PPmt", SbxDOUBLE, 6 | _FUNCTION | _COMPATONLY, RTLNAME(PPmt),0 }, - { "Rate", SbxDOUBLE, 0, NULL,0 }, - { "Per", SbxDOUBLE, 0, NULL,0 }, - { "NPer", SbxDOUBLE, 0, NULL,0 }, - { "PV", SbxDOUBLE, 0, NULL,0 }, - { "FV", SbxVARIANT, _OPT, NULL,0 }, - { "Due", SbxVARIANT, _OPT, NULL,0 }, + { "Rate", SbxDOUBLE, 0, nullptr,0 }, + { "Per", SbxDOUBLE, 0, nullptr,0 }, + { "NPer", SbxDOUBLE, 0, nullptr,0 }, + { "PV", SbxDOUBLE, 0, nullptr,0 }, + { "FV", SbxVARIANT, _OPT, nullptr,0 }, + { "Due", SbxVARIANT, _OPT, nullptr,0 }, { "Put", SbxNULL, 3 | _FUNCTION, RTLNAME(Put),0 }, - { "filenumber", SbxINTEGER, 0,NULL,0 }, - { "recordnumber", SbxLONG, 0,NULL,0 }, - { "variablename", SbxVARIANT, 0,NULL,0 }, + { "filenumber", SbxINTEGER, 0,nullptr,0 }, + { "recordnumber", SbxLONG, 0,nullptr,0 }, + { "variablename", SbxVARIANT, 0,nullptr,0 }, { "PV", SbxDOUBLE, 5 | _FUNCTION | _COMPATONLY, RTLNAME(PV),0 }, - { "Rate", SbxDOUBLE, 0, NULL,0 }, - { "NPer", SbxDOUBLE, 0, NULL,0 }, - { "Pmt", SbxDOUBLE, 0, NULL,0 }, - { "FV", SbxVARIANT, _OPT, NULL,0 }, - { "Due", SbxVARIANT, _OPT, NULL,0 }, + { "Rate", SbxDOUBLE, 0, nullptr,0 }, + { "NPer", SbxDOUBLE, 0, nullptr,0 }, + { "Pmt", SbxDOUBLE, 0, nullptr,0 }, + { "FV", SbxVARIANT, _OPT, nullptr,0 }, + { "Due", SbxVARIANT, _OPT, nullptr,0 }, { "QBColor", SbxLONG, 1 | _FUNCTION, RTLNAME(QBColor),0 }, - { "number", SbxINTEGER, 0,NULL,0 }, + { "number", SbxINTEGER, 0,nullptr,0 }, { "Randomize", SbxNULL, 1 | _FUNCTION, RTLNAME(Randomize),0 }, - { "Number", SbxDOUBLE, _OPT, NULL,0 }, + { "Number", SbxDOUBLE, _OPT, nullptr,0 }, { "Rate", SbxDOUBLE, 6 | _FUNCTION | _COMPATONLY, RTLNAME(Rate),0 }, - { "NPer", SbxDOUBLE, 0, NULL,0 }, - { "Pmt", SbxDOUBLE, 0, NULL,0 }, - { "PV", SbxDOUBLE, 0, NULL,0 }, - { "FV", SbxVARIANT, _OPT, NULL,0 }, - { "Due", SbxVARIANT, _OPT, NULL,0 }, - { "Guess", SbxVARIANT, _OPT, NULL,0 }, + { "NPer", SbxDOUBLE, 0, nullptr,0 }, + { "Pmt", SbxDOUBLE, 0, nullptr,0 }, + { "PV", SbxDOUBLE, 0, nullptr,0 }, + { "FV", SbxVARIANT, _OPT, nullptr,0 }, + { "Due", SbxVARIANT, _OPT, nullptr,0 }, + { "Guess", SbxVARIANT, _OPT, nullptr,0 }, { "Red", SbxINTEGER, 1 | _FUNCTION | _NORMONLY, RTLNAME(Red),0 }, - { "RGB-Value", SbxLONG, 0,NULL,0 }, + { "RGB-Value", SbxLONG, 0,nullptr,0 }, { "Reset", SbxNULL, 0 | _FUNCTION, RTLNAME(Reset),0 }, { "ResolvePath", SbxSTRING, 1 | _FUNCTION, RTLNAME(ResolvePath),0 }, - { "Path", SbxSTRING, 0,NULL,0 }, + { "Path", SbxSTRING, 0,nullptr,0 }, { "RGB", SbxLONG, 3 | _FUNCTION, RTLNAME(RGB),0 }, - { "Red", SbxINTEGER, 0,NULL,0 }, - { "Green", SbxINTEGER, 0,NULL,0 }, - { "Blue", SbxINTEGER, 0,NULL,0 }, + { "Red", SbxINTEGER, 0,nullptr,0 }, + { "Green", SbxINTEGER, 0,nullptr,0 }, + { "Blue", SbxINTEGER, 0,nullptr,0 }, { "Replace", SbxSTRING, 6 | _FUNCTION, RTLNAME(Replace),0 }, - { "Expression", SbxSTRING, 0,NULL,0 }, - { "Find", SbxSTRING, 0,NULL,0 }, - { "Replace", SbxSTRING, 0,NULL,0 }, - { "Start", SbxINTEGER, _OPT, NULL,0 }, - { "Count", SbxINTEGER, _OPT, NULL,0 }, - { "Compare", SbxINTEGER, _OPT, NULL,0 }, + { "Expression", SbxSTRING, 0,nullptr,0 }, + { "Find", SbxSTRING, 0,nullptr,0 }, + { "Replace", SbxSTRING, 0,nullptr,0 }, + { "Start", SbxINTEGER, _OPT, nullptr,0 }, + { "Count", SbxINTEGER, _OPT, nullptr,0 }, + { "Compare", SbxINTEGER, _OPT, nullptr,0 }, { "Right", SbxSTRING, 2 | _FUNCTION, RTLNAME(Right),0 }, - { "String", SbxSTRING, 0,NULL,0 }, - { "Count", SbxLONG, 0,NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, + { "Count", SbxLONG, 0,nullptr,0 }, { "RmDir", SbxNULL, 1 | _FUNCTION, RTLNAME(RmDir),0 }, - { "pathname", SbxSTRING, 0,NULL,0 }, + { "pathname", SbxSTRING, 0,nullptr,0 }, { "Round", SbxDOUBLE, 2 | _FUNCTION | _COMPATONLY, RTLNAME(Round),0}, - { "Expression", SbxDOUBLE, 0,NULL,0 }, - { "Numdecimalplaces", SbxINTEGER, _OPT, NULL,0 }, + { "Expression", SbxDOUBLE, 0,nullptr,0 }, + { "Numdecimalplaces", SbxINTEGER, _OPT, nullptr,0 }, { "Rnd", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Rnd),0 }, - { "Number", SbxDOUBLE, _OPT, NULL,0 }, + { "Number", SbxDOUBLE, _OPT, nullptr,0 }, { "RTL", SbxOBJECT, 0 | _FUNCTION | _COMPATONLY, RTLNAME(RTL),0}, { "RTrim", SbxSTRING, 1 | _FUNCTION, RTLNAME(RTrim),0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "SavePicture", SbxNULL, 2 | _FUNCTION, RTLNAME(SavePicture),0 }, - { "object", SbxOBJECT, 0,NULL,0 }, - { "string", SbxSTRING, 0,NULL,0 }, + { "object", SbxOBJECT, 0,nullptr,0 }, + { "string", SbxSTRING, 0,nullptr,0 }, { "Second", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Second),0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, { "Seek", SbxLONG, 1 | _FUNCTION, RTLNAME(Seek),0 }, - { "Channel", SbxINTEGER, 0,NULL,0 }, + { "Channel", SbxINTEGER, 0,nullptr,0 }, { "SendKeys", SbxNULL, 2 | _FUNCTION, RTLNAME(SendKeys),0 }, - { "String", SbxSTRING, 0,NULL,0 }, - { "Wait", SbxBOOL, _OPT, NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, + { "Wait", SbxBOOL, _OPT, nullptr,0 }, { "SetAttr", SbxNULL, 2 | _FUNCTION, RTLNAME(SetAttr),0 }, - { "File" , SbxSTRING, 0,NULL,0 }, - { "Attributes", SbxINTEGER, 0,NULL,0 }, + { "File" , SbxSTRING, 0,nullptr,0 }, + { "Attributes", SbxINTEGER, 0,nullptr,0 }, { "SET_OFF", SbxINTEGER, _CPROP, RTLNAME(SET_OFF),0 }, { "SET_ON", SbxINTEGER, _CPROP, RTLNAME(SET_ON),0 }, { "SET_TAB", SbxINTEGER, _CPROP, RTLNAME(SET_TAB),0 }, { "Sgn", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Sgn),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "Shell", SbxLONG, 2 | _FUNCTION, RTLNAME(Shell),0 }, - { "Commandstring",SbxSTRING, 0,NULL,0 }, - { "WindowStyle", SbxINTEGER, _OPT, NULL,0 }, + { "Commandstring",SbxSTRING, 0,nullptr,0 }, + { "WindowStyle", SbxINTEGER, _OPT, nullptr,0 }, { "Sin", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Sin),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "SLN", SbxDOUBLE, 2 | _FUNCTION | _COMPATONLY, RTLNAME(SLN),0 }, - { "Cost", SbxDOUBLE, 0,NULL,0 }, - { "Double", SbxDOUBLE, 0,NULL,0 }, - { "Life", SbxDOUBLE, 0,NULL,0 }, + { "Cost", SbxDOUBLE, 0,nullptr,0 }, + { "Double", SbxDOUBLE, 0,nullptr,0 }, + { "Life", SbxDOUBLE, 0,nullptr,0 }, { "SYD", SbxDOUBLE, 2 | _FUNCTION | _COMPATONLY, RTLNAME(SYD),0 }, - { "Cost", SbxDOUBLE, 0,NULL,0 }, - { "Salvage", SbxDOUBLE, 0,NULL,0 }, - { "Life", SbxDOUBLE, 0,NULL,0 }, - { "Period", SbxDOUBLE, 0,NULL,0 }, + { "Cost", SbxDOUBLE, 0,nullptr,0 }, + { "Salvage", SbxDOUBLE, 0,nullptr,0 }, + { "Life", SbxDOUBLE, 0,nullptr,0 }, + { "Period", SbxDOUBLE, 0,nullptr,0 }, { "Space", SbxSTRING, 1 | _FUNCTION, RTLNAME(Space),0 }, - { "string", SbxLONG, 0,NULL,0 }, + { "string", SbxLONG, 0,nullptr,0 }, { "Spc", SbxSTRING, 1 | _FUNCTION, RTLNAME(Spc),0 }, - { "Count", SbxLONG, 0,NULL,0 }, + { "Count", SbxLONG, 0,nullptr,0 }, { "Split", SbxOBJECT, 3 | _FUNCTION, RTLNAME(Split),0 }, - { "expression", SbxSTRING, 0,NULL,0 }, - { "delimiter", SbxSTRING, 0,NULL,0 }, - { "count", SbxLONG, 0,NULL,0 }, + { "expression", SbxSTRING, 0,nullptr,0 }, + { "delimiter", SbxSTRING, 0,nullptr,0 }, + { "count", SbxLONG, 0,nullptr,0 }, { "Sqr", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Sqr),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "Str", SbxSTRING, 1 | _FUNCTION, RTLNAME(Str),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "StrComp", SbxINTEGER, 3 | _FUNCTION, RTLNAME(StrComp),0 }, - { "String1", SbxSTRING, 0,NULL,0 }, - { "String2", SbxSTRING, 0,NULL,0 }, - { "Compare", SbxINTEGER, _OPT, NULL,0 }, + { "String1", SbxSTRING, 0,nullptr,0 }, + { "String2", SbxSTRING, 0,nullptr,0 }, + { "Compare", SbxINTEGER, _OPT, nullptr,0 }, { "StrConv", SbxOBJECT, 3 | _FUNCTION, RTLNAME(StrConv),0 }, - { "String", SbxSTRING, 0,NULL,0 }, - { "Conversion", SbxSTRING, 0,NULL,0 }, - { "LCID", SbxINTEGER, _OPT,NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, + { "Conversion", SbxSTRING, 0,nullptr,0 }, + { "LCID", SbxINTEGER, _OPT,nullptr,0 }, { "String", SbxSTRING, 2 | _FUNCTION, RTLNAME(String),0 }, - { "Count", SbxLONG, 0,NULL,0 }, - { "Filler", SbxVARIANT, 0,NULL,0 }, + { "Count", SbxLONG, 0,nullptr,0 }, + { "Filler", SbxVARIANT, 0,nullptr,0 }, { "StrReverse", SbxSTRING, 1 | _FUNCTION | _COMPATONLY, RTLNAME(StrReverse),0 }, - { "String1", SbxSTRING, 0,NULL,0 }, + { "String1", SbxSTRING, 0,nullptr,0 }, { "Switch", SbxVARIANT, 2 | _FUNCTION, RTLNAME(Switch),0 }, - { "Expression", SbxVARIANT, 0,NULL,0 }, - { "Value", SbxVARIANT, 0,NULL,0 }, + { "Expression", SbxVARIANT, 0,nullptr,0 }, + { "Value", SbxVARIANT, 0,nullptr,0 }, { "Tan", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Tan),0 }, - { "number", SbxDOUBLE, 0,NULL,0 }, + { "number", SbxDOUBLE, 0,nullptr,0 }, { "Time", SbxVARIANT, _LFUNCTION,RTLNAME(Time),0 }, { "Timer", SbxDATE, _FUNCTION, RTLNAME(Timer),0 }, { "TimeSerial", SbxDATE, 3 | _FUNCTION, RTLNAME(TimeSerial),0 }, - { "Hour", SbxLONG, 0,NULL,0 }, - { "Minute", SbxLONG, 0,NULL,0 }, - { "Second", SbxLONG, 0,NULL,0 }, + { "Hour", SbxLONG, 0,nullptr,0 }, + { "Minute", SbxLONG, 0,nullptr,0 }, + { "Second", SbxLONG, 0,nullptr,0 }, { "TimeValue", SbxDATE, 1 | _FUNCTION, RTLNAME(TimeValue),0 }, - { "String", SbxSTRING, 0,NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, { "TOGGLE", SbxINTEGER, _CPROP, RTLNAME(TOGGLE),0 }, #ifdef DBG_TRACE_BASIC { "TraceCommand", SbxNULL, 1 | _FUNCTION, RTLNAME(TraceCommand),0 }, { "Command", SbxSTRING, 0,NULL,0 }, #endif { "Trim", SbxSTRING, 1 | _FUNCTION, RTLNAME(Trim),0 }, - { "String", SbxSTRING, 0,NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, { "True", SbxBOOL, _CPROP, RTLNAME(True),0 }, { "TwipsPerPixelX", SbxLONG, _FUNCTION, RTLNAME(TwipsPerPixelX),0 }, { "TwipsPerPixelY", SbxLONG, _FUNCTION, RTLNAME(TwipsPerPixelY),0 }, @@ -666,21 +666,21 @@ static Methods aMethods[] = { { "TYP_USRINPFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_USRINPFLD),0 }, { "TypeLen", SbxINTEGER, 1 | _FUNCTION, RTLNAME(TypeLen),0 }, - { "Var", SbxVARIANT, 0,NULL,0 }, + { "Var", SbxVARIANT, 0,nullptr,0 }, { "TypeName", SbxSTRING, 1 | _FUNCTION, RTLNAME(TypeName),0 }, - { "Var", SbxVARIANT, 0,NULL,0 }, + { "Var", SbxVARIANT, 0,nullptr,0 }, { "UBound", SbxLONG, 1 | _FUNCTION, RTLNAME(UBound),0 }, - { "Var", SbxVARIANT, 0,NULL,0 }, + { "Var", SbxVARIANT, 0,nullptr,0 }, { "UCase", SbxSTRING, 1 | _FUNCTION, RTLNAME(UCase),0 }, - { "String", SbxSTRING, 0,NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, { "Unload", SbxNULL, 1 | _FUNCTION, RTLNAME(Unload),0 }, - { "Dialog", SbxOBJECT, 0,NULL,0 }, + { "Dialog", SbxOBJECT, 0,nullptr,0 }, { "Val", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Val),0 }, - { "String", SbxSTRING, 0,NULL,0 }, + { "String", SbxSTRING, 0,nullptr,0 }, { "VarType", SbxINTEGER, 1 | _FUNCTION, RTLNAME(VarType),0 }, - { "Var", SbxVARIANT, 0,NULL,0 }, + { "Var", SbxVARIANT, 0,nullptr,0 }, { "V_EMPTY", SbxINTEGER, _CPROP, RTLNAME(V_EMPTY),0 }, { "V_NULL", SbxINTEGER, _CPROP, RTLNAME(V_NULL),0 }, { "V_INTEGER", SbxINTEGER, _CPROP, RTLNAME(V_INTEGER),0 }, @@ -692,22 +692,22 @@ static Methods aMethods[] = { { "V_STRING", SbxINTEGER, _CPROP, RTLNAME(V_STRING),0 }, { "Wait", SbxNULL, 1 | _FUNCTION, RTLNAME(Wait),0 }, - { "Milliseconds", SbxLONG, 0,NULL,0 }, + { "Milliseconds", SbxLONG, 0,nullptr,0 }, { "FuncCaller", SbxVARIANT, _FUNCTION, RTLNAME(FuncCaller),0 }, //#i64882# { "WaitUntil", SbxNULL, 1 | _FUNCTION, RTLNAME(WaitUntil),0 }, - { "Date", SbxDOUBLE, 0,NULL,0 }, + { "Date", SbxDOUBLE, 0,nullptr,0 }, { "Weekday", SbxINTEGER, 2 | _FUNCTION, RTLNAME(Weekday),0 }, - { "Date", SbxDATE, 0,NULL,0 }, - { "Firstdayofweek", SbxINTEGER, _OPT, NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, + { "Firstdayofweek", SbxINTEGER, _OPT, nullptr,0 }, { "WeekdayName", SbxSTRING, 3 | _FUNCTION | _COMPATONLY, RTLNAME(WeekdayName),0 }, - { "Weekday", SbxINTEGER, 0,NULL,0 }, - { "Abbreviate", SbxBOOL, _OPT, NULL,0 }, - { "Firstdayofweek", SbxINTEGER, _OPT, NULL,0 }, + { "Weekday", SbxINTEGER, 0,nullptr,0 }, + { "Abbreviate", SbxBOOL, _OPT, nullptr,0 }, + { "Firstdayofweek", SbxINTEGER, _OPT, nullptr,0 }, { "Year", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Year),0 }, - { "Date", SbxDATE, 0,NULL,0 }, + { "Date", SbxDATE, 0,nullptr,0 }, -{ NULL, SbxNULL, -1,NULL,0 }}; // end of the table +{ nullptr, SbxNULL, -1,nullptr,0 }}; // end of the table SbiStdObject::SbiStdObject( const OUString& r, StarBASIC* pb ) : SbxObject( r ) { @@ -859,7 +859,7 @@ void SbiStdObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SbxInfo* SbiStdObject::GetInfo( short nIdx ) { if( !nIdx ) - return NULL; + return nullptr; Methods* p = &aMethods[ --nIdx ]; SbxInfo* pInfo_ = new SbxInfo; short nPar = p->nArgs & _ARGSMASK; diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx index a621331c85e5..17c508ef98a2 100644 --- a/basic/source/runtime/stdobj1.cxx +++ b/basic/source/runtime/stdobj1.cxx @@ -52,7 +52,7 @@ SbxObject* SbStdFactory::CreateObject( const OUString& rClassName ) else if( rClassName.equalsIgnoreAsciiCase("Font") ) return new SbStdFont; else - return NULL; + return nullptr; } diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index 3bf2a8d26279..e4c815a0b5d6 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -167,7 +167,7 @@ SbxVariable* SbxArray::Get32( sal_uInt32 nIdx ) if( !CanRead() ) { SetError( ERRCODE_SBX_PROP_WRITEONLY ); - return NULL; + return nullptr; } SbxVariableRef& rRef = GetRef32( nIdx ); @@ -182,7 +182,7 @@ SbxVariable* SbxArray::Get( sal_uInt16 nIdx ) if( !CanRead() ) { SetError( ERRCODE_SBX_PROP_WRITEONLY ); - return NULL; + return nullptr; } SbxVariableRef& rRef = GetRef( nIdx ); @@ -388,7 +388,7 @@ void SbxArray::Merge( SbxArray* p ) SbxVariable* SbxArray::FindUserData( sal_uInt32 nData ) { - SbxVariable* p = NULL; + SbxVariable* p = nullptr; for (size_t i = 0; i < mpVarEntries->size(); ++i) { SbxVarEntry* pEntry = (*mpVarEntries)[i]; @@ -439,10 +439,10 @@ SbxVariable* SbxArray::FindUserData( sal_uInt32 nData ) SbxVariable* SbxArray::Find( const OUString& rName, SbxClassType t ) { - SbxVariable* p = NULL; + SbxVariable* p = nullptr; sal_uInt32 nCount = mpVarEntries->size(); if( !nCount ) - return NULL; + return nullptr; bool bExtSearch = IsSet( SbxFlagBits::ExtSearch ); sal_uInt16 nHash = SbxVariable::MakeHashCode( rName ); for( sal_uInt32 i = 0; i < nCount; i++ ) diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index 80b56c3eebf3..8689b5b379ff 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -34,7 +34,7 @@ TYPEINIT0(SbxBase) SbxAppData::SbxAppData() : eSbxError(ERRCODE_SBX_OK) - , pBasicFormater(0) + , pBasicFormater(nullptr) , eBasicFormaterLangType(LANGUAGE_DONTKNOW) { } @@ -174,7 +174,7 @@ SbxBase* SbxBase::Create( sal_uInt16 nSbxId, sal_uInt32 nCreator ) } // Unknown type: go over the factories! SbxAppData& r = GetSbxData_Impl(); - SbxBase* pNew = NULL; + SbxBase* pNew = nullptr; for (auto const& rpFac : r.m_Factories) { pNew = rpFac->Create( nSbxId, nCreator ); @@ -188,7 +188,7 @@ SbxBase* SbxBase::Create( sal_uInt16 nSbxId, sal_uInt32 nCreator ) SbxObject* SbxBase::CreateObject( const OUString& rClass ) { SbxAppData& r = GetSbxData_Impl(); - SbxObject* pNew = NULL; + SbxObject* pNew = nullptr; for (auto const& rpFac : r.m_Factories) { pNew = rpFac->CreateObject( rClass ); @@ -227,7 +227,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm ) { // Deleting of the object SbxBaseRef aRef( p ); - p = NULL; + p = nullptr; } } else @@ -235,7 +235,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm ) rStrm.SetError( SVSTREAM_FILEFORMAT_ERROR ); // Deleting of the object SbxBaseRef aRef( p ); - p = NULL; + p = nullptr; } } else @@ -314,12 +314,12 @@ SbxFactory::~SbxFactory() SbxBase* SbxFactory::Create( sal_uInt16, sal_uInt32 ) { - return NULL; + return nullptr; } SbxObject* SbxFactory::CreateObject( const OUString& ) { - return NULL; + return nullptr; } ///////////////////////////////// SbxInfo @@ -335,7 +335,7 @@ void SbxInfo::AddParam(const OUString& rName, SbxDataType eType, SbxFlagBits nFl const SbxParamInfo* SbxInfo::GetParam( sal_uInt16 n ) const { if (n < 1 || n > m_Params.size()) - return NULL; + return nullptr; else return m_Params[n - 1].get(); } diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx index 0879b8e8caa8..adaf634c25e8 100644 --- a/basic/source/sbx/sbxbyte.cxx +++ b/basic/source/sbx/sbxbyte.cxx @@ -158,7 +158,7 @@ start: { double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else if( d > SbxMAXBYTE ) { diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx index 5795f43b75a7..52bd101178fb 100644 --- a/basic/source/sbx/sbxchar.cxx +++ b/basic/source/sbx/sbxchar.cxx @@ -144,7 +144,7 @@ start: { double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else if( d > SbxMAXCHAR ) { diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index f02df28b2708..8918123e0e58 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -93,7 +93,7 @@ SbxVariable* SbxCollection::FindUserData( sal_uInt32 nData ) if( GetParameters() ) { SbxObject* pObj = static_cast(GetObject()); - return pObj ? pObj->FindUserData( nData ) : NULL; + return pObj ? pObj->FindUserData( nData ) : nullptr; } else { @@ -106,7 +106,7 @@ SbxVariable* SbxCollection::Find( const OUString& rName, SbxClassType t ) if( GetParameters() ) { SbxObject* pObj = static_cast(GetObject()); - return pObj ? pObj->Find( rName, t ) : NULL; + return pObj ? pObj->Find( rName, t ) : nullptr; } else { @@ -172,7 +172,7 @@ void SbxCollection::CollAdd( SbxArray* pPar_ ) else { SbxBase* pObj = pPar_->Get( 1 )->GetObject(); - if( !pObj || !( 0 != dynamic_cast( pObj) ) ) + if( !pObj || !( nullptr != dynamic_cast( pObj) ) ) { SetError( ERRCODE_SBX_NOTIMP ); } @@ -193,7 +193,7 @@ void SbxCollection::CollItem( SbxArray* pPar_ ) } else { - SbxVariable* pRes = NULL; + SbxVariable* pRes = nullptr; SbxVariable* p = pPar_->Get( 1 ); if( p->GetType() == SbxSTRING ) { diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx index b76f8ba4386d..6070a19ade8d 100644 --- a/basic/source/sbx/sbxcurr.cxx +++ b/basic/source/sbx/sbxcurr.cxx @@ -184,7 +184,7 @@ static sal_Int64 ImpStringToCurrency( const OUString &rStr ) nFractDigit--; } // Consume trailing content - if ( p != NULL ) + if ( p != nullptr ) { // Round up if necessary if( *p >= '5' && *p <= '9' ) diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx index 16281f7a6eb5..c0997d03dc2b 100644 --- a/basic/source/sbx/sbxdbl.cxx +++ b/basic/source/sbx/sbxdbl.cxx @@ -80,7 +80,7 @@ double ImpGetDouble( const SbxValues* p ) { double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) { nRes = 0; #if HAVE_FEATURE_SCRIPTING diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx index 452832d3ddd8..4a9cd12a91a5 100644 --- a/basic/source/sbx/sbxdec.cxx +++ b/basic/source/sbx/sbxdec.cxx @@ -83,7 +83,7 @@ void releaseDecimalPtr( SbxDecimal*& rpDecimal ) if( rpDecimal->mnRefCount == 0 ) { delete rpDecimal; - rpDecimal = NULL; + rpDecimal = nullptr; } } } @@ -393,10 +393,10 @@ bool SbxDecimal::getString( OUString& rString ) SbxDecimal* ImpCreateDecimal( SbxValues* p ) { if( !p ) - return NULL; + return nullptr; SbxDecimal*& rpDecimal = p->pDecimal; - if( rpDecimal == NULL ) + if( rpDecimal == nullptr ) { rpDecimal = new SbxDecimal(); rpDecimal->addRef(); diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index 9c64095768f4..01f60db422b9 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -146,7 +146,7 @@ static SbxVariable* Operand // This is perhaps an error if( !*p ) { - return NULL; + return nullptr; } // Double quotes are OK if( *p == '"' ) @@ -261,7 +261,7 @@ static SbxVariable* Assign( SbxObject* pObj, SbxObject* pGbl, const sal_Unicode* SbxVariable* pVar = refVar; SbxVariable* pVar2 = refVar2; *pVar = *pVar2; - pVar->SetParameters( NULL ); + pVar->SetParameters( nullptr ); } } } @@ -297,7 +297,7 @@ static SbxVariable* Element pObj->SetFlags( nOld ); if( refVar.Is() ) { - refVar->SetParameters( NULL ); + refVar->SetParameters( nullptr ); // Follow still parameter? p = SkipWhitespace( p ); if( *p == '(' ) @@ -347,7 +347,7 @@ static SbxVariable* Element SbxVariable* SbxObject::Execute( const OUString& rTxt ) { - SbxVariable* pVar = NULL; + SbxVariable* pVar = nullptr; const sal_Unicode* p = rTxt.getStr(); for( ;; ) { @@ -376,12 +376,12 @@ SbxVariable* SbxObject::Execute( const OUString& rTxt ) SbxVariable* SbxObject::FindQualified( const OUString& rName, SbxClassType t ) { - SbxVariable* pVar = NULL; + SbxVariable* pVar = nullptr; const sal_Unicode* p = rName.getStr(); p = SkipWhitespace( p ); if( !*p ) { - return NULL;; + return nullptr;; } pVar = QualifiedName( this, this, &p, t ); p = SkipWhitespace( p ); diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx index 142e36534811..60eccdc0559f 100644 --- a/basic/source/sbx/sbxint.cxx +++ b/basic/source/sbx/sbxint.cxx @@ -156,7 +156,7 @@ start: { double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else if( d > SbxMAXINT ) { @@ -441,7 +441,7 @@ start: // Check if really 0 or invalid conversion double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else nRes = (sal_Int64) d; @@ -702,7 +702,7 @@ start: // Check if really 0 or invalid conversion double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else if( d > SbxMAXSALUINT64 ) { diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx index d176c2111dae..94c6f43b7360 100644 --- a/basic/source/sbx/sbxlng.cxx +++ b/basic/source/sbx/sbxlng.cxx @@ -115,7 +115,7 @@ start: { double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else if( d > SbxMAXLNG ) { diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index f6babf55b951..c198c7a19b4a 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -94,7 +94,7 @@ static void CheckParentsOnDelete( SbxObject* pObj, SbxArray* p ) // does the element have more than one reference and still a Listener? if( rRef->GetRefCount() > 1 ) { - rRef->SetParent( NULL ); + rRef->SetParent( nullptr ); DBG_ASSERT( !rRef->IsBroadcaster() || rRef->GetBroadcaster().GetListenerCount(), "Object element with dangling parent" ); } } @@ -131,7 +131,7 @@ void SbxObject::Clear() p = Make( pParentProp, SbxCLASS_PROPERTY, SbxOBJECT ); p->ResetFlag( SbxFlagBits::Write ); p->SetFlag( SbxFlagBits::DontStore ); - pDfltProp = NULL; + pDfltProp = nullptr; SetModified( false ); } @@ -223,7 +223,7 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t ) ++nLvl; #endif - SbxVariable* pRes = NULL; + SbxVariable* pRes = nullptr; pObjs->SetFlag( SbxFlagBits::ExtSearch ); if( t == SbxCLASS_DONTCARE ) { @@ -239,7 +239,7 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t ) } else { - SbxArray* pArray = NULL; + SbxArray* pArray = nullptr; switch( t ) { case SbxCLASS_VARIABLE: @@ -292,7 +292,7 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t ) bool SbxObject::Call( const OUString& rName, SbxArray* pParam ) { SbxVariable* pMeth = FindQualified( rName, SbxCLASS_DONTCARE); - if( pMeth && 0 != dynamic_cast( pMeth) ) + if( pMeth && nullptr != dynamic_cast( pMeth) ) { // FindQualified() might have struck already! if( pParam ) @@ -300,7 +300,7 @@ bool SbxObject::Call( const OUString& rName, SbxArray* pParam ) pMeth->SetParameters( pParam ); } pMeth->Broadcast( SBX_HINT_DATAWANTED ); - pMeth->SetParameters( NULL ); + pMeth->SetParameters( nullptr ); return true; } SetError( ERRCODE_SBX_NO_METHOD ); @@ -323,7 +323,7 @@ void SbxObject::SetDfltProperty( const OUString& rName ) { if ( rName != aDfltPropName ) { - pDfltProp = NULL; + pDfltProp = nullptr; } aDfltPropName = rName; SetModified( true ); @@ -335,7 +335,7 @@ void SbxObject::SetDfltProperty( const OUString& rName ) SbxArray* SbxObject::FindVar( SbxVariable* pVar, sal_uInt16& nArrayIdx ) { - SbxArray* pArray = NULL; + SbxArray* pArray = nullptr; if( pVar ) switch( pVar->GetClass() ) { case SbxCLASS_VARIABLE: @@ -371,7 +371,7 @@ SbxArray* SbxObject::FindVar( SbxVariable* pVar, sal_uInt16& nArrayIdx ) SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataType dt, bool bIsRuntimeFunction ) { // Is the object already available? - SbxArray* pArray = NULL; + SbxArray* pArray = nullptr; switch( ct ) { case SbxCLASS_VARIABLE: @@ -382,10 +382,10 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp } if( !pArray ) { - return NULL; + return nullptr; } // Collections may contain objects of the same name - if( !( ct == SbxCLASS_OBJECT && 0 != dynamic_cast( this ) ) ) + if( !( ct == SbxCLASS_OBJECT && nullptr != dynamic_cast( this ) ) ) { SbxVariable* pRes = pArray->Find( rName, ct ); if( pRes ) @@ -393,7 +393,7 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp return pRes; } } - SbxVariable* pVar = NULL; + SbxVariable* pVar = nullptr; switch( ct ) { case SbxCLASS_VARIABLE: @@ -429,7 +429,7 @@ void SbxObject::Insert( SbxVariable* pVar ) { // Then this element exists already // There are objects of the same name allowed at collections - if( pArray == pObjs && 0 != dynamic_cast( this ) ) + if( pArray == pObjs && nullptr != dynamic_cast( this ) ) { nIdx = pArray->Count(); } @@ -482,7 +482,7 @@ void SbxObject::Insert( SbxVariable* pVar ) // double entry and without broadcasts, will only be used in SO2/auto.cxx void SbxObject::QuickInsert( SbxVariable* pVar ) { - SbxArray* pArray = NULL; + SbxArray* pArray = nullptr; if( pVar ) { switch( pVar->GetClass() ) @@ -550,12 +550,12 @@ void SbxObject::Remove( SbxVariable* pVar ) } if( static_cast(pVar_) == pDfltProp ) { - pDfltProp = NULL; + pDfltProp = nullptr; } pArray->Remove( nIdx ); if( pVar_->GetParent() == this ) { - pVar_->SetParent( NULL ); + pVar_->SetParent( nullptr ); } SetModified( true ); Broadcast( SBX_HINT_OBJECTCHANGED ); @@ -593,7 +593,7 @@ bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { return true; } - pDfltProp = NULL; + pDfltProp = nullptr; if( !SbxVariable::LoadData( rStrm, nVer ) ) { return false; diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 2d8daf7a042a..bc3d2cabd8bf 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -565,7 +565,7 @@ bool SbxValue::Scan( const OUString& rSrc, sal_uInt16* pLen ) ResMgr* implGetResMgr() { - static ResMgr* pResMgr = NULL; + static ResMgr* pResMgr = nullptr; if( !pResMgr ) { pResMgr = ResMgr::CreateResMgr("sb", Application::GetSettings().GetUILanguageTag() ); @@ -598,7 +598,7 @@ struct VbaFormatInfo }; #define VBA_FORMAT_OFFSET( pcUtf8, eOffset ) \ - { VBA_FORMAT_TYPE_OFFSET, OUString(pcUtf8), eOffset, 0 } + { VBA_FORMAT_TYPE_OFFSET, OUString(pcUtf8), eOffset, nullptr } #define VBA_FORMAT_USERDEFINED( pcUtf8, pcDefinedUtf8 ) \ { VBA_FORMAT_TYPE_USERDEFINED, OUString(pcUtf8), NF_NUMBER_STANDARD, pcDefinedUtf8 } @@ -615,12 +615,12 @@ static VbaFormatInfo pFormatInfoTable[] = VBA_FORMAT_OFFSET( "dddddd", NF_DATE_SYSTEM_LONG ), VBA_FORMAT_USERDEFINED( "ttttt", "H:MM:SS AM/PM" ), VBA_FORMAT_OFFSET( "ww", NF_DATE_WW ), - { VBA_FORMAT_TYPE_NULL, OUString(""), NF_INDEX_TABLE_ENTRIES, 0 } + { VBA_FORMAT_TYPE_NULL, OUString(""), NF_INDEX_TABLE_ENTRIES, nullptr } }; VbaFormatInfo* getFormatInfo( const OUString& rFmt ) { - VbaFormatInfo* pInfo = NULL; + VbaFormatInfo* pInfo = nullptr; sal_Int16 i = 0; while( (pInfo = pFormatInfoTable + i )->meType != VBA_FORMAT_TYPE_NULL ) { @@ -797,7 +797,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const if( rAppData.eBasicFormaterLangType != eLangType ) { delete rAppData.pBasicFormater; - rAppData.pBasicFormater = NULL; + rAppData.pBasicFormater = nullptr; } } rAppData.eBasicFormaterLangType = eLangType; diff --git a/basic/source/sbx/sbxsng.cxx b/basic/source/sbx/sbxsng.cxx index bb8b91d8776c..723d1f2335b4 100644 --- a/basic/source/sbx/sbxsng.cxx +++ b/basic/source/sbx/sbxsng.cxx @@ -105,7 +105,7 @@ start: { double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else if( d > SbxMAXSNG ) { diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx index 025e3551b79a..f66680b82f4c 100644 --- a/basic/source/sbx/sbxstr.cxx +++ b/basic/source/sbx/sbxstr.cxx @@ -161,7 +161,7 @@ void ImpPutString( SbxValues* p, const OUString* n ) { SbxValues aTmp; aTmp.eType = SbxSTRING; - OUString* pTmp = NULL; + OUString* pTmp = nullptr; // as a precaution, if a NULL-Ptr appears if( !n ) n = pTmp = new OUString; @@ -210,7 +210,7 @@ void ImpPutString( SbxValues* p, const OUString* n ) *p->pOUString = *n; } else - delete p->pOUString, p->pOUString = NULL; + delete p->pOUString, p->pOUString = nullptr; break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxuint.cxx b/basic/source/sbx/sbxuint.cxx index 8c550e5cc965..b689c9ff06a6 100644 --- a/basic/source/sbx/sbxuint.cxx +++ b/basic/source/sbx/sbxuint.cxx @@ -150,7 +150,7 @@ start: { double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else if( d > SbxMAXUINT ) { diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx index 461884704f07..44be56ece975 100644 --- a/basic/source/sbx/sbxulng.cxx +++ b/basic/source/sbx/sbxulng.cxx @@ -117,7 +117,7 @@ start: { double d; SbxDataType t; - if( ImpScan( *p->pOUString, d, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK ) nRes = 0; else if( d > SbxMAXULNG ) { diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index a8d136143a8d..f5ef66712e95 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -185,7 +185,7 @@ void SbxValue::Clear() case SbxVOID: break; case SbxSTRING: - delete aData.pOUString; aData.pOUString = NULL; + delete aData.pOUString; aData.pOUString = nullptr; break; case SbxOBJECT: if( aData.pObj ) @@ -199,7 +199,7 @@ void SbxValue::Clear() if ( !bParentProp ) aData.pObj->ReleaseRef(); } - aData.pObj = NULL; + aData.pObj = nullptr; } break; case SbxDECIMAL: @@ -207,7 +207,7 @@ void SbxValue::Clear() releaseDecimalPtr( aData.pDecimal ); break; case SbxDATAOBJECT: - aData.pData = NULL; break; + aData.pData = nullptr; break; default: { SbxValues aEmpty; @@ -268,7 +268,7 @@ SbxValue* SbxValue::TheRealValue( bool bObjInObjError ) const if( !bSuccess ) { SetError( ERRCODE_SBX_BAD_PROP_VALUE ); - p = NULL; + p = nullptr; } } else if( pDflt ) @@ -280,7 +280,7 @@ SbxValue* SbxValue::TheRealValue( bool bObjInObjError ) const if( pArray ) { // When indicated get the parameter - SbxArray* pPar = NULL; + SbxArray* pPar = nullptr; SbxVariable* pVar = dynamic_cast( p ); if( pVar ) pPar = pVar->GetParameters(); @@ -317,7 +317,7 @@ bool SbxValue::Get( SbxValues& rRes ) const if( !CanRead() ) { SetError( ERRCODE_SBX_PROP_WRITEONLY ); - rRes.pObj = NULL; + rRes.pObj = nullptr; } else { @@ -376,7 +376,7 @@ bool SbxValue::Get( SbxValues& rRes ) const else { SetError( ERRCODE_SBX_NO_OBJECT ); - rRes.pObj = NULL; + rRes.pObj = nullptr; } break; default: @@ -385,7 +385,7 @@ bool SbxValue::Get( SbxValues& rRes ) const else { SetError( ERRCODE_SBX_CONVERSION ); - rRes.pObj = NULL; + rRes.pObj = nullptr; } } } @@ -664,7 +664,7 @@ bool SbxValue::fillAutomationDecimal ( css::bridge::oleautomation::Decimal& rAutomationDec ) const { SbxDecimal* pDecimal = GetDecimal(); - if( pDecimal != NULL ) + if( pDecimal != nullptr ) { pDecimal->fillAutomationDecimal( rAutomationDec ); return true; @@ -733,7 +733,7 @@ bool SbxValue::ImpIsNumeric( bool bOnlyIntntl ) const return false; } // Test downcast!!! - if( 0 != dynamic_cast( this) ) + if( nullptr != dynamic_cast( this) ) const_cast(static_cast(this))->Broadcast( SBX_HINT_DATAWANTED ); SbxDataType t = GetType(); if( t == SbxSTRING ) @@ -918,12 +918,12 @@ bool SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp ) Get( aL ); // #30576: To begin with test, if the conversion worked - if( aL.pOUString != NULL && aR.pOUString != NULL ) + if( aL.pOUString != nullptr && aR.pOUString != nullptr ) { *aL.pOUString += *aR.pOUString; } // Not even Left OK? - else if( aL.pOUString == NULL ) + else if( aL.pOUString == nullptr ) { aL.pOUString = new OUString(); } @@ -1425,7 +1425,7 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) RTL_TEXTENCODING_ASCII_US); double d; SbxDataType t; - if( ImpScan( aVal, d, t, NULL ) != ERRCODE_SBX_OK || t == SbxDOUBLE ) + if( ImpScan( aVal, d, t, nullptr ) != ERRCODE_SBX_OK || t == SbxDOUBLE ) { aData.nSingle = 0.0F; return false; @@ -1440,7 +1440,7 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) OUString aVal = read_uInt16_lenPrefixed_uInt8s_ToOUString(r, RTL_TEXTENCODING_ASCII_US); SbxDataType t; - if( ImpScan( aVal, aData.nDouble, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( aVal, aData.nDouble, t, nullptr ) != ERRCODE_SBX_OK ) { aData.nDouble = 0.0; return false; @@ -1469,7 +1469,7 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) if( !aVal.isEmpty() ) aData.pOUString = new OUString( aVal ); else - aData.pOUString = NULL; // JSM 1995-09-22 + aData.pOUString = nullptr; // JSM 1995-09-22 break; } case SbxERROR: @@ -1482,11 +1482,11 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) switch( nMode ) { case 0: - aData.pObj = NULL; + aData.pObj = nullptr; break; case 1: aData.pObj = SbxBase::Load( r ); - return ( aData.pObj != NULL ); + return ( aData.pObj != nullptr ); case 2: aData.pObj = this; break; diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index bb8880c690eb..0758a37fca96 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -48,7 +48,7 @@ class SbxVariableImpl StarBASIC* m_pComListenerParentBasic; SbxVariableImpl() - : m_pComListenerParentBasic( NULL ) + : m_pComListenerParentBasic( nullptr ) {} SbxVariableImpl( const SbxVariableImpl& r ) : m_aDeclareClassName( r.m_aDeclareClassName ) @@ -63,9 +63,9 @@ class SbxVariableImpl SbxVariable::SbxVariable() : SbxValue() { - mpSbxVariableImpl = NULL; - pCst = NULL; - pParent = NULL; + mpSbxVariableImpl = nullptr; + pCst = nullptr; + pParent = nullptr; nUserData = 0; nHash = 0; } @@ -76,8 +76,8 @@ SbxVariable::SbxVariable( const SbxVariable& r ) mpPar( r.mpPar ), pInfo( r.pInfo ) { - mpSbxVariableImpl = NULL; - if( r.mpSbxVariableImpl != NULL ) + mpSbxVariableImpl = nullptr; + if( r.mpSbxVariableImpl != nullptr ) { mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl ); #if HAVE_FEATURE_SCRIPTING @@ -87,7 +87,7 @@ SbxVariable::SbxVariable( const SbxVariable& r ) } #endif } - pCst = NULL; + pCst = nullptr; if( r.CanRead() ) { pParent = r.pParent; @@ -97,7 +97,7 @@ SbxVariable::SbxVariable( const SbxVariable& r ) } else { - pParent = NULL; + pParent = nullptr; nUserData = 0; nHash = 0; } @@ -105,9 +105,9 @@ SbxVariable::SbxVariable( const SbxVariable& r ) SbxVariable::SbxVariable( SbxDataType t, void* p ) : SbxValue( t, p ) { - mpSbxVariableImpl = NULL; - pCst = NULL; - pParent = NULL; + mpSbxVariableImpl = nullptr; + pCst = nullptr; + pParent = nullptr; nUserData = 0; nHash = 0; } @@ -171,7 +171,7 @@ void SbxVariable::Broadcast( sal_uInt32 nHintId ) // Avoid further broadcasting SfxBroadcaster* pSave = pCst; - pCst = NULL; + pCst = nullptr; SbxFlagBits nSaveFlags = GetFlags(); SetFlag( SbxFlagBits::ReadWrite ); if( mpPar.Is() ) @@ -351,7 +351,7 @@ SbxVariable& SbxVariable::operator=( const SbxVariable& r ) { SbxValue::operator=( r ); delete mpSbxVariableImpl; - if( r.mpSbxVariableImpl != NULL ) + if( r.mpSbxVariableImpl != nullptr ) { mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl ); #if HAVE_FEATURE_SCRIPTING @@ -363,7 +363,7 @@ SbxVariable& SbxVariable::operator=( const SbxVariable& r ) } else { - mpSbxVariableImpl = NULL; + mpSbxVariableImpl = nullptr; } return *this; } @@ -432,7 +432,7 @@ void SbxVariable::SetParent( SbxObject* p ) SbxVariableImpl* SbxVariable::getImpl() { - if( mpSbxVariableImpl == NULL ) + if( mpSbxVariableImpl == nullptr ) { mpSbxVariableImpl = new SbxVariableImpl(); } @@ -522,7 +522,7 @@ bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) rStrm, RTL_TEXTENCODING_ASCII_US); double d; SbxDataType t; - if( ImpScan( aTmpString, d, t, NULL ) != ERRCODE_SBX_OK || t == SbxDOUBLE ) + if( ImpScan( aTmpString, d, t, nullptr ) != ERRCODE_SBX_OK || t == SbxDOUBLE ) { aTmp.nSingle = 0; return false; @@ -537,7 +537,7 @@ bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) aTmpString = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); SbxDataType t; - if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != ERRCODE_SBX_OK ) + if( ImpScan( aTmpString, aTmp.nDouble, t, nullptr ) != ERRCODE_SBX_OK ) { aTmp.nDouble = 0; return false; diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 5b56c411998b..e3baba0d260e 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -386,7 +386,7 @@ SfxLibraryContainer::SfxLibraryContainer() , maNameContainer( new NameContainer(cppu::UnoType::get()) ) , mbOldInfoFormat( false ) , mbOasis2OOoFormat( false ) - , mpBasMgr( NULL ) + , mpBasMgr( nullptr ) , mbOwnBasMgr( false ) , meInitMode(DEFAULT) { @@ -667,7 +667,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL, meInitMode = LIBRARY_INIT_FILE; uno::Reference< embed::XStorage > xDummyStor; ::xmlscript::LibDescriptor aLibDesc; - implLoadLibraryIndexFile( NULL, aLibDesc, xDummyStor, aInitFileName ); + implLoadLibraryIndexFile( nullptr, aLibDesc, xDummyStor, aInitFileName ); return; } else @@ -2729,7 +2729,7 @@ void SAL_CALL SfxLibraryContainer::initialize( const Sequence< Any >& _rArgument void SAL_CALL SfxLibraryContainer::initializeFromDocumentURL( const OUString& _rInitialDocumentURL ) { - init( _rInitialDocumentURL, NULL ); + init( _rInitialDocumentURL, nullptr ); } void SAL_CALL SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBasedDocument >& _rxDocument ) @@ -3224,7 +3224,7 @@ void SfxLibrary::removeByName( const OUString& Name ) Sequence< Type > SfxLibrary::getTypes() throw( RuntimeException, std::exception ) { - static OTypeCollection * s_pTypes_NameContainer = 0; + static OTypeCollection * s_pTypes_NameContainer = nullptr; if( !s_pTypes_NameContainer ) { MutexGuard aGuard( Mutex::getGlobalMutex() ); @@ -3291,7 +3291,7 @@ ScriptExtensionIterator::ScriptExtensionIterator() , m_iUserPackage( 0 ) , m_iSharedPackage( 0 ) , m_iBundledPackage( 0 ) - , m_pScriptSubPackageIterator( NULL ) + , m_pScriptSubPackageIterator( nullptr ) {} OUString ScriptExtensionIterator::nextBasicOrDialogLibrary( bool& rbPureDialogLib ) @@ -3470,7 +3470,7 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextUserScript } else { - if( m_pScriptSubPackageIterator == NULL ) + if( m_pScriptSubPackageIterator == nullptr ) { const Reference< deployment::XPackage >* pUserPackages = m_aUserPackagesSeq.getConstArray(); Reference< deployment::XPackage > xPackage = pUserPackages[ m_iUserPackage ]; @@ -3481,13 +3481,13 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextUserScript m_pScriptSubPackageIterator = new ScriptSubPackageIterator( xPackage ); } - if( m_pScriptSubPackageIterator != NULL ) + if( m_pScriptSubPackageIterator != nullptr ) { xScriptPackage = m_pScriptSubPackageIterator->getNextScriptSubPackage( rbPureDialogLib ); if( !xScriptPackage.is() ) { delete m_pScriptSubPackageIterator; - m_pScriptSubPackageIterator = NULL; + m_pScriptSubPackageIterator = nullptr; m_iUserPackage++; } } @@ -3524,7 +3524,7 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextSharedScri } else { - if( m_pScriptSubPackageIterator == NULL ) + if( m_pScriptSubPackageIterator == nullptr ) { const Reference< deployment::XPackage >* pSharedPackages = m_aSharedPackagesSeq.getConstArray(); Reference< deployment::XPackage > xPackage = pSharedPackages[ m_iSharedPackage ]; @@ -3535,13 +3535,13 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextSharedScri m_pScriptSubPackageIterator = new ScriptSubPackageIterator( xPackage ); } - if( m_pScriptSubPackageIterator != NULL ) + if( m_pScriptSubPackageIterator != nullptr ) { xScriptPackage = m_pScriptSubPackageIterator->getNextScriptSubPackage( rbPureDialogLib ); if( !xScriptPackage.is() ) { delete m_pScriptSubPackageIterator; - m_pScriptSubPackageIterator = NULL; + m_pScriptSubPackageIterator = nullptr; m_iSharedPackage++; } } @@ -3578,7 +3578,7 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextBundledScr } else { - if( m_pScriptSubPackageIterator == NULL ) + if( m_pScriptSubPackageIterator == nullptr ) { const Reference< deployment::XPackage >* pBundledPackages = m_aBundledPackagesSeq.getConstArray(); Reference< deployment::XPackage > xPackage = pBundledPackages[ m_iBundledPackage ]; @@ -3589,13 +3589,13 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextBundledScr m_pScriptSubPackageIterator = new ScriptSubPackageIterator( xPackage ); } - if( m_pScriptSubPackageIterator != NULL ) + if( m_pScriptSubPackageIterator != nullptr ) { xScriptPackage = m_pScriptSubPackageIterator->getNextScriptSubPackage( rbPureDialogLib ); if( !xScriptPackage.is() ) { delete m_pScriptSubPackageIterator; - m_pScriptSubPackageIterator = NULL; + m_pScriptSubPackageIterator = nullptr; m_iBundledPackage++; } } diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 13b8f774dd1a..84ee6f68f4a0 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -340,7 +340,7 @@ void SAL_CALL SfxScriptLibraryContainer::importFromOldStorage( const OUString& a BasicManager* pBasicManager = new BasicManager( *static_cast(xStorage), aFile ); // Set info - LibraryContainerInfo aInfo( this, NULL, static_cast< OldBasicPassword* >( this ) ); + LibraryContainerInfo aInfo( this, nullptr, static_cast< OldBasicPassword* >( this ) ); pBasicManager->SetLibraryContainerInfo( aInfo ); // Now the libraries should be copied to this SfxScriptLibraryContainer @@ -867,7 +867,7 @@ bool SfxScriptLibraryContainer::implLoadPasswordLibrary } } - StarBASIC* pBasicLib = NULL; + StarBASIC* pBasicLib = nullptr; bool bLoadBinary = false; if( !pScriptLib->mbLoadedBinary && !bVerifyPasswordOnly && !pLib->mbPasswordVerified ) { @@ -875,7 +875,7 @@ bool SfxScriptLibraryContainer::implLoadPasswordLibrary OSL_ENSURE( pBasicMgr, "SfxScriptLibraryContainer::implLoadPasswordLibrary: cannot do this without a BasicManager!" ); bool bLoaded = pScriptLib->mbLoaded; pScriptLib->mbLoaded = true; // Necessary to get lib - pBasicLib = pBasicMgr ? pBasicMgr->GetLib( Name ) : NULL; + pBasicLib = pBasicMgr ? pBasicMgr->GetLib( Name ) : nullptr; pScriptLib->mbLoaded = bLoaded; // Restore flag if( !pBasicLib ) { -- cgit