};
-int const FORMAT = 7;
+int const FORMAT = 8;
bool layout2layout(FileName const & filename, FileName const & tempfile)
TC_TITLELATEXNAME,
TC_TITLELATEXTYPE,
TC_FORMAT,
- TC_ADDTOPREAMBLE
+ TC_ADDTOPREAMBLE,
+ TC_USEMODULE
};
{ "style", TC_STYLE },
{ "titlelatexname", TC_TITLELATEXNAME },
{ "titlelatextype", TC_TITLELATEXTYPE },
- { "tocdepth", TC_TOCDEPTH }
+ { "tocdepth", TC_TOCDEPTH },
+ { "usemodule", TC_USEMODULE }
};
} //namespace anon
bool TextClass::convertLayoutFormat(support::FileName const & filename, ReadType rt)
{
LYXERR(Debug::TCLASS, "Converting layout file to " << FORMAT);
- FileName const tempfile = FileName::tempName();
+ FileName const tempfile = FileName::tempName("convert_layout");
bool success = layout2layout(filename, tempfile);
if (success)
success = read(tempfile, rt);
return retval == OK;
// write the layout string to a temporary file
- FileName const tempfile = FileName::tempName();
+ FileName const tempfile = FileName::tempName("TextClass_read");
ofstream os(tempfile.toFilesystemEncoding().c_str());
if (!os) {
- LYXERR0("Unable to create tempoary file");
+ LYXERR0("Unable to create temporary file");
return false;
}
os << str;
break;
}
+ case TC_USEMODULE: {
+ lexrc.next();
+ string const module = lexrc.getString();
+ usemod_.insert(module);
+ break;
+ }
+
case TC_LEFTMARGIN: // left margin type
if (lexrc.next())
leftmargin_ = lexrc.getDocString();
}
-void TextClass::addLayoutIfNeeded(docstring const & n) const
-{
- if (!hasLayout(n))
- layoutlist_.push_back(createEmptyLayout(n, true));
-}
-
-
Layout const & TextClass::operator[](docstring const & name) const
{
LASSERT(!name.empty(), /**/);
}
+void DocumentClass::addLayoutIfNeeded(docstring const & n) const
+{
+ if (!hasLayout(n))
+ layoutlist_.push_back(createEmptyLayout(n, true));
+}
+
+
InsetLayout const & DocumentClass::insetLayout(docstring const & name) const
{
+ // FIXME The fix for the InsetLayout part of 4812 would be here:
+ // Add the InsetLayout to the document class if it is not found.
docstring n = name;
InsetLayouts::const_iterator cen = insetlayoutlist_.end();
while (!n.empty()) {