summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-10 13:58:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-10 14:59:31 +0100
commit8f453c674f19188360ba5895c2bd9bd80273a83b (patch)
treece569bb8caeaea0b110e1e23e845716cb841588f /basic
parentc5367ee0a60966b755e726de6d175dfcd1630741 (diff)
static_cast after dynamic_cast
Change-Id: I3792ddadad9582a7e6f4740829c081d9571ddaff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109049 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sb.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 2fda33fffebf..4ebab52ee2c4 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1047,9 +1047,9 @@ SbModule* StarBASIC::MakeModule( const OUString& rName, const ModuleInfo& mInfo,
void StarBASIC::Insert( SbxVariable* pVar )
{
- if( dynamic_cast<const SbModule*>(pVar) != nullptr)
+ if( auto pModule = dynamic_cast<SbModule*>(pVar) )
{
- pModules.emplace_back(static_cast<SbModule*>(pVar));
+ pModules.emplace_back(pModule);
pVar->SetParent( this );
StartListening(pVar->GetBroadcaster(), DuplicateHandling::Prevent);
}