// development/tools/updatelayouts.sh script, to update the format of
// all of our layout files.
//
-int const LAYOUT_FORMAT = 40; // rgh categorized layouts
+int const LAYOUT_FORMAT = 45; // rgh: New Tag "NoInsetLayout"
namespace {
TC_IFSTYLE,
TC_DEFAULTSTYLE,
TC_INSETLAYOUT,
+ TC_NOINSETLAYOUT,
TC_NOSTYLE,
TC_COLUMNS,
TC_SIDES,
namespace {
- LexerKeyword textClassTags[] = {
- { "addtohtmlpreamble", TC_ADDTOHTMLPREAMBLE },
- { "addtohtmlstyles", TC_ADDTOHTMLSTYLES },
- { "addtopreamble", TC_ADDTOPREAMBLE },
- { "citeengine", TC_CITEENGINE },
- { "citeenginetype", TC_CITEENGINETYPE },
- { "citeformat", TC_CITEFORMAT },
- { "classoptions", TC_CLASSOPTIONS },
- { "columns", TC_COLUMNS },
- { "counter", TC_COUNTER },
- { "defaultbiblio", TC_DEFAULTBIBLIO },
- { "defaultfont", TC_DEFAULTFONT },
- { "defaultmodule", TC_DEFAULTMODULE },
- { "defaultstyle", TC_DEFAULTSTYLE },
- { "excludesmodule", TC_EXCLUDESMODULE },
- { "float", TC_FLOAT },
- { "format", TC_FORMAT },
- { "fullauthorlist", TC_FULLAUTHORLIST },
- { "htmlpreamble", TC_HTMLPREAMBLE },
- { "htmlstyles", TC_HTMLSTYLES },
- { "htmltocsection", TC_HTMLTOCSECTION },
- { "ifcounter", TC_IFCOUNTER },
- { "ifstyle", TC_IFSTYLE },
- { "input", TC_INPUT },
- { "insetlayout", TC_INSETLAYOUT },
- { "leftmargin", TC_LEFTMARGIN },
- { "nocounter", TC_NOCOUNTER },
- { "nofloat", TC_NOFLOAT },
- { "nostyle", TC_NOSTYLE },
- { "outputformat", TC_OUTPUTFORMAT },
- { "outputtype", TC_OUTPUTTYPE },
- { "pagestyle", TC_PAGESTYLE },
- { "preamble", TC_PREAMBLE },
- { "provides", TC_PROVIDES },
- { "providesmodule", TC_PROVIDESMODULE },
- { "requires", TC_REQUIRES },
- { "rightmargin", TC_RIGHTMARGIN },
- { "secnumdepth", TC_SECNUMDEPTH },
- { "sides", TC_SIDES },
- { "style", TC_STYLE },
- { "titlelatexname", TC_TITLELATEXNAME },
- { "titlelatextype", TC_TITLELATEXTYPE },
- { "tocdepth", TC_TOCDEPTH }
- };
+LexerKeyword textClassTags[] = {
+ { "addtohtmlpreamble", TC_ADDTOHTMLPREAMBLE },
+ { "addtohtmlstyles", TC_ADDTOHTMLSTYLES },
+ { "addtopreamble", TC_ADDTOPREAMBLE },
+ { "citeengine", TC_CITEENGINE },
+ { "citeenginetype", TC_CITEENGINETYPE },
+ { "citeformat", TC_CITEFORMAT },
+ { "classoptions", TC_CLASSOPTIONS },
+ { "columns", TC_COLUMNS },
+ { "counter", TC_COUNTER },
+ { "defaultbiblio", TC_DEFAULTBIBLIO },
+ { "defaultfont", TC_DEFAULTFONT },
+ { "defaultmodule", TC_DEFAULTMODULE },
+ { "defaultstyle", TC_DEFAULTSTYLE },
+ { "excludesmodule", TC_EXCLUDESMODULE },
+ { "float", TC_FLOAT },
+ { "format", TC_FORMAT },
+ { "fullauthorlist", TC_FULLAUTHORLIST },
+ { "htmlpreamble", TC_HTMLPREAMBLE },
+ { "htmlstyles", TC_HTMLSTYLES },
+ { "htmltocsection", TC_HTMLTOCSECTION },
+ { "ifcounter", TC_IFCOUNTER },
+ { "ifstyle", TC_IFSTYLE },
+ { "input", TC_INPUT },
+ { "insetlayout", TC_INSETLAYOUT },
+ { "leftmargin", TC_LEFTMARGIN },
+ { "nocounter", TC_NOCOUNTER },
+ { "nofloat", TC_NOFLOAT },
+ { "noinsetlayout", TC_NOINSETLAYOUT },
+ { "nostyle", TC_NOSTYLE },
+ { "outputformat", TC_OUTPUTFORMAT },
+ { "outputtype", TC_OUTPUTTYPE },
+ { "pagestyle", TC_PAGESTYLE },
+ { "preamble", TC_PREAMBLE },
+ { "provides", TC_PROVIDES },
+ { "providesmodule", TC_PROVIDESMODULE },
+ { "requires", TC_REQUIRES },
+ { "rightmargin", TC_RIGHTMARGIN },
+ { "secnumdepth", TC_SECNUMDEPTH },
+ { "sides", TC_SIDES },
+ { "style", TC_STYLE },
+ { "titlelatexname", TC_TITLELATEXNAME },
+ { "titlelatextype", TC_TITLELATEXTYPE },
+ { "tocdepth", TC_TOCDEPTH }
+};
} //namespace anon
}
break;
+ case TC_NOINSETLAYOUT:
+ if (lexrc.next()) {
+ docstring const style = from_utf8(subst(lexrc.getString(),
+ '_', ' '));
+ if (!deleteInsetLayout(style))
+ LYXERR0("Style `" << style << "' cannot be removed\n"
+ "because it was not found!");
+ }
+ break;
+
case TC_COLUMNS:
if (lexrc.next())
columns_ = lexrc.getInteger();
return prerequisites_;
}
+
bool TextClass::hasLayout(docstring const & n) const
{
docstring const name = n.empty() ? defaultLayoutName() : n;
{
if (n.empty())
return false;
- InsetLayouts::const_iterator it = insetlayoutlist_.begin();
- InsetLayouts::const_iterator en = insetlayoutlist_.end();
- for (; it != en; ++it)
- if (n == it->first)
- return true;
- return false;
+ InsetLayouts::const_iterator it = insetlayoutlist_.find(n);
+ return it != insetlayoutlist_.end();
}
}
+bool TextClass::deleteInsetLayout(docstring const & name)
+{
+ return insetlayoutlist_.erase(name);
+}
+
+
// Load textclass info if not loaded yet
bool TextClass::load(string const & path) const
{
Layout const & DocumentClass::htmlTOCLayout() const
{
- if (html_toc_section_.empty()) {
+ if (html_toc_section_.empty())
html_toc_section_ = getTOCLayout().name();
- }
return operator[](html_toc_section_);
}