Skip to content

Commit

Permalink
App: do not save external dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Feb 14, 2020
1 parent 0a608e9 commit 5eb15e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/App/Document.cpp
Expand Up @@ -1832,7 +1832,8 @@ void Document::writeObjects(const std::vector<App::DocumentObject*>& obj,

if(!isExporting(0)) {
for(auto o : obj) {
const auto &outList = o->getOutList(DocumentObject::OutListNoHidden);
const auto &outList = o->getOutList(DocumentObject::OutListNoHidden
| DocumentObject::OutListNoXLinked);
writer.Stream() << writer.ind()
<< "<" FC_ELEMENT_OBJECT_DEPS " " FC_ATTR_DEP_OBJ_NAME "=\""
<< o->getNameInDocument() << "\" " FC_ATTR_DEP_COUNT "=\"" << outList.size();
Expand Down
14 changes: 12 additions & 2 deletions src/App/DocumentObject.cpp
Expand Up @@ -284,14 +284,24 @@ void DocumentObject::getOutList(int options, std::vector<DocumentObject*> &res)
std::vector<Property*> props;
getPropertyList(props);
bool noHidden = !!(options & OutListNoHidden);
bool noXLinked = !!(options & OutListNoXLinked);
std::size_t size = res.size();
for(auto prop : props) {
auto link = dynamic_cast<PropertyLinkBase*>(prop);
if(link && (!noXLinked || !PropertyXLink::supportXLink(prop)))
if(link)
link->getLinks(res,noHidden);
}
if(!(options & OutListNoExpression))
ExpressionEngine.getLinks(res);

if(options & OutListNoXLinked) {
for(auto it=res.begin()+size;it!=res.end();) {
auto obj = *it;
if(obj && obj->getDocument()!=getDocument())
it = res.erase(it);
else
++it;
}
}
}

std::vector<App::DocumentObject*> DocumentObject::getOutListOfProperty(App::Property* prop) const
Expand Down

0 comments on commit 5eb15e4

Please sign in to comment.