- string str = bformat(_("Could not print the document %1$s.\n"
- "Check that your printer is set up correctly."),
- MakeDisplayPath(name, 50));
- Alert::error(_("Print document failed"), str);
+ string str = bformat(_("Could not print the document %1$s.\n"
+ "Check that your printer is set up correctly."),
+ MakeDisplayPath(name, 50));
+ Alert::error(_("Print document failed"), str);
+}
+
+
+void loadTextclass(string const & name)
+{
+ std::pair<bool, lyx::textclass_type> const tc_pair =
+ textclasslist.NumberOfClass(name);
+
+ if (!tc_pair.first) {
+ lyxerr << "Document class \"" << name
+ << "\" does not exist."
+ << std::endl;
+ return;
+ }
+
+ lyx::textclass_type const tc = tc_pair.second;
+
+ if (!textclasslist[tc].load()) {
+ string s = bformat(_("The document could not be converted\n"
+ "into the document class %1$s."),
+ textclasslist[tc].name());
+ Alert::error(_("Could not change class"), s);
+ }