fix scan coverity issues: unchecked dynamic_cast

This commit is contained in:
wmayer
2017-04-11 12:45:02 +02:00
parent 09dfcf6bd7
commit 292fdebe49
6 changed files with 20 additions and 15 deletions

View File

@@ -175,6 +175,9 @@ void CmdTechDrawNewGeomHatch::activated(int iMsg)
geomhatch->Source.setValue(objFeat, subNames);
Gui::ViewProvider* vp = Gui::Application::Instance->getDocument(getDocument())->getViewProvider(geomhatch);
TechDrawGui::ViewProviderGeomHatch* hvp = dynamic_cast<TechDrawGui::ViewProviderGeomHatch*>(vp);
if( hvp == nullptr ) {
return;
}
// if (!hvp) {
// dialog to fill in hatch values

View File

@@ -115,6 +115,8 @@ void QGIViewImage::draw()
}
auto viewImage( dynamic_cast<TechDraw::DrawViewImage*>(getViewObject()) );
if (!viewImage)
return;
QRectF newRect(0.0,0.0,Rez::guiX(viewImage->Width.getValue()),Rez::guiX(viewImage->Height.getValue()));
double pad = Rez::guiX(1.0);
m_cliparea->setRect(newRect.adjusted(-pad,-pad,pad,pad));