* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 the LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
extern LyXRC * lyxrc;
-LaTeXFeatures::LaTeXFeatures(int n)
+LaTeXFeatures::LaTeXFeatures(int n)
+ : layout(n, false)
{
// packages
color = false;
LyXParagraphIndent = false;
NeedLyXFootnoteCode = false;
NeedLyXMinipageIndent = false;
-
- // layouts
- layout = new bool[n];
- for (int i = n; i--;)
- layout[i] = false;
}
-string LaTeXFeatures::getPackages(BufferParams const ¶ms)
+string LaTeXFeatures::getPackages(BufferParams const & params)
{
string packages;
LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
string tcpreamble = tclass.preamble();
- for (LyXTextClass::LayoutList::const_iterator cit = tclass.begin();
- cit != tclass.end(); ++cit) {
- tcpreamble += (*cit).preamble();
+ for (unsigned int i = 0; i < tclass.numLayouts(); ++i) {
+ if (layout[i]) {
+ tcpreamble += tclass[i].preamble();
+ }
}
return tcpreamble;