mirror of https://github.com/KLayout/klayout.git
[consider merging] More robust reading of session files and image strings
This commit is contained in:
parent
5d253d3094
commit
a4f3d9a33b
|
|
@ -1546,6 +1546,9 @@ Object::from_string (const char *str, const char *base_dir)
|
|||
|
||||
ex.test ("]");
|
||||
|
||||
} else {
|
||||
// otherwise stop
|
||||
break;
|
||||
}
|
||||
|
||||
ex.test (";");
|
||||
|
|
|
|||
|
|
@ -265,7 +265,11 @@ Session::restore (lay::MainWindow &mw)
|
|||
as.reserve (vd.annotation_shapes.annotation_shapes.size ());
|
||||
for (std::vector<SessionAnnotationDescriptor>::const_iterator ad = vd.annotation_shapes.annotation_shapes.begin (); ad != vd.annotation_shapes.annotation_shapes.end (); ++ad) {
|
||||
db::DUserObjectBase *obj = db::DUserObjectFactory::create (ad->class_name.c_str (), ad->value_string.c_str (), ! m_base_dir.empty () ? m_base_dir.c_str () : 0);
|
||||
as.insert (db::DUserObject (obj));
|
||||
if (obj) {
|
||||
as.insert (db::DUserObject (obj));
|
||||
} else {
|
||||
tl::warn << tl::to_string (tr ("Unable to restore session user object with unknown class: ")) << ad->class_name;
|
||||
}
|
||||
}
|
||||
|
||||
view->update_content ();
|
||||
|
|
|
|||
Loading…
Reference in New Issue