diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-03 09:07:25 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-03 20:24:28 -0500 |
commit | d92814f462432b52b1ef4d0dc335d22af881397b (patch) | |
tree | b5d9c03dae16bc2b19ad36f2f3894f723b1b8231 /basic/source/comp/symtbl.cxx | |
parent | 4316e643ef345b0f673b4a03a80a4b7cb3185588 (diff) |
basic: preliminary cosmetic clean-up
parsing 1000s of line of code is hard enough without having to fight
with weird indentation and irregular formatting.
So as the review progress, in order to follow the code, cosmetic changes
were made...
In order to minimize the task of the reviewers and allow them to
concentrate on what matter, an effort is made to collect these
cosmetic changes into this separate commit.
Change-Id: I3c9b04a0150d0d0a048c2e976fe24de4f2b6b98a
Diffstat (limited to 'basic/source/comp/symtbl.cxx')
-rw-r--r-- | basic/source/comp/symtbl.cxx | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 395f19aa24ca..4c550497a423 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -168,7 +168,9 @@ void SbiSymPool::Add( SbiSymDef* pDef ) } if( !pDef->GetProcDef() ) + { pDef->nProcId = nProcId; + } pDef->pIn = this; aData.insert( aData.begin() + pDef->nPos, pDef ); } @@ -186,9 +188,13 @@ SbiSymDef* SbiSymPool::Find( const String& rName ) const return p; } if( pParent ) + { return pParent->Find( rName ); + } else + { return NULL; + } } @@ -198,12 +204,18 @@ SbiSymDef* SbiSymPool::FindId( sal_uInt16 n ) const { SbiSymDef* p = aData[ i ]; if( p->nId == n && ( !p->nProcId || ( p->nProcId == nProcId ) ) ) + { return p; + } } if( pParent ) + { return pParent->FindId( n ); + } else + { return NULL; + } } // find via position (from 0) @@ -211,20 +223,29 @@ SbiSymDef* SbiSymPool::FindId( sal_uInt16 n ) const SbiSymDef* SbiSymPool::Get( sal_uInt16 n ) const { if( n >= aData.size() ) + { return NULL; + } else + { return aData[ n ]; + } } sal_uInt32 SbiSymPool::Define( const String& rName ) { SbiSymDef* p = Find( rName ); if( p ) - { if( p->IsDefined() ) + { + if( p->IsDefined() ) + { pParser->Error( SbERR_LABEL_DEFINED, rName ); + } } else + { p = AddSym( rName ); + } return p->Define(); } @@ -232,7 +253,9 @@ sal_uInt32 SbiSymPool::Reference( const String& rName ) { SbiSymDef* p = Find( rName ); if( !p ) + { p = AddSym( rName ); + } // to be sure pParser->aGen.GenStmnt(); return p->Reference(); @@ -245,7 +268,9 @@ void SbiSymPool::CheckRefs() { SbiSymDef* p = aData[ i ]; if( !p->IsDefined() ) + { pParser->Error( SbERR_UNDEF_LABEL, p->GetName() ); + } } } @@ -300,7 +325,9 @@ SbiConstDef* SbiSymDef::GetConstDef() const String& SbiSymDef::GetName() { if( pIn ) + { aName = pIn->rStrings.Find( nId ); + } return aName; } @@ -354,7 +381,9 @@ sal_uInt32 SbiSymDef::Define() SbiSymPool& SbiSymDef::GetPool() { if( !pPool ) + { pPool = new SbiSymPool( pIn->pParser->aGblStrings, SbLOCAL ); // is dumped + } return *pPool; } @@ -422,7 +451,9 @@ void SbiProcDef::Match( SbiProcDef* pOld ) // no type matching - that is done during running // but is it maybe called with too little parameters? if( !po && !pn->IsOptional() && !pn->IsParamArray() ) + { break; + } po = pOld->aParams.Next(); } @@ -498,7 +529,9 @@ SbiConstDef* SbiConstDef::GetConstDef() SbiSymbols::~SbiSymbols() { for( const_iterator it = begin(); it != end(); ++it ) + { delete *it; + } }; |