summaryrefslogtreecommitdiff
path: root/basic/source/comp/symtbl.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-18 14:35:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-19 08:30:49 +0200
commit8b0a69498b025e13d9772689e9e4fa3d6b05e609 (patch)
tree5fce654b3e02cd08d85dc95655c97d7181517687 /basic/source/comp/symtbl.cxx
parent5dccf84b14ed0e09262411295c5880f787342d59 (diff)
loplugin:flatten in basic
Change-Id: Icb8e3cda312b50c9a9f12f96bec1c746f41c8979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92483 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/source/comp/symtbl.cxx')
-rw-r--r--basic/source/comp/symtbl.cxx80
1 files changed, 40 insertions, 40 deletions
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index 8385a31a3fdd..00a857abad6a 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -132,39 +132,39 @@ SbiProcDef* SbiSymPool::AddProc( const OUString& rName )
void SbiSymPool::Add( SbiSymDef* pDef )
{
- if( pDef && pDef->pIn != this )
+ if( !(pDef && pDef->pIn != this) )
+ return;
+
+ if( pDef->pIn )
{
- if( pDef->pIn )
- {
#ifdef DBG_UTIL
- pParser->Error( ERRCODE_BASIC_INTERNAL_ERROR, "Dbl Pool" );
+ pParser->Error( ERRCODE_BASIC_INTERNAL_ERROR, "Dbl Pool" );
#endif
- return;
- }
+ return;
+ }
- pDef->nPos = m_Data.size();
- if( !pDef->nId )
+ pDef->nPos = m_Data.size();
+ if( !pDef->nId )
+ {
+ // A unique name must be created in the string pool
+ // for static variables (Form ProcName:VarName)
+ OUString aName( pDef->aName );
+ if( pDef->IsStatic() )
{
- // A unique name must be created in the string pool
- // for static variables (Form ProcName:VarName)
- OUString aName( pDef->aName );
- if( pDef->IsStatic() )
- {
- aName = pParser->aGblStrings.Find( nProcId )
- + ":"
- + pDef->aName;
- }
- pDef->nId = rStrings.Add( aName );
+ aName = pParser->aGblStrings.Find( nProcId )
+ + ":"
+ + pDef->aName;
}
+ pDef->nId = rStrings.Add( aName );
+ }
- if( !pDef->GetProcDef() )
- {
- pDef->nProcId = nProcId;
- }
- pDef->pIn = this;
- m_Data.insert( m_Data.begin() + pDef->nPos, std::unique_ptr<SbiSymDef>(pDef) );
+ if( !pDef->GetProcDef() )
+ {
+ pDef->nProcId = nProcId;
}
+ pDef->pIn = this;
+ m_Data.insert( m_Data.begin() + pDef->nPos, std::unique_ptr<SbiSymDef>(pDef) );
}
@@ -454,24 +454,24 @@ void SbiProcDef::Match( SbiProcDef* pOld )
void SbiProcDef::setPropertyMode( PropertyMode ePropMode )
{
mePropMode = ePropMode;
- if( mePropMode != PropertyMode::NONE )
- {
- // Prop name = original scanned procedure name
- maPropName = aName;
+ if( mePropMode == PropertyMode::NONE )
+ return;
- // CompleteProcName includes "Property xxx "
- // to avoid conflicts with other symbols
- OUString aCompleteProcName = "Property ";
- switch( mePropMode )
- {
- case PropertyMode::Get: aCompleteProcName += "Get "; break;
- case PropertyMode::Let: aCompleteProcName += "Let "; break;
- case PropertyMode::Set: aCompleteProcName += "Set "; break;
- case PropertyMode::NONE: OSL_FAIL( "Illegal PropertyMode PropertyMode::NONE" ); break;
- }
- aCompleteProcName += aName;
- aName = aCompleteProcName;
+ // Prop name = original scanned procedure name
+ maPropName = aName;
+
+ // CompleteProcName includes "Property xxx "
+ // to avoid conflicts with other symbols
+ OUString aCompleteProcName = "Property ";
+ switch( mePropMode )
+ {
+ case PropertyMode::Get: aCompleteProcName += "Get "; break;
+ case PropertyMode::Let: aCompleteProcName += "Let "; break;
+ case PropertyMode::Set: aCompleteProcName += "Set "; break;
+ case PropertyMode::NONE: OSL_FAIL( "Illegal PropertyMode PropertyMode::NONE" ); break;
}
+ aCompleteProcName += aName;
+ aName = aCompleteProcName;
}