+ fixes #0001776: Illegal character when opening project

This commit is contained in:
wmayer 2015-01-25 12:36:24 +01:00
parent 683e342cff
commit 2cff92a73e

View File

@ -1524,10 +1524,11 @@ DocumentObject * Document::addObject(const char* sType, const char* pObjectName)
void Document::_addObject(DocumentObject* pcObject, const char* pObjectName)
{
d->objectMap[pObjectName] = pcObject;
std::string ObjectName = getUniqueObjectName(pObjectName);
d->objectMap[ObjectName] = pcObject;
d->objectArray.push_back(pcObject);
// cache the pointer to the name string in the Object (for performance of DocumentObject::getNameInDocument())
pcObject->pcNameInDocument = &(d->objectMap.find(pObjectName)->first);
pcObject->pcNameInDocument = &(d->objectMap.find(ObjectName)->first);
// do no transactions if we do a rollback!
if(!d->rollback){