summaryrefslogtreecommitdiff
path: root/basic/source/runtime
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-10-18 16:53:18 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-18 16:53:18 +0200
commit7596535983dfe6978d624cf0ff31b40e85e14a6b (patch)
treecd99f6a6122a919634459651a5342963c0073b02 /basic/source/runtime
parentc0d6fa1417141a3a7e9deb2f4d50acc28b32f1b4 (diff)
Simplify some dynamic/static_casts
...that are unnecessarily complicated after the "remove tools/rtti.hxx" commits Change-Id: I570751a1f81c547b50248fe4e2824c5c7c5dd624
Diffstat (limited to 'basic/source/runtime')
-rw-r--r--basic/source/runtime/runtime.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 1d9bacb93f19..67108d849f31 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1885,7 +1885,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
Reference< XInterface > xComListener;
SbxBase* pObj = refVal->GetObject();
- SbUnoObject* pUnoObj = (pObj != nullptr) ? dynamic_cast<SbUnoObject*>( pObj ) : nullptr;
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pObj );
if( pUnoObj != nullptr )
{
Any aControlAny = pUnoObj->getUnoAny();
@@ -3189,10 +3189,12 @@ 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 && nullptr != dynamic_cast<const SbUnoProperty*>( refVal.get() ) )
+ if ( t == SbxEMPTY )
{
- SbUnoProperty* pProp = static_cast<SbUnoProperty*>(pVal);
- t = pProp->getRealType();
+ if ( auto pProp = dynamic_cast<SbUnoProperty*>( refVal.get() ) )
+ {
+ t = pProp->getRealType();
+ }
}
if( t == SbxOBJECT )
{