crossreferences only with ctrl button and fix missing return value

This commit is contained in:
Stefan Tröger 2015-07-27 20:31:18 +02:00
parent e2f70e5e5b
commit 83eedba043
3 changed files with 5 additions and 6 deletions

View File

@ -175,7 +175,6 @@ DocumentObjectGroup* DocumentObject::getGroup() const
bool DocumentObject::testIfLinkDAGCompatible(DocumentObject *linkTo) const
{
std::vector<App::DocumentObject*> linkTo_in_vector;
linkTo_in_vector.reserve(1);
linkTo_in_vector.push_back(linkTo);
return this->testIfLinkDAGCompatible(linkTo_in_vector);
}

View File

@ -1719,15 +1719,14 @@ bool SketchObject::isExternalAllowed(App::Document *pDoc, App::DocumentObject *p
if (!(this->testIfLinkDAGCompatible(pObj))){
if (rsn)
*rsn = rlCircularReference;
return false
;
return false;
}
} catch (Base::Exception &e) {
Base::Console().Warning("Probably, there is a circular reference in the document. Error: %s\n", e.what());
return true; //prohibiting this reference won't remove the problem anyway...
}
/*
// Note: Checking for the body of the support doesn't work when the support are the three base planes
App::DocumentObject *support = this->Support.getValue();
Part::BodyBase* body = Part::BodyBase::findBodyOf(this);
@ -1745,7 +1744,6 @@ bool SketchObject::isExternalAllowed(App::Document *pDoc, App::DocumentObject *p
}
return true;
*/
}
int SketchObject::addSymmetric(const std::vector<int> &geoIdList, int refGeoId, Sketcher::PointPos refPosId/*=Sketcher::none*/)

View File

@ -4475,6 +4475,8 @@ namespace SketcherGui {
bool allow(App::Document *pDoc, App::DocumentObject *pObj, const char *sSubName)
{
Sketcher::SketchObject *sketch = static_cast<Sketcher::SketchObject*>(object);
sketch->allowOtherBody = (QApplication::keyboardModifiers() == Qt::ControlModifier);
Sketcher::SketchObject::eReasonList msg;
if (!sketch->isExternalAllowed(pDoc, pObj, &msg)){
switch(msg){
@ -4485,7 +4487,7 @@ namespace SketcherGui {
this->notAllowedReason = QT_TR_NOOP("This object is in another document.");
break;
case Sketcher::SketchObject::rlOtherPart:
this->notAllowedReason = QT_TR_NOOP("This object belongs to another part, can't link.");
this->notAllowedReason = QT_TR_NOOP("This object belongs to another part or body, can't link. Hold Ctrl to allow crossreferences.");
break;
}
return false;