comparison framework/SVFileReader.cpp @ 451:dc1a360f2b69

Allow layers to be loaded without models if their layer class explicitly says it's OK (otherwise default template won't load, as it has an empty waveform layer)
author Chris Cannam
date Mon, 20 Apr 2015 10:10:26 +0100
parents da520a68595a
children 6f475df6f833
comparison
equal deleted inserted replaced
449:12d982e52190 451:dc1a360f2b69
884 Model *model = m_models[modelId]; 884 Model *model = m_models[modelId];
885 m_document->setModel(layer, model); 885 m_document->setModel(layer, model);
886 } else { 886 } else {
887 cerr << "WARNING: SV-XML: Unknown model id " << modelId 887 cerr << "WARNING: SV-XML: Unknown model id " << modelId
888 << " in layer definition" << endl; 888 << " in layer definition" << endl;
889 889 if (!layer->canExistWithoutModel()) {
890 // Don't add a layer with an unknown model id 890 // Don't add a layer with an unknown model id
891 m_document->deleteLayer(layer); 891 // unless it explicitly supports this state
892 m_layers[id] = layer = 0; 892 m_document->deleteLayer(layer);
893 return false; 893 m_layers[id] = layer = 0;
894 } 894 return false;
895 }
896 }
895 } 897 }
896 898
897 if (layer) layer->setProperties(attributes); 899 if (layer) layer->setProperties(attributes);
898 } 900 }
899 901