case LT_COPYSTYLE: // initialize with a known style
if (lexrc.next()) {
- if (tclass.hasLayout(lexrc.getString())) {
+ string const style = lexrc.getString();
+
+ if (tclass.hasLayout(style)) {
string const tmpname = name_;
- this->operator= (tclass.GetLayout(lexrc.getString()));
+ this->operator=(tclass[style]);
name_ = tmpname;
} else {
- lexrc.printError("Cannot copy known "
- "style `$$Token'");
+ lyxerr << "Cannot copy unknown style `" << style << "'" << endl;
+ LyXTextClass::const_iterator it = tclass.begin();
+ LyXTextClass::const_iterator end = tclass.end();
+ lyxerr << "All layouts so far:" << endl;
+ for (; it != end; ++it) {
+ lyxerr << it->name() << endl;
+ }
+
+ //lexrc.printError("Cannot copy known "
+ // "style `$$Token'");
}
}
break;
case LT_OBSOLETEDBY: // replace with a known style
if (lexrc.next()) {
- if (tclass.hasLayout(lexrc.getString())) {
+ string const style = lexrc.getString();
+
+ if (tclass.hasLayout(style)) {
string const tmpname = name_;
- this->operator= (tclass.GetLayout(lexrc.getString()));
+ this->operator=(tclass[style]);
name_ = tmpname;
if (obsoleted_by().empty())
- obsoleted_by_ = lexrc.getString();
+ obsoleted_by_ = style;
} else {
- lexrc.printError("Cannot replace with"
- " unknown style "
- "`$$Token'");
+ lyxerr << "Cannot replace with unknown style `" << style << "'" << endl;
+
+ //lexrc.printError("Cannot replace with"
+ // " unknown style "
+ // "`$$Token'");
}
}
break;
break;
}
}
+
+
+string const & LyXLayout::name() const
+{
+ return name_;
+}
+
+
+void LyXLayout::setName(string const & n)
+{
+ name_ = n;
+}
+
+
+string const & LyXLayout::obsoleted_by() const
+{
+ return obsoleted_by_;
+}