Added check in Tree.cpp DocumentItem::slotChangeObject to check for invalid pointers returned by claimChildren()

This commit is contained in:
jrheinlaender
2013-04-17 19:49:55 +04:30
committed by Stefan Tröger
parent d13560bea5
commit 0e6cdbe397
3 changed files with 37 additions and 19 deletions

View File

@@ -2294,6 +2294,16 @@ DocumentObject * Document::getObject(const char *Name) const
return 0;
}
// Note: This method is only used in Tree.cpp slotChangeObject(), see explanation there
const bool Document::isIn(const DocumentObject *pFeat) const
{
for (std::map<std::string,DocumentObject*>::const_iterator o = d->objectMap.begin(); o != d->objectMap.end(); o++)
if (o->second == pFeat)
return true;
return false;
}
const char * Document::getObjectName(DocumentObject *pFeat) const
{
std::map<std::string,DocumentObject*>::const_iterator pos;