# HG changeset patch # User Chris Cannam # Date 1196356253 0 # Node ID cedeab01d4c81a3ae793d26807e96281816b7343 # Parent eeb48693db968246e2073790d7fe2972efc337c4 * Attempt to fix finding of file:/// URLs * Fix incorrect reassignment of source model in layers that had no source model previously, when replacing a null main model diff -r eeb48693db96 -r cedeab01d4c8 framework/Document.cpp --- a/framework/Document.cpp Thu Nov 29 10:43:54 2007 +0000 +++ b/framework/Document.cpp Thu Nov 29 17:10:53 2007 +0000 @@ -271,7 +271,7 @@ // << (model ? model->objectName().toStdString() : "(null)") << " in layer " // << layer->objectName().toStdString() << std::endl; - if (model == oldMainModel) { + if (model && (model == oldMainModel)) { // std::cerr << "... it uses the old main model, replacing" << std::endl; LayerFactory::getInstance()->setModel(layer, m_mainModel); continue; @@ -285,7 +285,7 @@ continue; } - if (m_models[model].source == oldMainModel) { + if (m_models[model].source && (m_models[model].source == oldMainModel)) { // std::cerr << "... it uses a model derived from the old main model, regenerating" << std::endl; @@ -334,7 +334,8 @@ } for (ModelMap::iterator i = m_models.begin(); i != m_models.end(); ++i) { - if (i->first->getAlignmentReference() == oldMainModel) { + if (oldMainModel && + (i->first->getAlignmentReference() == oldMainModel)) { alignModel(i->first); } }