TechDraw: Fix some Coverity Unchecked dynamic_cast
CIDs from sasobadovinac-FreeCAD: 151684 151714 151715 151716 151718 151719 151720 151721 151722 151724 151725 151730 151749 151759 151771 151794
This commit is contained in:
parent
66bd0f6b90
commit
34583fad05
|
@ -217,15 +217,11 @@ void DrawProjGroup::moveToCentre(void)
|
||||||
|
|
||||||
App::DocumentObject * DrawProjGroup::getProjObj(const char *viewProjType) const
|
App::DocumentObject * DrawProjGroup::getProjObj(const char *viewProjType) const
|
||||||
{
|
{
|
||||||
const std::vector<App::DocumentObject *> &views = Views.getValues();
|
for( auto it : Views.getValues() ) {
|
||||||
for(std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
auto projPtr( dynamic_cast<DrawProjGroupItem *>(it) );
|
||||||
|
if( projPtr &&
|
||||||
DrawView *view = dynamic_cast<DrawView *>(*it);
|
strcmp(viewProjType, projPtr->Type.getValueAsString()) == 0 ) {
|
||||||
if(view->getTypeId() == DrawProjGroupItem::getClassTypeId()) {
|
return it;
|
||||||
DrawProjGroupItem *projPtr = dynamic_cast<DrawProjGroupItem *>(*it);
|
|
||||||
|
|
||||||
if( strcmp(viewProjType, projPtr->Type.getValueAsString()) == 0 )
|
|
||||||
return *it;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,19 +230,12 @@ App::DocumentObject * DrawProjGroup::getProjObj(const char *viewProjType) const
|
||||||
|
|
||||||
bool DrawProjGroup::hasProjection(const char *viewProjType) const
|
bool DrawProjGroup::hasProjection(const char *viewProjType) const
|
||||||
{
|
{
|
||||||
const std::vector<App::DocumentObject *> &views = Views.getValues();
|
for( const auto it : Views.getValues() ) {
|
||||||
|
auto view( dynamic_cast<TechDraw::DrawProjGroupItem *>(it) );
|
||||||
for(std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
if( view && strcmp(viewProjType, view->Type.getValueAsString()) == 0 ) {
|
||||||
|
|
||||||
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(*it);
|
|
||||||
if(view->getTypeId() == TechDraw::DrawProjGroupItem::getClassTypeId()) {
|
|
||||||
TechDraw::DrawProjGroupItem *projPtr = dynamic_cast<TechDraw::DrawProjGroupItem *>(*it);
|
|
||||||
|
|
||||||
if( strcmp(viewProjType, projPtr->Type.getValueAsString()) == 0 ) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,14 +258,14 @@ bool DrawProjGroup::checkViewProjType(const char *in)
|
||||||
|
|
||||||
App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
|
App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
|
||||||
{
|
{
|
||||||
DrawProjGroupItem *view = NULL;
|
DrawProjGroupItem *view( nullptr );
|
||||||
|
|
||||||
if ( checkViewProjType(viewProjType) && !hasProjection(viewProjType) ) {
|
if ( checkViewProjType(viewProjType) && !hasProjection(viewProjType) ) {
|
||||||
std::string FeatName = getDocument()->getUniqueObjectName("ProjItem");
|
std::string FeatName = getDocument()->getUniqueObjectName("ProjItem");
|
||||||
App::DocumentObject *docObj = getDocument()->addObject("TechDraw::DrawProjGroupItem",
|
auto docObj( getDocument()->addObject( "TechDraw::DrawProjGroupItem",
|
||||||
FeatName.c_str());
|
FeatName.c_str() ) );
|
||||||
|
|
||||||
view = dynamic_cast<TechDraw::DrawProjGroupItem *>( docObj );
|
view = static_cast<TechDraw::DrawProjGroupItem *>( docObj );
|
||||||
view->Source.setValue( Source.getValue() );
|
view->Source.setValue( Source.getValue() );
|
||||||
view->ScaleType.setValue( ScaleType.getValue() );
|
view->ScaleType.setValue( ScaleType.getValue() );
|
||||||
view->Scale.setValue( Scale.getValue() );
|
view->Scale.setValue( Scale.getValue() );
|
||||||
|
@ -356,18 +345,14 @@ int DrawProjGroup::removeProjection(const char *viewProjType)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate through the child views and find the projection type
|
// Iterate through the child views and find the projection type
|
||||||
const std::vector<App::DocumentObject *> &views = Views.getValues();
|
for( auto it : Views.getValues() ) {
|
||||||
for(std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
auto projPtr( dynamic_cast<TechDraw::DrawProjGroupItem *>(it) );
|
||||||
|
if( projPtr ) {
|
||||||
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(*it);
|
|
||||||
if(view->getTypeId() == TechDraw::DrawProjGroupItem::getClassTypeId()) {
|
|
||||||
TechDraw::DrawProjGroupItem *projPtr = dynamic_cast<TechDraw::DrawProjGroupItem *>(*it);
|
|
||||||
|
|
||||||
if ( strcmp(viewProjType, projPtr->Type.getValueAsString()) == 0 ) {
|
if ( strcmp(viewProjType, projPtr->Type.getValueAsString()) == 0 ) {
|
||||||
// Remove from the document
|
// Remove from the document
|
||||||
getDocument()->remObject((*it)->getNameInDocument());
|
getDocument()->remObject( it->getNameInDocument() );
|
||||||
moveToCentre();
|
moveToCentre();
|
||||||
return views.size();
|
return Views.getValues().size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -382,7 +367,7 @@ void DrawProjGroup::arrangeViewPointers(DrawProjGroupItem *viewPtrs[10]) const
|
||||||
viewPtrs[i] = NULL;
|
viewPtrs[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawProjGroupItem *anchorView = dynamic_cast<DrawProjGroupItem *>(Anchor.getValue());
|
auto anchorView( dynamic_cast<DrawProjGroupItem *>(Anchor.getValue()) );
|
||||||
|
|
||||||
if (!anchorView) { //TODO: Consider not requiring an anchor view, or allowing ones other than "Front"
|
if (!anchorView) { //TODO: Consider not requiring an anchor view, or allowing ones other than "Front"
|
||||||
throw Base::Exception("No anchor view set in DrawProjGroup::arrangeViewPointers()");
|
throw Base::Exception("No anchor view set in DrawProjGroup::arrangeViewPointers()");
|
||||||
|
@ -397,8 +382,6 @@ void DrawProjGroup::arrangeViewPointers(DrawProjGroupItem *viewPtrs[10]) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate through views and populate viewPtrs
|
// Iterate through views and populate viewPtrs
|
||||||
DrawProjGroupItem* oView;
|
|
||||||
std::vector<App::DocumentObject *> views = Views.getValues();
|
|
||||||
if ( strcmp(projType, "Third Angle") == 0 ||
|
if ( strcmp(projType, "Third Angle") == 0 ||
|
||||||
strcmp(projType, "First Angle") == 0 ) {
|
strcmp(projType, "First Angle") == 0 ) {
|
||||||
// Third Angle: FTL T FTRight
|
// Third Angle: FTL T FTRight
|
||||||
|
@ -409,10 +392,9 @@ void DrawProjGroup::arrangeViewPointers(DrawProjGroupItem *viewPtrs[10]) const
|
||||||
// Right F L Rear
|
// Right F L Rear
|
||||||
// FTRight T FTL
|
// FTRight T FTL
|
||||||
bool thirdAngle = (strcmp(projType, "Third Angle") == 0);
|
bool thirdAngle = (strcmp(projType, "Third Angle") == 0);
|
||||||
for (std::vector<App::DocumentObject*>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
for (auto it : Views.getValues()) {
|
||||||
if ((*it)->getTypeId().isDerivedFrom(DrawProjGroupItem::getClassTypeId())) {
|
auto oView( dynamic_cast<DrawProjGroupItem *>(it) );
|
||||||
oView = dynamic_cast<DrawProjGroupItem *>(*it);
|
if (oView) {
|
||||||
|
|
||||||
const char *viewTypeCStr = oView->Type.getValueAsString();
|
const char *viewTypeCStr = oView->Type.getValueAsString();
|
||||||
if (strcmp(viewTypeCStr, "Front") == 0) {
|
if (strcmp(viewTypeCStr, "Front") == 0) {
|
||||||
viewPtrs[thirdAngle ? 4 : 4] = oView;
|
viewPtrs[thirdAngle ? 4 : 4] = oView;
|
||||||
|
@ -535,10 +517,9 @@ bool DrawProjGroup::distributeProjections()
|
||||||
//!allow child DPGI's to be automatically positioned
|
//!allow child DPGI's to be automatically positioned
|
||||||
void DrawProjGroup::resetPositions(void)
|
void DrawProjGroup::resetPositions(void)
|
||||||
{
|
{
|
||||||
const std::vector<App::DocumentObject *> &views = Views.getValues();
|
for( auto it : Views.getValues() ) {
|
||||||
for(std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
auto view( dynamic_cast<DrawProjGroupItem *>(it) );
|
||||||
DrawView *view = dynamic_cast<DrawView *>(*it);
|
if( view ) {
|
||||||
if(view->getTypeId() == DrawProjGroupItem::getClassTypeId()) {
|
|
||||||
view->setAutoPos(true);
|
view->setAutoPos(true);
|
||||||
//X,Y == 0??
|
//X,Y == 0??
|
||||||
}
|
}
|
||||||
|
@ -550,12 +531,11 @@ void DrawProjGroup::setFrontViewOrientation(const Base::Matrix4D &newMat)
|
||||||
{
|
{
|
||||||
viewOrientationMatrix.setValue(newMat);
|
viewOrientationMatrix.setValue(newMat);
|
||||||
|
|
||||||
DrawProjGroupItem *view;
|
for( auto it : Views.getValues() ) {
|
||||||
std::vector<App::DocumentObject *> views = Views.getValues();
|
auto view( dynamic_cast<DrawProjGroupItem *>(it) );
|
||||||
for (std::vector<App::DocumentObject*>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
if( view ) {
|
||||||
if ((*it)->getTypeId().isDerivedFrom(DrawProjGroupItem::getClassTypeId())) {
|
|
||||||
view = dynamic_cast<DrawProjGroupItem *>(*it);
|
|
||||||
setViewOrientation(view, view->Type.getValueAsString());
|
setViewOrientation(view, view->Type.getValueAsString());
|
||||||
|
// TODO: Seems we should ensure that modifying the view triggers this automatically? IR
|
||||||
view->touch();
|
view->touch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -573,11 +553,9 @@ App::DocumentObjectExecReturn *DrawProjGroup::execute(void)
|
||||||
Scale.setValue(autoScale);
|
Scale.setValue(autoScale);
|
||||||
|
|
||||||
//Rebuild the DPGI's
|
//Rebuild the DPGI's
|
||||||
const std::vector<App::DocumentObject *> &views = Views.getValues();
|
for( const auto it : Views.getValues() ) {
|
||||||
for(std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
|
auto view( dynamic_cast<DrawProjGroupItem *>(it) );
|
||||||
App::DocumentObject *docObj = *it;
|
if( view ) {
|
||||||
if(docObj->getTypeId().isDerivedFrom(DrawProjGroupItem::getClassTypeId())) {
|
|
||||||
DrawProjGroupItem *view = dynamic_cast<DrawProjGroupItem *>(*it);
|
|
||||||
view->ScaleType.setValue("Custom");
|
view->ScaleType.setValue("Custom");
|
||||||
view->Scale.setValue(autoScale);
|
view->Scale.setValue(autoScale);
|
||||||
view->Scale.setStatus(App::Property::ReadOnly,true);
|
view->Scale.setStatus(App::Property::ReadOnly,true);
|
||||||
|
|
|
@ -1012,10 +1012,16 @@ bool _isValidVertexes(Gui::Command* cmd) {
|
||||||
//! verify that the Selection contains valid geometries for an Edge to Edge Dimension
|
//! verify that the Selection contains valid geometries for an Edge to Edge Dimension
|
||||||
int _isValidEdgeToEdge(Gui::Command* cmd) {
|
int _isValidEdgeToEdge(Gui::Command* cmd) {
|
||||||
//TODO: can the edges be in 2 different features??
|
//TODO: can the edges be in 2 different features??
|
||||||
int edgeType = isInvalid;
|
|
||||||
std::vector<Gui::SelectionObject> selection = cmd->getSelection().getSelectionEx();
|
std::vector<Gui::SelectionObject> selection = cmd->getSelection().getSelectionEx();
|
||||||
TechDraw::DrawViewPart* objFeat0 = dynamic_cast<TechDraw::DrawViewPart *>(selection[0].getObject());
|
|
||||||
//TechDraw::DrawViewPart* objFeat1 = dynamic_cast<TechDraw::DrawViewPart *>(selection[1].getObject());
|
auto objFeat0( dynamic_cast<TechDraw::DrawViewPart *>(selection[0].getObject()) );
|
||||||
|
// getObject() can return null pointer, or dynamic_cast can fail
|
||||||
|
if ( !objFeat0 ) {
|
||||||
|
Base::Console().Error("Logic error in _isValidEdgeToEdge()\n");
|
||||||
|
return isInvalid;
|
||||||
|
}
|
||||||
|
|
||||||
|
int edgeType = isInvalid;
|
||||||
const std::vector<std::string> SubNames = selection[0].getSubNames();
|
const std::vector<std::string> SubNames = selection[0].getSubNames();
|
||||||
if(SubNames.size() == 2) { //there are 2
|
if(SubNames.size() == 2) { //there are 2
|
||||||
if (TechDraw::DrawUtil::getGeomTypeFromName(SubNames[0]) == "Edge" && //they both start with "Edge"
|
if (TechDraw::DrawUtil::getGeomTypeFromName(SubNames[0]) == "Edge" && //they both start with "Edge"
|
||||||
|
|
|
@ -264,50 +264,48 @@ void MDIViewPage::attachTemplate(TechDraw::DrawTemplate *obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MDIViewPage::attachView(App::DocumentObject *obj)
|
bool MDIViewPage::attachView(App::DocumentObject *obj)
|
||||||
{
|
{
|
||||||
auto typeId(obj->getTypeId());
|
auto typeId(obj->getTypeId());
|
||||||
|
|
||||||
QGIView *qview(nullptr);
|
QGIView *qview(nullptr);
|
||||||
|
|
||||||
if (typeId.isDerivedFrom(TechDraw::DrawViewSection::getClassTypeId()) ) {
|
if (typeId.isDerivedFrom(TechDraw::DrawViewSection::getClassTypeId()) ) {
|
||||||
qview = m_view->addViewSection( dynamic_cast<TechDraw::DrawViewSection *>(obj) );
|
qview = m_view->addViewSection( static_cast<TechDraw::DrawViewSection *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId()) ) {
|
||||||
qview = m_view->addViewPart( dynamic_cast<TechDraw::DrawViewPart *>(obj) );
|
qview = m_view->addViewPart( static_cast<TechDraw::DrawViewPart *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawProjGroup::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawProjGroup::getClassTypeId()) ) {
|
||||||
qview = m_view->addProjectionGroup( dynamic_cast<TechDraw::DrawProjGroup *>(obj) );
|
qview = m_view->addProjectionGroup( static_cast<TechDraw::DrawProjGroup *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawViewCollection::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawViewCollection::getClassTypeId()) ) {
|
||||||
qview = m_view->addDrawView( dynamic_cast<TechDraw::DrawViewCollection *>(obj) );
|
qview = m_view->addDrawView( static_cast<TechDraw::DrawViewCollection *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId()) ) {
|
||||||
qview = m_view->addViewDimension( dynamic_cast<TechDraw::DrawViewDimension *>(obj) );
|
qview = m_view->addViewDimension( static_cast<TechDraw::DrawViewDimension *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawViewAnnotation::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawViewAnnotation::getClassTypeId()) ) {
|
||||||
qview = m_view->addDrawViewAnnotation( dynamic_cast<TechDraw::DrawViewAnnotation *>(obj) );
|
qview = m_view->addDrawViewAnnotation( static_cast<TechDraw::DrawViewAnnotation *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawViewSymbol::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawViewSymbol::getClassTypeId()) ) {
|
||||||
qview = m_view->addDrawViewSymbol( dynamic_cast<TechDraw::DrawViewSymbol *>(obj) );
|
qview = m_view->addDrawViewSymbol( static_cast<TechDraw::DrawViewSymbol *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawViewClip::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawViewClip::getClassTypeId()) ) {
|
||||||
qview = m_view->addDrawViewClip( dynamic_cast<TechDraw::DrawViewClip *>(obj) );
|
qview = m_view->addDrawViewClip( static_cast<TechDraw::DrawViewClip *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawViewSpreadsheet::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawViewSpreadsheet::getClassTypeId()) ) {
|
||||||
qview = m_view->addDrawViewSpreadsheet( dynamic_cast<TechDraw::DrawViewSpreadsheet *>(obj) );
|
qview = m_view->addDrawViewSpreadsheet( static_cast<TechDraw::DrawViewSpreadsheet *>(obj) );
|
||||||
|
|
||||||
} else if (typeId.isDerivedFrom(TechDraw::DrawHatch::getClassTypeId()) ) {
|
} else if (typeId.isDerivedFrom(TechDraw::DrawHatch::getClassTypeId()) ) {
|
||||||
//Hatch is not attached like other Views (since it isn't really a View)
|
//Hatch is not attached like other Views (since it isn't really a View)
|
||||||
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Base::Console().Log("Logic Error - Unknown view type in MDIViewPage::attachView\n");
|
Base::Console().Log("Logic Error - Unknown view type in MDIViewPage::attachView\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!qview)
|
return (qview != nullptr);
|
||||||
return -1;
|
|
||||||
else
|
|
||||||
return m_view->getViews().size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,10 @@ protected:
|
||||||
void findMissingViews( const std::vector<App::DocumentObject*> &list, std::vector<App::DocumentObject*> &missing);
|
void findMissingViews( const std::vector<App::DocumentObject*> &list, std::vector<App::DocumentObject*> &missing);
|
||||||
bool hasQView(App::DocumentObject *obj);
|
bool hasQView(App::DocumentObject *obj);
|
||||||
bool orphanExists(const char *viewName, const std::vector<App::DocumentObject*> &list);
|
bool orphanExists(const char *viewName, const std::vector<App::DocumentObject*> &list);
|
||||||
int attachView(App::DocumentObject *obj);
|
|
||||||
|
/// Attaches view of obj to m_view. Returns true on success, false otherwise
|
||||||
|
bool attachView(App::DocumentObject *obj);
|
||||||
|
|
||||||
void contextMenuEvent(QContextMenuEvent *event);
|
void contextMenuEvent(QContextMenuEvent *event);
|
||||||
void closeEvent(QCloseEvent*);
|
void closeEvent(QCloseEvent*);
|
||||||
QPrinter::PaperSize getPaperSize(int w, int h) const;
|
QPrinter::PaperSize getPaperSize(int w, int h) const;
|
||||||
|
|
|
@ -213,15 +213,19 @@ void QGIView::setPosition(qreal x, qreal y)
|
||||||
|
|
||||||
double QGIView::getYInClip(double y)
|
double QGIView::getYInClip(double y)
|
||||||
{
|
{
|
||||||
QGCustomClip* parentClip = dynamic_cast<QGCustomClip*>(parentItem());
|
auto parentClip( dynamic_cast<QGCustomClip*>( parentItem() ) );
|
||||||
if (parentClip) {
|
if (parentClip) {
|
||||||
QGIViewClip* parentView = dynamic_cast<QGIViewClip*>(parentClip->parentItem());
|
auto parentView( dynamic_cast<QGIViewClip*>( parentClip->parentItem() ) );
|
||||||
TechDraw::DrawViewClip* parentFeat = dynamic_cast<TechDraw::DrawViewClip*>(parentView->getViewObject());
|
if (parentView) {
|
||||||
double newY = parentFeat->Height.getValue() - y;
|
auto parentFeat( dynamic_cast<TechDraw::DrawViewClip*>(parentView->getViewObject()) );
|
||||||
return newY;
|
if (parentFeat) {
|
||||||
} else {
|
return parentFeat->Height.getValue() - y;
|
||||||
Base::Console().Log("Logic Error - getYInClip called for child (%s) not in Clip\n",getViewName());
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Base::Console().Log( "Logic Error - getYInClip called for child "
|
||||||
|
"(%s) not in Clip\n", getViewName() );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,9 +209,9 @@ void QGIViewDimension::hover(bool state)
|
||||||
|
|
||||||
void QGIViewDimension::updateView(bool update)
|
void QGIViewDimension::updateView(bool update)
|
||||||
{
|
{
|
||||||
if(getViewObject() == 0 || !getViewObject()->isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId()))
|
auto dim( dynamic_cast<TechDraw::DrawViewDimension*>(getViewObject()) );
|
||||||
|
if( dim == nullptr )
|
||||||
return;
|
return;
|
||||||
TechDraw::DrawViewDimension *dim = dynamic_cast<TechDraw::DrawViewDimension*>(getViewObject());
|
|
||||||
|
|
||||||
// Identify what changed to prevent complete redraw
|
// Identify what changed to prevent complete redraw
|
||||||
if(dim->Fontsize.isTouched() ||
|
if(dim->Fontsize.isTouched() ||
|
||||||
|
|
|
@ -464,8 +464,7 @@ void QGVPage::toggleHatch(bool enable)
|
||||||
int faceItemType = QGraphicsItem::UserType + 104;
|
int faceItemType = QGraphicsItem::UserType + 104;
|
||||||
for (auto& c:partChildren) {
|
for (auto& c:partChildren) {
|
||||||
if (c->type() == faceItemType) {
|
if (c->type() == faceItemType) {
|
||||||
QGIFace* f = dynamic_cast<QGIFace*>(c);
|
static_cast<QGIFace*>(c)->toggleSvg(enable);
|
||||||
f->toggleSvg(enable);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user