#include "support/filetools.h"
#include "support/lstrings.h"
-using lyx::layout_type;
using lyx::textclass_type;
using std::endl;
using std::ostream;
-LaTeXFeatures::LaTeXFeatures(BufferParams const & p, layout_type n)
- : layout(n, false), params(p)
+LaTeXFeatures::LaTeXFeatures(BufferParams const & p)
+ : params(p)
{}
}
-void LaTeXFeatures::useLayout(vector<bool>::size_type const & idx)
+void LaTeXFeatures::useLayout(string const & lyt)
{
- layout[idx] = true;
+ layout.insert(lyt);
}
string const LaTeXFeatures::getPackages() const
{
ostringstream packages;
- LyXTextClass const & tclass =
- textclasslist.TextClass(params.textclass);
+ LyXTextClass const & tclass = textclasslist[params.textclass];
/**
string const LaTeXFeatures::getTClassPreamble() const
{
// the text class specific preamble
- LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
+ LyXTextClass const & tclass = textclasslist[params.textclass];
ostringstream tcpreamble;
tcpreamble << tclass.preamble();
- for (layout_type i = 0; i < tclass.numLayouts(); ++i) {
- if (layout[i]) {
- tcpreamble << tclass[i].preamble();
- }
+ set<string>::const_iterator cit = layout.begin();
+ set<string>::const_iterator end = layout.end();
+ for (; cit != end; ++cit) {
+ tcpreamble << tclass[*cit].preamble();
}
-
+
return tcpreamble.str().c_str();
}
return params;
}
+
void LaTeXFeatures::getFloatDefinitions(ostream & os) const
{
// Here we will output the code to create the needed float styles.