Avoid issue if ViewProvider deleted while graphic still active
This commit is contained in:
parent
49c2be14ba
commit
5f72efa610
|
@ -481,7 +481,7 @@ void MDIViewPage::redraw1View(TechDraw::DrawView* dv)
|
|||
std::string dvName = dv->getNameInDocument();
|
||||
const std::vector<QGIView *> &upviews = m_view->getViews();
|
||||
for(std::vector<QGIView *>::const_iterator it = upviews.begin(); it != upviews.end(); ++it) {
|
||||
std::string qgivName = (*it)->getViewObject()->getNameInDocument();
|
||||
std::string qgivName = (*it)->getViewName();
|
||||
if(dvName == qgivName) {
|
||||
(*it)->updateView(true);
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ bool MDIViewPage::hasQView(App::DocumentObject *obj)
|
|||
|
||||
while(qview != views.end()) {
|
||||
// Unsure if we can compare pointers so rely on name
|
||||
if(strcmp((*qview)->getViewObject()->getNameInDocument(), obj->getNameInDocument()) == 0) {
|
||||
if(strcmp((*qview)->getViewName(), obj->getNameInDocument()) == 0) {
|
||||
return true;
|
||||
}
|
||||
qview++;
|
||||
|
|
|
@ -181,9 +181,9 @@ void QGIProjGroup::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
|||
Gui::Command::openCommand("Drag Projection Group");
|
||||
//TODO: See if these commands actually handle the horizontal/vertical constraints properly...
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.X = %f",
|
||||
getViewObject()->getNameInDocument(), Rez::appX(x()));
|
||||
getViewName(), Rez::appX(x()));
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Y = %f",
|
||||
getViewObject()->getNameInDocument(), Rez::appX(getY()));// inverts Y
|
||||
getViewName(), Rez::appX(getY()));// inverts Y
|
||||
Gui::Command::commitCommand();
|
||||
//Gui::Command::updateActive();
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ void QGIViewSymbol::symbolToSvg(QByteArray qba)
|
|||
|
||||
prepareGeometryChange();
|
||||
if (!m_svgItem->load(&qba)) {
|
||||
Base::Console().Error("Error - Could not load Symbol into SVG renderer for %s\n", getViewObject()->getNameInDocument());
|
||||
Base::Console().Error("Error - Could not load Symbol into SVG renderer for %s\n", getViewName());
|
||||
}
|
||||
m_svgItem->centerAt(0.,0.);
|
||||
}
|
||||
|
|
|
@ -417,8 +417,7 @@ QGIView * QGVPage::findView(App::DocumentObject *obj) const
|
|||
if(obj) {
|
||||
const std::vector<QGIView *> qviews = views;
|
||||
for(std::vector<QGIView *>::const_iterator it = qviews.begin(); it != qviews.end(); ++it) {
|
||||
TechDraw::DrawView *fview = (*it)->getViewObject();
|
||||
if(fview && strcmp(obj->getNameInDocument(), fview->getNameInDocument()) == 0)
|
||||
if(strcmp(obj->getNameInDocument(), (*it)->getViewName()) == 0)
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
|
@ -441,8 +440,7 @@ QGIView * QGVPage::findParent(QGIView *view) const
|
|||
std::vector<App::DocumentObject *> objs = dim->References2D.getValues();
|
||||
// Attach the dimension to the first object's group
|
||||
for(std::vector<QGIView *>::const_iterator it = qviews.begin(); it != qviews.end(); ++it) {
|
||||
TechDraw::DrawView *viewObj = (*it)->getViewObject();
|
||||
if(strcmp(viewObj->getNameInDocument(), objs.at(0)->getNameInDocument()) == 0) {
|
||||
if(strcmp((*it)->getViewName(), objs.at(0)->getNameInDocument()) == 0) {
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user