X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLayoutFile.cpp;h=f70209b3b0a7c7f2d90a7b4146454256ae6a489a;hb=4e69b9bac5e970572b9cf9169e3db9060c47e3b6;hp=1aa5dbfeb3bc6a6e7003b8115838bf088e6dd0b4;hpb=88329a656c4be4c9179ba10023b01800574a2f53;p=lyx.git diff --git a/src/LayoutFile.cpp b/src/LayoutFile.cpp index 1aa5dbfeb3..f70209b3b0 100644 --- a/src/LayoutFile.cpp +++ b/src/LayoutFile.cpp @@ -212,7 +212,7 @@ string layoutpost = LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass) { - FileName const tempLayout = FileName::tempName(); + FileName const tempLayout = FileName::tempName("basic_layout"); ofstream ofs(tempLayout.toFilesystemEncoding().c_str()); // This writes a very basic class, but it also attempts to include // stdclass.inc. That would give us something moderately usable. @@ -232,11 +232,12 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass) if (!tc->load(tempLayout.absFileName())) { // The only way this happens is because the hardcoded layout file // above is wrong or stdclass.inc cannot be found. So try again - // without stdclass.inc. + // without stdclass.inc and without stdinsets.inc. ofstream ofs2(tempLayout.toFilesystemEncoding().c_str()); ofs2 << "# This layout is automatically generated\n" "# \\DeclareLaTeXClass{" << textclass << "}\n\n" "Format " << LAYOUT_FORMAT << "\n" + "Provides stdinsets 1\n" << layoutpost; ofs2.close(); if (!tc->load(tempLayout.absFileName())) { @@ -314,13 +315,7 @@ bool LayoutFileList::load(string const & name, string const & buf_path) } LayoutFile * tc = classmap_[name]; - if (!tc->load(buf_path)) { - docstring s = bformat(_("The document class %1$s " - "could not be loaded."), from_utf8(name)); - frontend::Alert::error(_("Could not load class"), s); - return false; - } - return true; + return tc->load(buf_path); }