summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-05-19 11:25:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-05-19 12:53:34 +0200
commit2e51afc77c0800dda6c09bb645d8962ae125b2ba (patch)
tree087dc79cce1eaeedb9556be0953bdda2e8954560 /basic
parent575b457d728531a1cfff95d2eea1887e09d79009 (diff)
loplugin:comparisonwithconstant in basic
Change-Id: Ie34a17d2fb465ffbe675ba4e99917d23959f1fb5 Reviewed-on: https://gerrit.libreoffice.org/37809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/qa/cppunit/basic_coverage.cxx4
-rw-r--r--basic/qa/cppunit/basictest.cxx6
-rw-r--r--basic/source/basmgr/basicmanagerrepository.cxx2
-rw-r--r--basic/source/basmgr/basmgr.cxx2
-rw-r--r--basic/source/classes/eventatt.cxx6
-rw-r--r--basic/source/classes/sb.cxx4
-rw-r--r--basic/source/classes/sbunoobj.cxx4
-rw-r--r--basic/source/classes/sbxmod.cxx4
-rw-r--r--basic/source/comp/codegen.cxx2
-rw-r--r--basic/source/comp/exprgen.cxx2
-rw-r--r--basic/source/comp/sbcomp.cxx2
-rw-r--r--basic/source/runtime/methods.cxx2
-rw-r--r--basic/source/runtime/methods1.cxx4
-rw-r--r--basic/source/runtime/runtime.cxx28
-rw-r--r--basic/source/sbx/sbxcoll.cxx2
-rw-r--r--basic/source/sbx/sbxobj.cxx6
-rw-r--r--basic/source/sbx/sbxvalue.cxx12
17 files changed, 46 insertions, 46 deletions
diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx
index 1f336b482819..bee658a586d5 100644
--- a/basic/qa/cppunit/basic_coverage.cxx
+++ b/basic/qa/cppunit/basic_coverage.cxx
@@ -99,7 +99,7 @@ std::vector< OUString > Coverage::get_subdirnames( const OUString& sDirName )
osl::DirectoryItem aItem;
osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type);
- if(osl::FileBase::E_None == aDir.open())
+ if(aDir.open() == osl::FileBase::E_None)
{
while (aDir.getNextItem(aItem) == osl::FileBase::E_None)
{
@@ -116,7 +116,7 @@ void Coverage::process_directory(const OUString& sDirName)
osl::DirectoryItem aItem;
osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type);
- if(osl::FileBase::E_None == aDir.open())
+ if(aDir.open() == osl::FileBase::E_None)
{
while (aDir.getNextItem(aItem) == osl::FileBase::E_None)
{
diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx
index ebd97d8c7ef4..bedd89e5dacf 100644
--- a/basic/qa/cppunit/basictest.cxx
+++ b/basic/qa/cppunit/basictest.cxx
@@ -49,15 +49,15 @@ void MacroSnippet::LoadSourceFromFile( const OUString& sMacroFileURL )
fprintf(stderr,"loadSource opening macro file %s\n", OUStringToOString( sMacroFileURL, RTL_TEXTENCODING_UTF8 ).getStr() );
osl::File aFile(sMacroFileURL);
- if(osl::FileBase::E_None == aFile.open(osl_File_OpenFlag_Read))
+ if(aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None)
{
sal_uInt64 size;
sal_uInt64 size_read;
- if(osl::FileBase::E_None == aFile.getSize(size))
+ if(aFile.getSize(size) == osl::FileBase::E_None)
{
void* buffer = calloc(1, size+1);
CPPUNIT_ASSERT(buffer);
- if(osl::FileBase::E_None == aFile.read( buffer, size, size_read))
+ if(aFile.read( buffer, size, size_read) == osl::FileBase::E_None)
{
if(size == size_read)
{
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index 711210c33a0a..be1e1ca4edb9 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -445,7 +445,7 @@ namespace basic
for(const auto& rError : aErrors)
{
// show message to user
- if ( DialogMask::ButtonsCancel == ErrorHandler::HandleError( rError.GetErrorId() ) )
+ if ( ErrorHandler::HandleError( rError.GetErrorId() ) == DialogMask::ButtonsCancel )
{
// user wants to break loading of BASIC-manager
delete _out_rpBasicManager;
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 4acd754113ff..cd9774b84ff0 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1536,7 +1536,7 @@ namespace
bool BasicManager::HasMacro( OUString const& i_fullyQualifiedName ) const
{
- return ( nullptr != lcl_queryMacro( const_cast< BasicManager* >( this ), i_fullyQualifiedName ) );
+ return ( lcl_queryMacro( const_cast< BasicManager* >( this ), i_fullyQualifiedName ) != nullptr );
}
ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue )
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index eea4b67060eb..4e65c7a289fb 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -279,7 +279,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
}
// Default: Be tolerant and search everywhere
- if( (!pMethVar || nullptr == dynamic_cast<const SbMethod*>( pMethVar)) && maBasicRef.is() )
+ if( (!pMethVar || dynamic_cast<const SbMethod*>( pMethVar) == nullptr) && maBasicRef.is() )
{
pMethVar = maBasicRef->FindQualified( aMacro, SbxClassType::DontCare );
}
@@ -328,7 +328,7 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog
css::uno::Reference< css::container::XNameContainer > aRetDlgLib;
SbxVariable* pDlgLibContVar = pBasic->Find("DialogLibraries", SbxClassType::Object);
- if( pDlgLibContVar && nullptr != dynamic_cast<const SbUnoObject*>( pDlgLibContVar) )
+ if( pDlgLibContVar && dynamic_cast<const SbUnoObject*>( pDlgLibContVar) != nullptr )
{
SbUnoObject* pDlgLibContUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pDlgLibContVar));
Any aDlgLibContAny = pDlgLibContUnoObj->getUnoAny();
@@ -427,7 +427,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
// Get dialog
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
- if( !(pObj.is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj.get() )) )
+ if( !(pObj.is() && dynamic_cast<const SbUnoObject*>( pObj.get() ) != nullptr) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index c3e0a63c2668..913d94967aad 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1256,7 +1256,7 @@ void StarBASIC::DeInitAllModules()
// Deinit own modules
for (const auto& pModule: pModules)
{
- if( pModule->pImage && !pModule->isProxyModule() && nullptr == dynamic_cast<SbObjModule*>( pModule.get()) )
+ if( pModule->pImage && !pModule->isProxyModule() && dynamic_cast<SbObjModule*>( pModule.get()) == nullptr )
{
pModule->pImage->bInit = false;
}
@@ -1853,7 +1853,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
{
return false;
}
- else if( nullptr != dynamic_cast<const SbJScriptModule*>( pMod) )
+ else if( dynamic_cast<const SbJScriptModule*>( pMod) != nullptr )
{
// assign Ref, so that pMod will be deleted
SbModuleRef xRef = pMod;
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 43573250de0c..c35f96425659 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -995,7 +995,7 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType
if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) )
return aRetAny;
}
- if( nullptr == dynamic_cast<const SbUnoObject*>( xObj.get() ) )
+ if( dynamic_cast<const SbUnoObject*>( xObj.get() ) == nullptr )
{
// Create NativeObjectWrapper to identify object in case of callbacks
SbxObject* pObj = dynamic_cast<SbxObject*>( pVar->GetObject() );
@@ -4246,7 +4246,7 @@ ModuleInvocationProxy::ModuleInvocationProxy( const OUString& aPrefix, SbxObject
, m_xScopeObj( xScopeObj )
, m_aListeners( m_aMutex )
{
- m_bProxyIsClassModuleObject = xScopeObj.is() && nullptr != dynamic_cast<const SbClassModuleObject*>( xScopeObj.get() );
+ m_bProxyIsClassModuleObject = xScopeObj.is() && dynamic_cast<const SbClassModuleObject*>( xScopeObj.get() ) != nullptr;
}
Reference< XIntrospectionAccess > SAL_CALL ModuleInvocationProxy::getIntrospection()
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 9f74c7415172..f5b63ce1a669 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1321,7 +1321,7 @@ void SbModule::ClearPrivateVars()
void SbModule::implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic )
{
- if( pVar->SbxValue::GetType() != SbxOBJECT || nullptr != dynamic_cast<const SbProcedureProperty*>( pVar) )
+ if( pVar->SbxValue::GetType() != SbxOBJECT || dynamic_cast<const SbProcedureProperty*>( pVar) != nullptr )
return;
SbxObject* pObj = dynamic_cast<SbxObject*>( pVar->GetObject() );
@@ -1380,7 +1380,7 @@ void StarBASIC::ClearAllModuleVars()
for (const auto& rModule: pModules)
{
// Initialise only, if the startcode was already executed
- if( rModule->pImage && rModule->pImage->bInit && !rModule->isProxyModule() && nullptr == dynamic_cast<const SbObjModule*>( rModule.get()) )
+ if( rModule->pImage && rModule->pImage->bInit && !rModule->isProxyModule() && dynamic_cast<const SbObjModule*>( rModule.get()) == nullptr )
rModule->ClearPrivateVars();
}
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index a3acf6732b9f..fee812fead44 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -205,7 +205,7 @@ void SbiCodeGen::Save()
{
const OUString& rIfaceName = pParser->aIfaceVector[i];
int nFound = aPureProcName.indexOf( rIfaceName );
- if( nFound == 0 && '_' == aPureProcName[rIfaceName.getLength()] )
+ if( nFound == 0 && aPureProcName[rIfaceName.getLength()] == '_' )
{
if( nPropPrefixFound == 0 )
{
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index 1b0638881bce..befb063cdde2 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -87,7 +87,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode )
if( aVar.pDef->GetScope() == SbPARAM )
{
eOp = SbiOpcode::PARAM_;
- if( 0 == aVar.pDef->GetPos() )
+ if( aVar.pDef->GetPos() == 0 )
{
bool bTreatFunctionAsParam = true;
if( eRecMode == FORCE_CALL )
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index bdddbc4e2ec6..6e1bf2a8f8bc 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -58,7 +58,7 @@ bool SbModule::Compile()
bool bRet = IsCompiled();
if( bRet )
{
- if( nullptr == dynamic_cast<const SbObjModule*>( this) )
+ if( dynamic_cast<const SbObjModule*>( this) == nullptr )
pBasic->ClearAllModuleVars();
RemoveVars(); // remove 'this' Modules variables
// clear all method statics
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 42c4a4703364..a2c3e6ce940a 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2601,7 +2601,7 @@ RTLFUNC(IsObject)
SbUnoClass* pUnoClass;
bool bObject;
- if( pObj && nullptr != ( pUnoClass=dynamic_cast<SbUnoClass*>( pObj) ) )
+ if( pObj && ( pUnoClass=dynamic_cast<SbUnoClass*>( pObj) ) != nullptr )
{
bObject = pUnoClass->getUnoClass().is();
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index f3502fe3465a..021e7f21b950 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -125,7 +125,7 @@ RTLFUNC(CallByName)
SbxObject* pObj = nullptr;
if( pObjVar )
pObj = dynamic_cast<SbxObject*>( pObjVar );
- if( !pObj && pObjVar && nullptr != dynamic_cast<const SbxVariable*>( pObjVar) )
+ if( !pObj && pObjVar && dynamic_cast<const SbxVariable*>( pObjVar) != nullptr )
{
SbxBase* pObjVarObj = static_cast<SbxVariable*>(pObjVar)->GetObject();
pObj = dynamic_cast<SbxObject*>( pObjVarObj );
@@ -957,7 +957,7 @@ RTLFUNC(FindPropertyObject)
{
pObj = dynamic_cast<SbxObject*>( pObjVar );
}
- if( !pObj && pObjVar && nullptr != dynamic_cast<const SbxVariable*>( pObjVar) )
+ if( !pObj && pObjVar && dynamic_cast<const SbxVariable*>( pObjVar) != nullptr )
{
SbxBase* pObjVarObj = static_cast<SbxVariable*>(pObjVar)->GetObject();
pObj = dynamic_cast<SbxObject*>( pObjVarObj );
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 5314e8f413c7..7b8761cc750f 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -833,7 +833,7 @@ bool SbiRuntime::Step()
// there's no error handler -> find one farther above
SbiRuntime* pRtErrHdl = nullptr;
SbiRuntime* pRt = this;
- while( nullptr != (pRt = pRt->pNext) )
+ while( (pRt = pRt->pNext) != nullptr )
{
if( !pRt->bError || pRt->pError != nullptr )
{
@@ -1587,11 +1587,11 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
return false;
}
// #115826: Exclude ProcedureProperties to avoid call to Property Get procedure
- else if( nullptr != dynamic_cast<const SbProcedureProperty*>( refVar.get() ) )
+ else if( dynamic_cast<const SbProcedureProperty*>( refVar.get() ) != nullptr )
return false;
SbxObjectRef xValObj = static_cast<SbxObject*>(refVal->GetObject());
- if( !xValObj.is() || nullptr != dynamic_cast<const SbUnoAnyObject*>( xValObj.get() ) )
+ if( !xValObj.is() || dynamic_cast<const SbUnoAnyObject*>( xValObj.get() ) != nullptr )
return false;
SbUnoObject* pUnoVal = dynamic_cast<SbUnoObject*>( xValObj.get() );
@@ -1902,7 +1902,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
}
if ( bDimAsNew )
{
- if( nullptr == dynamic_cast<const SbxObject*>( refVar.get() ) )
+ if( dynamic_cast<const SbxObject*>( refVar.get() ) == nullptr )
{
SbxBase* pValObjBase = refVal->GetObject();
if( pValObjBase == nullptr )
@@ -2387,9 +2387,9 @@ void SbiRuntime::StepARGV()
SbxVariableRef pVal = PopVar();
// Before fix of #94916:
- if( nullptr != dynamic_cast<const SbxMethod*>( pVal.get() )
- || nullptr != dynamic_cast<const SbUnoProperty*>( pVal.get() )
- || nullptr != dynamic_cast<const SbProcedureProperty*>( pVal.get() ) )
+ if( dynamic_cast<const SbxMethod*>( pVal.get() ) != nullptr
+ || dynamic_cast<const SbUnoProperty*>( pVal.get() ) != nullptr
+ || dynamic_cast<const SbProcedureProperty*>( pVal.get() ) != nullptr )
{
// evaluate methods and properties!
SbxVariable* pRes = new SbxVariable( *pVal );
@@ -2797,9 +2797,9 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 )
OUString aAlias( pImg->GetString( static_cast<short>( nOp1 ) ) );
SbxVariableRef pVal = PopVar();
if( bVBAEnabled &&
- ( nullptr != dynamic_cast<const SbxMethod*>( pVal.get())
- || nullptr != dynamic_cast<const SbUnoProperty*>( pVal.get())
- || nullptr != dynamic_cast<const SbProcedureProperty*>( pVal.get()) ) )
+ ( dynamic_cast<const SbxMethod*>( pVal.get()) != nullptr
+ || dynamic_cast<const SbUnoProperty*>( pVal.get()) != nullptr
+ || dynamic_cast<const SbProcedureProperty*>( pVal.get()) != nullptr ) )
{
// named variables ( that are Any especially properties ) can be empty at this point and need a broadcast
if ( pVal->GetType() == SbxEMPTY )
@@ -3531,7 +3531,7 @@ 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 && nullptr != dynamic_cast<const SbUnoProperty*>( pElem) && pElem->GetParameters() )
+ else if( bVBAEnabled && dynamic_cast<const SbUnoProperty*>( pElem) != nullptr && pElem->GetParameters() )
{
SbxVariableRef refTemp = pElem;
@@ -3665,7 +3665,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
}
}
}
- else if( bVBAEnabled && p->GetType() == SbxOBJECT && (nullptr == dynamic_cast<const SbxMethod*>( p) || !p->IsBroadcaster()) )
+ else if( bVBAEnabled && p->GetType() == SbxOBJECT && (dynamic_cast<const SbxMethod*>( p) == nullptr || !p->IsBroadcaster()) )
{
// Check for default method with named parameters
SbxBaseRef xObj = p->GetObject();
@@ -3787,8 +3787,8 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
// consider index-access for UnoObjects
else if( pElem->GetType() == SbxOBJECT &&
- nullptr == dynamic_cast<const SbxMethod*>( pElem) &&
- ( !bVBAEnabled || nullptr == dynamic_cast<const SbxProperty*>( pElem) ) )
+ dynamic_cast<const SbxMethod*>( pElem) == nullptr &&
+ ( !bVBAEnabled || dynamic_cast<const SbxProperty*>( pElem) == nullptr ) )
{
pPar = pElem->GetParameters();
if ( pPar )
diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx
index 690cbc2ec2bd..af752516baea 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -170,7 +170,7 @@ void SbxCollection::CollAdd( SbxArray* pPar_ )
else
{
SbxBase* pObj = pPar_->Get( 1 )->GetObject();
- if( !pObj || !( nullptr != dynamic_cast<const SbxObject*>( pObj) ) )
+ if( !pObj || dynamic_cast<const SbxObject*>(pObj) == nullptr )
{
SetError( ERRCODE_SBX_NOTIMP );
}
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 7763e96d90bf..ece89f5862be 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -288,7 +288,7 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t )
bool SbxObject::Call( const OUString& rName, SbxArray* pParam )
{
SbxVariable* pMeth = FindQualified( rName, SbxClassType::DontCare);
- if( pMeth && nullptr != dynamic_cast<const SbxMethod*>( pMeth) )
+ if( pMeth && dynamic_cast<const SbxMethod*>( pMeth) != nullptr )
{
// FindQualified() might have struck already!
if( pParam )
@@ -384,7 +384,7 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp
return nullptr;
}
// Collections may contain objects of the same name
- if( !( ct == SbxClassType::Object && nullptr != dynamic_cast<const SbxCollection*>( this ) ) )
+ if( !( ct == SbxClassType::Object && dynamic_cast<const SbxCollection*>( this ) != nullptr ) )
{
SbxVariable* pRes = pArray->Find( rName, ct );
if( pRes )
@@ -428,7 +428,7 @@ void SbxObject::Insert( SbxVariable* pVar )
{
// Then this element exists already
// There are objects of the same name allowed at collections
- if( pArray == pObjs.get() && nullptr != dynamic_cast<const SbxCollection*>( this ) )
+ if( pArray == pObjs.get() && dynamic_cast<const SbxCollection*>( this ) != nullptr )
{
nIdx = pArray->Count();
}
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index f4bc90578e96..bca0f80f8d2f 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -156,8 +156,8 @@ void SbxValue::Clear()
{
SAL_INFO("basic.sbx", "Not at Parent-Prop - otherwise CyclicRef");
SbxVariable *pThisVar = dynamic_cast<SbxVariable*>( this );
- bool bParentProp = pThisVar && 5345 ==
- static_cast<sal_uInt16>(pThisVar->GetUserData());
+ bool bParentProp = pThisVar && static_cast<sal_uInt16>(pThisVar->GetUserData()) ==
+ 5345;
if ( !bParentProp )
aData.pObj->ReleaseRef();
}
@@ -497,8 +497,8 @@ bool SbxValue::Put( const SbxValues& rVal )
}
SAL_INFO("basic.sbx", "Not at Parent-Prop - otherwise CyclicRef");
SbxVariable *pThisVar = dynamic_cast<SbxVariable*>( this );
- bool bParentProp = pThisVar && 5345 ==
- static_cast<sal_uInt16>(pThisVar->GetUserData());
+ bool bParentProp = pThisVar && static_cast<sal_uInt16>(pThisVar->GetUserData()) ==
+ 5345;
if ( !bParentProp )
p->aData.pObj->AddFirstRef();
}
@@ -688,7 +688,7 @@ bool SbxValue::ImpIsNumeric( bool bOnlyIntntl ) const
return false;
}
// Test downcast!!!
- if( nullptr != dynamic_cast<const SbxVariable*>( this) )
+ if( dynamic_cast<const SbxVariable*>( this) != nullptr )
const_cast<SbxVariable*>(static_cast<const SbxVariable*>(this))->Broadcast( SfxHintId::BasicDataWanted );
SbxDataType t = GetType();
if( t == SbxSTRING )
@@ -763,7 +763,7 @@ bool SbxValue::SetType( SbxDataType t )
: 0;
DBG_ASSERT( nSlotId != 5345 || pThisVar->GetName() == "Parent",
"SID_PARENTOBJECT is not named 'Parent'" );
- bool bParentProp = 5345 == nSlotId;
+ bool bParentProp = nSlotId == 5345;
if ( !bParentProp )
aData.pObj->ReleaseRef();
}