Coverity: Unchecked dynamic_cast
This commit is contained in:
@@ -293,6 +293,9 @@ void QGILeaderLine::startPathEdit(void)
|
||||
{
|
||||
saveState();
|
||||
auto featLeader( dynamic_cast<TechDraw::DrawLeaderLine*>(getViewObject()) );
|
||||
if (featLeader == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
double scale = featLeader->getScale();
|
||||
m_editPath->setScale(scale);
|
||||
|
||||
@@ -463,6 +463,9 @@ void QGIViewBalloon::balloonLabelDragged(bool ctrl)
|
||||
// Base::Console().Message("QGIVB::bLabelDragged(%d)\n", ctrl);
|
||||
m_ctrl = ctrl;
|
||||
auto dvb( dynamic_cast<TechDraw::DrawViewBalloon *>(getViewObject()) );
|
||||
if (dvb == nullptr)
|
||||
return;
|
||||
|
||||
if (!m_dragInProgress) { //first drag movement
|
||||
m_dragInProgress = true;
|
||||
if (ctrl) { //moving whole thing, remember Origin offset from Bubble
|
||||
|
||||
@@ -685,7 +685,7 @@ bool QGIViewPart::formatGeomFromCosmetic(std::string cTag, QGIEdge* item)
|
||||
// Base::Console().Message("QGIVP::formatGeomFromCosmetic(%s)\n", cTag.c_str());
|
||||
bool result = true;
|
||||
auto partFeat( dynamic_cast<TechDraw::DrawViewPart *>(getViewObject()) );
|
||||
TechDraw::CosmeticEdge* ce = partFeat->getCosmeticEdge(cTag);
|
||||
TechDraw::CosmeticEdge* ce = partFeat ? partFeat->getCosmeticEdge(cTag) : nullptr;
|
||||
if (ce != nullptr) {
|
||||
item->setNormalColor(ce->m_format.m_color.asValue<QColor>());
|
||||
item->setWidth(ce->m_format.m_weight * lineScaleFactor);
|
||||
@@ -701,7 +701,7 @@ bool QGIViewPart::formatGeomFromCenterLine(std::string cTag, QGIEdge* item)
|
||||
// Base::Console().Message("QGIVP::formatGeomFromCenterLine(%d)\n",sourceIndex);
|
||||
bool result = true;
|
||||
auto partFeat( dynamic_cast<TechDraw::DrawViewPart *>(getViewObject()) );
|
||||
TechDraw::CenterLine* cl = partFeat->getCenterLine(cTag);
|
||||
TechDraw::CenterLine* cl = partFeat ? partFeat->getCenterLine(cTag) : nullptr;
|
||||
if (cl != nullptr) {
|
||||
item->setNormalColor(cl->m_format.m_color.asValue<QColor>());
|
||||
item->setWidth(cl->m_format.m_weight * lineScaleFactor);
|
||||
|
||||
Reference in New Issue
Block a user