diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:15:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:26 +0100 |
commit | e5b721a14c1c8e5261a70588b30353cbb5bd55c6 (patch) | |
tree | 4363d47845ddc271a032a5f18e402ddbe001891b /formula | |
parent | 11d365241808405483b79efd7879fa04bee8945e (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: Ib336ce9bc95f5c84dd6412ff3c098e68c5b0f4ff
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/core/api/FormulaCompiler.cxx | 36 | ||||
-rw-r--r-- | formula/source/core/api/services.cxx | 4 | ||||
-rw-r--r-- | formula/source/core/api/token.cxx | 80 | ||||
-rw-r--r-- | formula/source/core/api/vectortoken.cxx | 12 | ||||
-rw-r--r-- | formula/source/core/resource/core_resource.cxx | 4 | ||||
-rw-r--r-- | formula/source/ui/dlg/FormulaHelper.cxx | 6 | ||||
-rw-r--r-- | formula/source/ui/dlg/formula.cxx | 40 | ||||
-rw-r--r-- | formula/source/ui/dlg/funcpage.cxx | 2 | ||||
-rw-r--r-- | formula/source/ui/dlg/funcutl.cxx | 28 | ||||
-rw-r--r-- | formula/source/ui/dlg/parawin.cxx | 8 | ||||
-rw-r--r-- | formula/source/ui/dlg/structpg.cxx | 16 | ||||
-rw-r--r-- | formula/source/ui/dlg/structpg.hxx | 6 | ||||
-rw-r--r-- | formula/source/ui/resource/ModuleHelper.cxx | 6 |
13 files changed, 124 insertions, 124 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 443efc80ddec..cafab24a10b2 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -162,7 +162,7 @@ OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr x , meSepType( eSepType) { SvtSysLocale aSysLocale; - const CharClass* pCharClass = (xMap->isEnglish() ? NULL : aSysLocale.GetCharClassPtr()); + const CharClass* pCharClass = (xMap->isEnglish() ? nullptr : aSysLocale.GetCharClassPtr()); if (meSepType == FormulaCompiler::RESOURCE_BASE) { for (sal_uInt16 i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; ++i) @@ -249,14 +249,14 @@ void OpCodeList::putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, s const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr, sal_Unicode c ) { if ( !pStr ) - return NULL; + return nullptr; while ( *pStr ) { if ( *pStr == c ) return pStr; pStr++; } - return NULL; + return nullptr; } struct OpCodeMapData @@ -533,8 +533,8 @@ void FormulaCompiler::OpCodeMap::putOpCode( const OUString & rStr, const OpCode FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr ) : pArr( &rArr ), - pCode( NULL ), - pStack( NULL ), + pCode( nullptr ), + pStack( nullptr ), eLastOp( ocPush ), nRecursion( 0 ), nNumFmt( css::util::NumberFormat::UNDEFINED ), @@ -550,9 +550,9 @@ FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr ) FormulaCompiler::FormulaCompiler() : - pArr( NULL ), - pCode( NULL ), - pStack( NULL ), + pArr( nullptr ), + pCode( nullptr ), + pStack( nullptr ), eLastOp( ocPush ), nRecursion(0), nNumFmt( css::util::NumberFormat::UNDEFINED ), @@ -628,7 +628,7 @@ FormulaCompiler::OpCodeMapPtr FormulaCompiler::CreateOpCodeMap( FormulaGrammar::mergeToGrammar( FormulaGrammar::setEnglishBit( FormulaGrammar::GRAM_EXTERNAL, bEnglish), FormulaGrammar::CONV_UNSPECIFIED))); SvtSysLocale aSysLocale; - const CharClass* pCharClass = (xMap->isEnglish() ? NULL : aSysLocale.GetCharClassPtr()); + const CharClass* pCharClass = (xMap->isEnglish() ? nullptr : aSysLocale.GetCharClassPtr()); FormulaOpCodeMapEntry const * pArr2 = rMapping.getConstArray(); FormulaOpCodeMapEntry const * const pStop = pArr2 + rMapping.getLength(); for ( ; pArr2 < pStop; ++pArr2) @@ -728,9 +728,9 @@ void FormulaCompiler::InitSymbolsEnglishXL() const // TODO: For now, just replace the separators to the Excel English // variants. Later, if we want to properly map Excel functions with Calc // functions, we'll need to do a little more work here. - mxSymbolsEnglishXL->putOpCode( OUString(','), ocSep, NULL); - mxSymbolsEnglishXL->putOpCode( OUString(','), ocArrayColSep, NULL); - mxSymbolsEnglishXL->putOpCode( OUString(';'), ocArrayRowSep, NULL); + mxSymbolsEnglishXL->putOpCode( OUString(','), ocSep, nullptr); + mxSymbolsEnglishXL->putOpCode( OUString(','), ocArrayColSep, nullptr); + mxSymbolsEnglishXL->putOpCode( OUString(';'), ocArrayRowSep, nullptr); } void FormulaCompiler::InitSymbolsOOXML() const @@ -1671,7 +1671,7 @@ bool FormulaCompiler::MergeRangeReference( FormulaToken * * const pCode1, Formul FormulaToken *p1, *p2; if (pc < 2 || !pCode1 || !pCode2 || (pCode2 - pCode1 != 1) || (pCode - pCode2 != 1) || - ((p1 = *pCode1) == 0) || ((p2 = *pCode2) == 0) ) + ((p1 = *pCode1) == nullptr) || ((p2 = *pCode2) == nullptr) ) return false; FormulaTokenRef p = ExtendRangeReference( *p1, *p2, true); @@ -1699,7 +1699,7 @@ bool FormulaCompiler::CompileTokenArray() aCorrectedSymbol.clear(); } pArr->DelRPN(); - pStack = NULL; + pStack = nullptr; FormulaToken* pData[ FORMULA_MAXTOKENS ]; pCode = pData; bool bWasForced = pArr->IsRecalcModeForced(); @@ -2025,7 +2025,7 @@ void FormulaCompiler::AppendBoolean( OUStringBuffer& rBuffer, bool bVal ) const void FormulaCompiler::AppendString( OUStringBuffer& rBuffer, const OUString & rStr ) { rBuffer.append( '"'); - if ( lcl_UnicodeStrChr( rStr.getStr(), '"' ) == NULL ) + if ( lcl_UnicodeStrChr( rStr.getStr(), '"' ) == nullptr ) rBuffer.append( rStr ); else { @@ -2049,9 +2049,9 @@ void FormulaCompiler::UpdateSeparatorsNative( { NonConstOpCodeMapPtr xSymbolsNative; lcl_fillNativeSymbols( xSymbolsNative); - xSymbolsNative->putOpCode( rSep, ocSep, NULL); - xSymbolsNative->putOpCode( rArrayColSep, ocArrayColSep, NULL); - xSymbolsNative->putOpCode( rArrayRowSep, ocArrayRowSep, NULL); + xSymbolsNative->putOpCode( rSep, ocSep, nullptr); + xSymbolsNative->putOpCode( rArrayColSep, ocArrayColSep, nullptr); + xSymbolsNative->putOpCode( rArrayRowSep, ocArrayRowSep, nullptr); } void FormulaCompiler::ResetNativeSymbols() diff --git a/formula/source/core/api/services.cxx b/formula/source/core/api/services.cxx index 0b51f5a138bd..61fa52e82bbd 100644 --- a/formula/source/core/api/services.cxx +++ b/formula/source/core/api/services.cxx @@ -36,8 +36,8 @@ namespace cppu::ImplementationEntry entries[] = { { &FormulaOpCodeMapperObj::create, &FormulaOpCodeMapperObj::getImplementationName_Static, &FormulaOpCodeMapperObj::getSupportedServiceNames_Static, - &cppu::createSingleComponentFactory, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } + &cppu::createSingleComponentFactory, nullptr, 0 }, + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; } diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index b0e84f314c75..e7da2bd7d6ff 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -229,7 +229,7 @@ void FormulaToken::SetGlobal( bool ) short* FormulaToken::GetJump() const { SAL_WARN( "formula.core", "FormulaToken::GetJump: virtual dummy called" ); - return NULL; + return nullptr; } @@ -243,7 +243,7 @@ const OUString& FormulaToken::GetExternal() const FormulaToken* FormulaToken::GetFAPOrigToken() const { SAL_WARN( "formula.core", "FormulaToken::GetFAPOrigToken: virtual dummy called" ); - return NULL; + return nullptr; } sal_uInt16 FormulaToken::GetError() const @@ -296,30 +296,30 @@ ScSingleRefData* FormulaToken::GetSingleRef2() const ScMatrix* FormulaToken::GetMatrix() const { OSL_FAIL( "FormulaToken::GetMatrix: virtual dummy called" ); - return NULL; + return nullptr; } ScMatrix* FormulaToken::GetMatrix() { OSL_FAIL( "FormulaToken::GetMatrix: virtual dummy called" ); - return NULL; + return nullptr; } ScJumpMatrix* FormulaToken::GetJumpMatrix() const { OSL_FAIL( "FormulaToken::GetJumpMatrix: virtual dummy called" ); - return NULL; + return nullptr; } const std::vector<ScComplexRefData>* FormulaToken::GetRefList() const { OSL_FAIL( "FormulaToken::GetRefList: virtual dummy called" ); - return NULL; + return nullptr; } std::vector<ScComplexRefData>* FormulaToken::GetRefList() { OSL_FAIL( "FormulaToken::GetRefList: virtual dummy called" ); - return NULL; + return nullptr; } bool FormulaToken::TextEqual( const FormulaToken& rToken ) const @@ -454,7 +454,7 @@ FormulaToken* FormulaTokenArray::GetNextReference() } } } - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::GetNextColRowName() @@ -465,7 +465,7 @@ FormulaToken* FormulaTokenArray::GetNextColRowName() if ( t->GetOpCode() == ocColRowName ) return t; } - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::GetNextReferenceRPN() @@ -486,7 +486,7 @@ FormulaToken* FormulaTokenArray::GetNextReferenceRPN() } } } - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::GetNextReferenceOrName() @@ -512,7 +512,7 @@ FormulaToken* FormulaTokenArray::GetNextReferenceOrName() } } } - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::GetNextName() @@ -526,7 +526,7 @@ FormulaToken* FormulaTokenArray::GetNextName() return t; } } // if( pCode ) - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::Next() @@ -534,7 +534,7 @@ FormulaToken* FormulaTokenArray::Next() if( pCode && nIndex < nLen ) return pCode[ nIndex++ ]; else - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::NextNoSpaces() @@ -546,7 +546,7 @@ FormulaToken* FormulaTokenArray::NextNoSpaces() if( nIndex < nLen ) return pCode[ nIndex++ ]; } - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::NextRPN() @@ -554,7 +554,7 @@ FormulaToken* FormulaTokenArray::NextRPN() if( pRPN && nIndex < nRPN ) return pRPN[ nIndex++ ]; else - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::PrevRPN() @@ -562,7 +562,7 @@ FormulaToken* FormulaTokenArray::PrevRPN() if( pRPN && nIndex ) return pRPN[ --nIndex ]; else - return NULL; + return nullptr; } void FormulaTokenArray::DelRPN() @@ -576,7 +576,7 @@ void FormulaTokenArray::DelRPN() } delete [] pRPN; } - pRPN = NULL; + pRPN = nullptr; nRPN = nIndex = 0; } @@ -584,7 +584,7 @@ FormulaToken* FormulaTokenArray::PeekPrev( sal_uInt16 & nIdx ) { if (0 < nIdx && nIdx <= nLen) return pCode[--nIdx]; - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::PeekNext() @@ -592,7 +592,7 @@ FormulaToken* FormulaTokenArray::PeekNext() if( pCode && nIndex < nLen ) return pCode[ nIndex ]; else - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::PeekNextNoSpaces() @@ -605,10 +605,10 @@ FormulaToken* FormulaTokenArray::PeekNextNoSpaces() if ( j < nLen ) return pCode[ j ]; else - return NULL; + return nullptr; } else - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::PeekPrevNoSpaces() @@ -621,10 +621,10 @@ FormulaToken* FormulaTokenArray::PeekPrevNoSpaces() if ( j > 0 || pCode[j]->GetOpCode() != ocSpaces ) return pCode[ j ]; else - return NULL; + return nullptr; } else - return NULL; + return nullptr; } bool FormulaTokenArray::HasReferences() const @@ -699,8 +699,8 @@ bool FormulaTokenArray::HasOpCodes(const unordered_opcode_set& rOpCodes) const } FormulaTokenArray::FormulaTokenArray() : - pCode(NULL), - pRPN(NULL), + pCode(nullptr), + pRPN(nullptr), nLen(0), nRPN(0), nIndex(0), @@ -730,8 +730,8 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r ) nMode = r.nMode; bHyperLink = r.bHyperLink; mbFromRangeName = r.mbFromRangeName; - pCode = NULL; - pRPN = NULL; + pCode = nullptr; + pRPN = nullptr; FormulaToken** pp; if( nLen ) { @@ -753,7 +753,7 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r ) void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens ) { assert( nLen == 0 ); - assert( pCode == NULL ); + assert( pCode == nullptr ); nLen = nCode; pCode = new FormulaToken*[ nLen ]; @@ -837,7 +837,7 @@ void FormulaTokenArray::Clear() } delete [] pCode; } - pCode = NULL; pRPN = NULL; + pCode = nullptr; pRPN = nullptr; nError = nLen = nIndex = nRPN = 0; bHyperLink = false; mbFromRangeName = false; @@ -856,7 +856,7 @@ FormulaToken* FormulaTokenArray::AddToken( const FormulaToken& r ) FormulaToken* FormulaTokenArray::MergeArray( ) { - return NULL; + return nullptr; } FormulaToken* FormulaTokenArray::ReplaceToken( sal_uInt16 nOffset, FormulaToken* t, @@ -891,7 +891,7 @@ FormulaToken* FormulaTokenArray::ReplaceToken( sal_uInt16 nOffset, FormulaToken* else { t->Delete(); - return NULL; + return nullptr; } } @@ -917,7 +917,7 @@ FormulaToken* FormulaTokenArray::Add( FormulaToken* t ) pCode[ nLen++ ] = t; t->IncRef(); } - return NULL; + return nullptr; } } @@ -1102,7 +1102,7 @@ class FormulaMissingContext const FormulaToken* mpFunc; int mnCurArg; - void Clear() { mpFunc = NULL; mnCurArg = 0; } + void Clear() { mpFunc = nullptr; mnCurArg = 0; } inline bool AddDefaultArg( FormulaTokenArray* pNewArr, int nArg, double f ) const; bool AddMissingExternal( FormulaTokenArray* pNewArr ) const; bool AddMissing( FormulaTokenArray *pNewArr, const MissingConvention & rConv ) const; @@ -1489,7 +1489,7 @@ bool FormulaTokenArray::MayReferenceFollow() } FormulaToken* FormulaTokenArray::AddOpCode( OpCode eOp ) { - FormulaToken* pRet = NULL; + FormulaToken* pRet = nullptr; switch ( eOp ) { case ocOpen: @@ -1573,12 +1573,12 @@ const FormulaToken* FormulaTokenIterator::Next() const FormulaToken* FormulaTokenIterator::PeekNextOperator() { - const FormulaToken* t = NULL; + const FormulaToken* t = nullptr; short nIdx = maStack.back().nPC; - while (!t && ((t = GetNonEndOfPathToken( ++nIdx)) != NULL)) + while (!t && ((t = GetNonEndOfPathToken( ++nIdx)) != nullptr)) { if (t->GetOpCode() == ocPush) - t = NULL; // ignore operands + t = nullptr; // ignore operands } if (!t && maStack.size() > 1) { @@ -1611,14 +1611,14 @@ const FormulaToken* FormulaTokenIterator::GetNonEndOfPathToken( short nIdx ) con { const FormulaToken* t = cur.pArr->pRPN[ nIdx ]; // such an OpCode ends an IF() or CHOOSE() path - return (t->GetOpCode() == ocSep || t->GetOpCode() == ocClose) ? NULL : t; + return (t->GetOpCode() == ocSep || t->GetOpCode() == ocClose) ? nullptr : t; } - return NULL; + return nullptr; } bool FormulaTokenIterator::IsEndOfPath() const { - return GetNonEndOfPathToken( maStack.back().nPC + 1) == NULL; + return GetNonEndOfPathToken( maStack.back().nPC + 1) == nullptr; } diff --git a/formula/source/core/api/vectortoken.cxx b/formula/source/core/api/vectortoken.cxx index 99f7decd06fc..d5129aeb9f57 100644 --- a/formula/source/core/api/vectortoken.cxx +++ b/formula/source/core/api/vectortoken.cxx @@ -12,22 +12,22 @@ namespace formula { VectorRefArray::VectorRefArray() : - mpNumericArray(NULL), - mpStringArray(NULL), + mpNumericArray(nullptr), + mpStringArray(nullptr), mbValid(true) {} VectorRefArray::VectorRefArray( InitInvalid ) : - mpNumericArray(NULL), - mpStringArray(NULL), + mpNumericArray(nullptr), + mpStringArray(nullptr), mbValid(false) {} VectorRefArray::VectorRefArray( const double* pArray ) : mpNumericArray(pArray), - mpStringArray(NULL), + mpStringArray(nullptr), mbValid(true) {} VectorRefArray::VectorRefArray( rtl_uString** pArray ) : - mpNumericArray(NULL), + mpNumericArray(nullptr), mpStringArray(pArray), mbValid(true) {} diff --git a/formula/source/core/resource/core_resource.cxx b/formula/source/core/resource/core_resource.cxx index ecfacde8babb..6c9df0139704 100644 --- a/formula/source/core/resource/core_resource.cxx +++ b/formula/source/core/resource/core_resource.cxx @@ -40,7 +40,7 @@ namespace formula struct theResourceManagerMutex : public rtl::Static< osl::Mutex, theResourceManagerMutex > {}; } sal_Int32 ResourceManager::s_nClients = 0; - ResMgr* ResourceManager::m_pImpl = NULL; + ResMgr* ResourceManager::m_pImpl = nullptr; void ResourceManager::ensureImplExists() @@ -65,7 +65,7 @@ namespace formula if (!--s_nClients && m_pImpl) { delete m_pImpl; - m_pImpl = NULL; + m_pImpl = nullptr; } } ResMgr* ResourceManager::getResManager() diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index bde6ca837f0f..1e296f710709 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -36,7 +36,7 @@ namespace formula virtual ~OEmptyFunctionDescription(){} virtual OUString getFunctionName() const override { return OUString(); } - virtual const IFunctionCategory* getCategory() const override { return NULL; } + virtual const IFunctionCategory* getCategory() const override { return nullptr; } virtual OUString getDescription() const override { return OUString(); } virtual sal_Int32 getSuppressedArgumentCount() const override { return 0; } virtual OUString getFormula(const ::std::vector< OUString >& ) const override { return OUString(); } @@ -78,7 +78,7 @@ bool FormulaHelper::GetNextFunc( const OUString& rFormula, sal_Int32 nOldStart = rFStart; OUString aFname; - rFStart = GetFunctionStart( rFormula, rFStart, bBack, ppFDesc ? &aFname : NULL ); + rFStart = GetFunctionStart( rFormula, rFStart, bBack, ppFDesc ? &aFname : nullptr ); bool bFound = ( rFStart != FUNC_NOTFOUND ); if ( bFound ) @@ -88,7 +88,7 @@ bool FormulaHelper::GetNextFunc( const OUString& rFormula, if ( ppFDesc ) { - *ppFDesc = NULL; + *ppFDesc = nullptr; const OUString sTemp( aFname ); const sal_uInt32 nCategoryCount = m_pFunctionManager->getCount(); for(sal_uInt32 j= 0; j < nCategoryCount && !*ppFDesc; ++j) diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 0af8a12d73aa..0d3fbbc95c4f 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -227,16 +227,16 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent ,const IFunctionManager* _pFunctionMgr ,IControlReferenceHandler* _pDlg) : - m_pSpecialOpCodesEnd(NULL), - m_pFunctionOpCodesEnd(NULL), - m_pUnaryOpCodesEnd(NULL), - m_pBinaryOpCodesEnd(NULL), + m_pSpecialOpCodesEnd(nullptr), + m_pFunctionOpCodesEnd(nullptr), + m_pUnaryOpCodesEnd(nullptr), + m_pBinaryOpCodesEnd(nullptr), m_pHelper (_pHelper), m_pParent (pParent), m_pDlg (_pDlg), - pTheRefEdit (NULL), - pTheRefButton (NULL), - pMEdit (NULL), + pTheRefEdit (nullptr), + pTheRefButton (nullptr), + pMEdit (nullptr), bUserMatrixFlag (false), aTitle1 ( ModuleRes( STR_TITLE1 ) ), aTitle2 ( ModuleRes( STR_TITLE2 ) ), @@ -245,7 +245,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent bIsShutDown (false), bMakingTree (false), nEdFocus (0), - pFuncDesc (NULL), + pFuncDesc (nullptr), nArgs (0) { pParent->get(m_pParaWinBox, "BOX"); @@ -394,13 +394,13 @@ void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt ) if(nSwitch==MouseNotifyEvent::GETFOCUS && !bIsShutDown) { vcl::Window* pWin=rNEvt.GetWindow(); - if(pWin!=NULL) + if(pWin!=nullptr) { aActivWinId = pWin->GetUniqueId(); if(aActivWinId.isEmpty()) { vcl::Window* pParent=pWin->GetParent(); - while(pParent!=NULL) + while(pParent!=nullptr) { aActivWinId=pParent->GetUniqueId(); @@ -646,7 +646,7 @@ bool FormulaDlg_Impl::CalcStruct( const OUString& rStrExp) void FormulaDlg_Impl::MakeTree(StructPage* _pTree,SvTreeListEntry* pParent,FormulaToken* _pToken,long Count) { - if( _pToken != NULL && Count > 0 ) + if( _pToken != nullptr && Count > 0 ) { long nParas = _pToken->GetParamCount(); OpCode eOp = _pToken->GetOpCode(); @@ -762,9 +762,9 @@ void FormulaDlg_Impl::fillTree(StructPage* _pTree) GetFormulaOpCodeMapper(); FormulaToken* pToken = m_pTokenArray->LastRPN(); - if( pToken != NULL) + if( pToken != nullptr) { - MakeTree(_pTree,NULL,pToken,1); + MakeTree(_pTree,nullptr,pToken,1); bMakingTree = false; } } @@ -958,7 +958,7 @@ void FormulaDlg_Impl::FillControls(bool &rbNext, bool &rbPrev) void FormulaDlg_Impl::ClearAllParas() { DeleteArgs(); - pFuncDesc = NULL; + pFuncDesc = nullptr; pParaWin->ClearAll(); m_pWndResult->SetText(OUString()); m_pFtFuncName->SetText(OUString()); @@ -1452,10 +1452,10 @@ void FormulaDlg_Impl::UpdateSelection() m_pEdRef->SetUniqueId( pTheRefEdit->GetUniqueId() ); } - m_pRefBtn->Show( pButton != NULL ); + m_pRefBtn->Show( pButton != nullptr ); ::std::pair<RefButton*,RefEdit*> aPair; - aPair.first = pButton ? m_pRefBtn.get() : NULL; + aPair.first = pButton ? m_pRefBtn.get() : nullptr; aPair.second = m_pEdRef; return aPair; } @@ -1495,7 +1495,7 @@ void FormulaDlg_Impl::RefInputDoneAfter( bool bForced ) sal_uInt16 nPrivActiv = pParaWin->GetActiveLine(); pParaWin->SetArgument( nPrivActiv, m_pEdRef->GetText() ); ModifyHdl( *pParaWin ); - pTheRefEdit = NULL; + pTheRefEdit = nullptr; } m_pParent->SetText( aTitle1 ); } @@ -1622,7 +1622,7 @@ void FormulaDlg_Impl::UpdateParaWin(const Selection& _rSelection, const OUString pParaWin->UpdateParas(); Edit* pEd = GetCurrRefEdit(); - if( pEd != NULL ) + if( pEd != nullptr ) pEd->SetSelection( theSel ); pParaWin->SetRefMode(false); @@ -1633,7 +1633,7 @@ bool FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection) OUString aStrEd; Edit* pEd = GetCurrRefEdit(); - if(pEd!=NULL && pTheRefEdit==nullptr) + if(pEd!=nullptr && pTheRefEdit==nullptr) { _rSelection=pEd->GetSelection(); _rSelection.Justify(); @@ -1921,7 +1921,7 @@ void FormEditData::SaveValues() void FormEditData::Reset() { - pParent = NULL; + pParent = nullptr; nMode = 0; nFStart = 0; nCatSel = 1; //! oder 0 (zuletzt benutzte) diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 58d6461d171c..42a2b351a81d 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -124,7 +124,7 @@ void FuncPage::UpdateFunctionList() if ( nSelPos > 0 ) { - if ( pCategory == NULL ) + if ( pCategory == nullptr ) { const sal_uInt32 nCount = m_pFunctionManager->getCount(); for(sal_uInt32 i = 0 ; i < nCount; ++i) diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index 15275820983c..2d49d982b0f5 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -35,10 +35,10 @@ namespace formula // class ArgEdit ArgEdit::ArgEdit( vcl::Window* pParent, WinBits nBits ) - : RefEdit( pParent, NULL, nBits ), - pEdPrev ( NULL ), - pEdNext ( NULL ), - pSlider ( NULL ), + : RefEdit( pParent, nullptr, nBits ), + pEdPrev ( nullptr ), + pEdNext ( nullptr ), + pSlider ( nullptr ), nArgs ( 0 ) { } @@ -80,7 +80,7 @@ void ArgEdit::KeyInput( const KeyEvent& rKEvt ) { if ( nArgs > 1 ) { - ArgEdit* pEd = NULL; + ArgEdit* pEd = nullptr; long nThumb = pSlider->GetThumbPos(); bool bDoScroll = false; bool bChangeFocus = false; @@ -146,10 +146,10 @@ void ArgEdit::KeyInput( const KeyEvent& rKEvt ) // class ArgInput ArgInput::ArgInput() { - pFtArg=NULL; - pBtnFx=NULL; - pEdArg=NULL; - pRefBtn=NULL; + pFtArg=nullptr; + pBtnFx=nullptr; + pEdArg=nullptr; + pRefBtn=nullptr; } void ArgInput::InitArgInput( FixedText* pftArg, PushButton* pbtnFx, @@ -383,7 +383,7 @@ bool EditBox::PreNotify( NotifyEvent& rNEvt ) else { bResult=Control::PreNotify(rNEvt); - Application::PostUserEvent( LINK( this, EditBox, ChangedHdl ), NULL, true ); + Application::PostUserEvent( LINK( this, EditBox, ChangedHdl ), nullptr, true ); } } @@ -394,7 +394,7 @@ bool EditBox::PreNotify( NotifyEvent& rNEvt ) if(nSwitch==MouseNotifyEvent::MOUSEBUTTONDOWN || nSwitch==MouseNotifyEvent::MOUSEBUTTONUP) { bMouseFlag=true; - Application::PostUserEvent( LINK( this, EditBox, ChangedHdl ), NULL, true ); + Application::PostUserEvent( LINK( this, EditBox, ChangedHdl ), nullptr, true ); } } return bResult; @@ -429,7 +429,7 @@ void EditBox::UpdateOldSel() RefEdit::RefEdit( vcl::Window* _pParent, vcl::Window* pShrinkModeLabel, WinBits nStyle ) : Edit( _pParent, nStyle ) - , pAnyRefDlg( NULL ) + , pAnyRefDlg( nullptr ) , pLabelWidget(pShrinkModeLabel) { aIdle.SetIdleHdl( LINK( this, RefEdit, UpdateHdl ) ); @@ -563,8 +563,8 @@ RefButton::RefButton( vcl::Window* _pParent, WinBits nStyle ) : aImgRefDone( ModuleRes( RID_BMP_REFBTN2 ) ), aShrinkQuickHelp( ModuleRes( RID_STR_SHRINK ).toString() ), aExpandQuickHelp( ModuleRes( RID_STR_EXPAND ).toString() ), - pAnyRefDlg( NULL ), - pRefEdit( NULL ) + pAnyRefDlg( nullptr ), + pRefEdit( nullptr ) { SetStartImage(); } diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index 0bec0bb1a045..e32d257fdd8c 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -37,7 +37,7 @@ namespace formula ParaWin::ParaWin(vcl::Window* pParent,IControlReferenceHandler* _pDlg): TabPage (pParent, "ParameterPage", "formula/ui/parameter.ui"), - pFuncDesc ( NULL ), + pFuncDesc ( nullptr ), pMyParent (_pDlg), m_sOptional ( ModuleRes( STR_OPTIONAL ) ), m_sRequired ( ModuleRes( STR_REQUIRED ) ), @@ -287,7 +287,7 @@ RefEdit* ParaWin::GetActiveEdit() } else { - return NULL; + return nullptr; } } @@ -340,7 +340,7 @@ void ParaWin::SetFunctionDesc(const IFunctionDescription* pFDesc) SetArgumentText( OUString() ); SetEditDesc( OUString() ); nArgs = 0; - if ( pFuncDesc!=NULL) + if ( pFuncDesc!=nullptr) { if ( !pFuncDesc->getDescription().isEmpty() ) { @@ -444,7 +444,7 @@ void ParaWin::InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, PushButton& rBtn void ParaWin::ClearAll() { - SetFunctionDesc(NULL); + SetFunctionDesc(nullptr); SetArgumentOffset(0); } diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx index fcbf0e6b3834..11d562722321 100644 --- a/formula/source/ui/dlg/structpg.cxx +++ b/formula/source/ui/dlg/structpg.cxx @@ -84,7 +84,7 @@ StructPage::StructPage(vcl::Window* pParent): TabPage(pParent, "StructPage", "formula/ui/structpage.ui"), maImgEnd ( ModuleRes( BMP_STR_END ) ), maImgError ( ModuleRes( BMP_STR_ERROR ) ), - pSelectedToken ( NULL ) + pSelectedToken ( nullptr ) { get(m_pTlbStruct, "struct"); Size aSize(LogicToPixel(Size(86, 162), MAP_APPFONT)); @@ -123,7 +123,7 @@ SvTreeListEntry* StructPage::InsertEntry( const OUString& rText, SvTreeListEntry { m_pTlbStruct->SetActiveFlag( false ); - SvTreeListEntry* pEntry = NULL; + SvTreeListEntry* pEntry = nullptr; switch( nFlag ) { case STRUCT_FOLDER: @@ -145,17 +145,17 @@ SvTreeListEntry* StructPage::InsertEntry( const OUString& rText, SvTreeListEntry OUString StructPage::GetEntryText(SvTreeListEntry* pEntry) const { OUString aString; - if(pEntry!=NULL) + if(pEntry!=nullptr) aString = m_pTlbStruct->GetEntryText(pEntry); return aString; } IFormulaToken* StructPage::GetFunctionEntry(SvTreeListEntry* pEntry) { - if(pEntry!=NULL) + if(pEntry!=nullptr) { IFormulaToken * pToken=static_cast<IFormulaToken *>(pEntry->GetUserData()); - if(pToken!=NULL) + if(pToken!=nullptr) { if ( !(pToken->isFunction() || pToken->getArgumentCount() > 1 ) ) { @@ -167,7 +167,7 @@ IFormulaToken* StructPage::GetFunctionEntry(SvTreeListEntry* pEntry) } } } - return NULL; + return nullptr; } IMPL_LINK_TYPED( StructPage, SelectHdl, SvTreeListBox*, pTlb, void ) @@ -177,10 +177,10 @@ IMPL_LINK_TYPED( StructPage, SelectHdl, SvTreeListBox*, pTlb, void ) if(pTlb==m_pTlbStruct) { SvTreeListEntry* pCurEntry=m_pTlbStruct->GetCurEntry(); - if(pCurEntry!=NULL) + if(pCurEntry!=nullptr) { pSelectedToken=static_cast<IFormulaToken *>(pCurEntry->GetUserData()); - if(pSelectedToken!=NULL) + if(pSelectedToken!=nullptr) { if ( !(pSelectedToken->isFunction() || pSelectedToken->getArgumentCount() > 1) ) { diff --git a/formula/source/ui/dlg/structpg.hxx b/formula/source/ui/dlg/structpg.hxx index f150e8a38304..cb8642cbe78e 100644 --- a/formula/source/ui/dlg/structpg.hxx +++ b/formula/source/ui/dlg/structpg.hxx @@ -54,9 +54,9 @@ public: SvTreeListEntry* InsertStaticEntry( const OUString& rText, const Image& rEntryImg, - SvTreeListEntry* pParent = NULL, + SvTreeListEntry* pParent = nullptr, sal_uLong nPos = TREELIST_APPEND, - IFormulaToken* pToken = NULL ); + IFormulaToken* pToken = nullptr ); void SetActiveFlag(bool bFlag=true); bool GetActiveFlag() { return bActiveFlag;} @@ -94,7 +94,7 @@ public: void ClearStruct(); SvTreeListEntry* InsertEntry(const OUString& rText, SvTreeListEntry* pParent, - sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=NULL); + sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=nullptr); OUString GetEntryText(SvTreeListEntry* pEntry) const; diff --git a/formula/source/ui/resource/ModuleHelper.cxx b/formula/source/ui/resource/ModuleHelper.cxx index 8044b84ad15c..de87fa8af07a 100644 --- a/formula/source/ui/resource/ModuleHelper.cxx +++ b/formula/source/ui/resource/ModuleHelper.cxx @@ -55,7 +55,7 @@ public: }; OModuleImpl::OModuleImpl() - :m_pResources(NULL) + :m_pResources(nullptr) { } @@ -87,7 +87,7 @@ namespace struct theOModuleMutex : public rtl::Static< osl::Mutex, theOModuleMutex > {}; } sal_Int32 OModule::s_nClients = 0; -OModuleImpl* OModule::s_pImpl = NULL; +OModuleImpl* OModule::s_pImpl = nullptr; ResMgr* OModule::getResManager() { @@ -109,7 +109,7 @@ void OModule::revokeClient() if (!--s_nClients && s_pImpl) { delete s_pImpl; - s_pImpl = NULL; + s_pImpl = nullptr; } } |