Skip to content
Snippets Groups Projects
Commit d15bfe37 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

rm unnecessary dynamic casts

parent 413220b7
No related branches found
No related tags found
1 merge request!449Minor corrections (from threads in MR 447)
Pipeline #49162 passed
......@@ -145,21 +145,21 @@ void ParticleCoreShellForm::onShellComboChanged()
void ParticleCoreShellForm::showCoreInRealSpace()
{
if (ParticleItem* particle = dynamic_cast<ParticleItem*>(m_item->core()))
m_ec->requestViewInRealSpace(particle);
if (m_item->core())
m_ec->requestViewInRealSpace(m_item->core());
}
void ParticleCoreShellForm::showShellInRealSpace()
{
if (ParticleItem* particle = dynamic_cast<ParticleItem*>(m_item->shell()))
m_ec->requestViewInRealSpace(particle);
if (m_item->shell())
m_ec->requestViewInRealSpace(m_item->shell());
}
void ParticleCoreShellForm::createCoreWidgets()
{
QString groupTitle = "Core";
if (ParticleItem* particle = dynamic_cast<ParticleItem*>(m_item->core())) {
if (ParticleItem* particle = m_item->core()) {
const QString formFactor =
particle->formFactorItem()->value().value<ComboProperty>().getValue();
......@@ -178,7 +178,7 @@ void ParticleCoreShellForm::createShellWidgets()
{
QString groupTitle = "Shell";
if (ParticleItem* particle = dynamic_cast<ParticleItem*>(m_item->shell())) {
if (ParticleItem* particle = m_item->shell()) {
const QString formFactor =
particle->formFactorItem()->value().value<ComboProperty>().getValue();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment