#include "TextClass.h"
#include "debug.h"
+#include "Layout.h"
#include "Lexer.h"
#include "Counters.h"
#include "gettext.h"
#include "support/filetools.h"
#include "support/os.h"
-#include <boost/filesystem/operations.hpp>
-namespace fs = boost::filesystem;
-
#include <sstream>
-
namespace lyx {
using support::FileName;
// Reads a textclass structure from file.
bool TextClass::read(FileName const & filename, ReadType rt)
{
- if (!support::isFileReadable(filename)) {
+ if (!filename.isFileReadable()) {
lyxerr << "Cannot read layout file `" << filename << "'."
<< endl;
return true;
return;
case TITLE_COMMAND_AFTER:
case TITLE_ENVIRONMENT:
- titletype_ = static_cast<LYX_TITLE_LATEX_TYPES>(le);
+ titletype_ = static_cast<TitleLatexType>(le);
break;
default:
lyxerr << "Unhandled value " << le
IL_LATEXPARAM,
IL_LATEXTYPE,
IL_LYXTYPE,
+ IL_MULTIPAR,
IL_PREAMBLE,
IL_END
};
{ "latexparam", IL_LATEXPARAM },
{ "latextype", IL_LATEXTYPE },
{ "lyxtype", IL_LYXTYPE },
+ { "multipar", IL_MULTIPAR },
{ "preamble", IL_PREAMBLE }
};
string decoration;
string latexname;
string latexparam;
- Font font(Font::ALL_INHERIT);
- Font labelfont(Font::ALL_INHERIT);
+ Font font(defaultfont());
+ Font labelfont(defaultfont());
Color::color bgcolor(Color::background);
string preamble;
+ bool multipar(false);
bool getout = false;
while (!getout && lexrc.isOK()) {
labelfont.lyxRead(lexrc);
labelfont.realize(defaultfont());
break;
+ case IL_MULTIPAR:
+ lexrc.next();
+ multipar = lexrc.getBool();
+ break;
case IL_FONT:
font.lyxRead(lexrc);
font.realize(defaultfont());
+ // So: define font before labelfont
labelfont = font;
break;
case IL_BGCOLOR: {
il.latextype = latextype;
il.latexname = latexname;
il.latexparam = latexparam;
+ il.multipar = multipar;
il.font = font;
il.labelfont = labelfont;
il.bgcolor = bgcolor;
FileName layout_file;
if (!path.empty())
layout_file = FileName(addName(path, name_ + ".layout"));
- if (layout_file.empty() || !fs::exists(layout_file.toFilesystemEncoding()))
+ if (layout_file.empty() || !layout_file.exists())
layout_file = libFileSearch("layouts", name_, "layout");
loaded_ = const_cast<TextClass*>(this)->read(layout_file) == 0;
}
static InsetLayout empty;
empty.labelstring = from_utf8("UNDEFINED");
+ empty.bgcolor = Color::error;
return empty;
}
}
-LYX_TITLE_LATEX_TYPES TextClass::titletype() const
+TitleLatexType TextClass::titletype() const
{
return titletype_;
}