diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-06 20:40:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-07 13:22:28 +0100 |
commit | e4e80ed313882f9ea1b309054e5aa3e839586516 (patch) | |
tree | 0d7e44c4456933d7e946a28c8f8d780372a4334f /sc/source/core/tool | |
parent | 4c86b07f80740d609f1a1b04b9f53b19782be036 (diff) |
loplugin:staticdynamic now with extra salt
because it wasn't quite there yet - now checks for casts with and
without const, because const doesn't really matter here.
Change-Id: I319025b2095a803fcaad2a7a696d2730b7fd2f81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112098
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index e71f5ebfe2fa..08c1c218748d 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3225,14 +3225,19 @@ void ScInterpreter::ScMacro() } SbxVariable* pVar = pRoot ? pRoot->Find(aMacro, SbxClassType::Method) : nullptr; - if( !pVar || pVar->GetType() == SbxVOID || dynamic_cast<const SbMethod*>( pVar) == nullptr ) + if( !pVar || pVar->GetType() == SbxVOID ) + { + PushError( FormulaError::NoMacro ); + return; + } + SbMethod* pMethod = dynamic_cast<SbMethod*>(pVar); + if( !pMethod ) { PushError( FormulaError::NoMacro ); return; } bool bVolatileMacro = false; - SbMethod* pMethod = static_cast<SbMethod*>(pVar); SbModule* pModule = pMethod->GetModule(); bool bUseVBAObjects = pModule->IsVBACompat(); |