diff --git a/src/db/db/dbLayerProperties.cc b/src/db/db/dbLayerProperties.cc index d5a50e497..ccdb42153 100644 --- a/src/db/db/dbLayerProperties.cc +++ b/src/db/db/dbLayerProperties.cc @@ -190,7 +190,7 @@ static bool read_ld (tl::Extractor &ex, ld_type &l, bool with_relative) } } -void +bool LayerProperties::read (tl::Extractor &ex, bool as_target) { layer = db::any_ld (); @@ -207,6 +207,8 @@ LayerProperties::read (tl::Extractor &ex, bool as_target) layer = l; datatype = d; + return true; + } else if (ex.try_read_word_or_quoted (name)) { if (ex.test ("(")) { @@ -223,6 +225,10 @@ LayerProperties::read (tl::Extractor &ex, bool as_target) } + return true; + + } else { + return false; } } diff --git a/src/db/db/dbLayerProperties.h b/src/db/db/dbLayerProperties.h index b9738b339..7ed4494ff 100644 --- a/src/db/db/dbLayerProperties.h +++ b/src/db/db/dbLayerProperties.h @@ -91,8 +91,10 @@ struct DB_PUBLIC LayerProperties * relative layer/datatype specifications in the format "*+1" or "*-100". * "*" for layer or datatype is for "don't care" (on input) or "leave as is" * (for output). + * + * Returns true, if a layer was read successfully. */ - void read (tl::Extractor &ex, bool as_target = false); + bool read (tl::Extractor &ex, bool as_target = false); /** * @brief "Logical" equality diff --git a/src/layui/layui/layDialogs.cc b/src/layui/layui/layDialogs.cc index a303c6dd0..61d16c46c 100644 --- a/src/layui/layui/layDialogs.cc +++ b/src/layui/layui/layDialogs.cc @@ -196,7 +196,9 @@ NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &ce while (! ex.at_end ()) { db::LayerProperties lp; try { - lp.read (ex); + if (! lp.read (ex)) { + break; + } } catch (...) { break; }