<< "' is missing a defaultstyle." << endl;
error = true;
}
+
+ min_toclevel_ = LyXLayout::NOT_IN_TOC;
+ max_toclevel_ = LyXLayout::NOT_IN_TOC;
+ const_iterator cit = begin();
+ const_iterator the_end = end();
+ for ( ; cit != the_end ; ++cit) {
+ int const toclevel = (*cit)->toclevel;
+ if (toclevel != LyXLayout::NOT_IN_TOC) {
+ if (min_toclevel_ == LyXLayout::NOT_IN_TOC)
+ min_toclevel_ = toclevel;
+ else
+ min_toclevel_ = std::min(min_toclevel_,
+ toclevel);
+ max_toclevel_ = std::max(max_toclevel_,
+ toclevel);
+ }
+ }
+ lyxerr[Debug::TCLASS]
+ << "Minimum TocLevel is " << min_toclevel_
+ << ", maximum is " << max_toclevel_ <<endl;
+
} else
lyxerr[Debug::TCLASS] << "Finished reading input file "
<< MakeDisplayPath(filename)
}
-enum MaxCounterTags {
- MC_COUNTER_CHAPTER = 1,
- MC_COUNTER_SECTION,
- MC_COUNTER_SUBSECTION,
- MC_COUNTER_SUBSUBSECTION,
- MC_COUNTER_PARAGRAPH,
- MC_COUNTER_SUBPARAGRAPH,
- MC_COUNTER_ENUMI,
- MC_COUNTER_ENUMII,
- MC_COUNTER_ENUMIII,
- MC_COUNTER_ENUMIV
-};
-
-
enum ClassOptionsTags {
CO_FONTSIZE = 1,
CO_PAGESTYLE,
// Read style-file
string const real_file = LibFileSearch("layouts", name_, "layout");
+ loaded_ = const_cast<LyXTextClass*>(this)->Read(real_file) == 0;
- if (const_cast<LyXTextClass*>(this)->Read(real_file)) {
+ if (!loaded_) {
lyxerr << "Error reading `"
<< MakeDisplayPath(real_file)
<< "'\n(Check `" << name_
<< "')\nCheck your installation and "
"try Options/Reconfigure..." << endl;
- loaded_ = false;
}
- loaded_ = true;
+
return loaded_;
}
}
+int LyXTextClass::min_toclevel() const
+{
+ return min_toclevel_;
+}
+
+
+int LyXTextClass::max_toclevel() const
+{
+ return max_toclevel_;
+}
+
+
ostream & operator<<(ostream & os, LyXTextClass::PageSides p)
{
switch (p) {