/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#include <config.h>
-#include <cstdlib>
#ifdef __GNUG__
-#pragma implementation "bufferparams.h"
+#pragma implementation
#endif
#include "bufferparams.h"
#include "layout.h"
#include "vspace.h"
#include "debug.h"
-#include "support/lyxlib.h"
-#include "support/lstrings.h"
#include "lyxrc.h"
#include "language.h"
+#include "lyxtextclasslist.h"
+
+#include "support/lyxlib.h"
+#include "support/lstrings.h"
+
+#include <cstdlib>
using std::ostream;
using std::endl;
: textclass(textclasslist.NumberOfClass("article").second)
{
paragraph_separation = PARSEP_INDENT;
- defskip = VSpace(VSpace::MEDSKIP);
+ defskip = VSpace(VSpace::MEDSKIP);
quotes_language = InsetQuotes::EnglishQ;
quotes_times = InsetQuotes::DoubleQ;
fontsize = "default";
// The top of the file is written by the buffer.
// Prints out the buffer info into the .lyx file given by file
- // the textclass
- os << "\\textclass " << textclasslist.NameOfClass(textclass) << '\n';
-
+ // the textclass
+ os << "\\textclass " << textclasslist[textclass].name() << '\n';
+
// then the the preamble
if (!preamble.empty()) {
// remove '\n' from the end of preamble
<< tmppreamble
<< "\n\\end_preamble\n";
}
-
- /* the options */
+
+ /* the options */
if (!options.empty()) {
os << "\\options " << options << '\n';
}
-
+
/* then the text parameters */
if (language != ignore_language)
os << "\\language " << language->lang() << '\n';
<< "\n\\use_numerical_citations " << use_numerical_citations
<< "\n\\paperorientation " << string_orientation[orientation]
<< '\n';
- if (!paperwidth.empty())
+ if (!paperwidth.empty())
os << "\\paperwidth "
<< VSpace(paperwidth).asLyXCommand() << '\n';
- if (!paperheight.empty())
+ if (!paperheight.empty())
os << "\\paperheight "
<< VSpace(paperheight).asLyXCommand() << '\n';
- if (!leftmargin.empty())
+ if (!leftmargin.empty())
os << "\\leftmargin "
<< VSpace(leftmargin).asLyXCommand() << '\n';
- if (!topmargin.empty())
+ if (!topmargin.empty())
os << "\\topmargin "
<< VSpace(topmargin).asLyXCommand() << '\n';
- if (!rightmargin.empty())
+ if (!rightmargin.empty())
os << "\\rightmargin "
<< VSpace(rightmargin).asLyXCommand() << '\n';
- if (!bottommargin.empty())
+ if (!bottommargin.empty())
os << "\\bottommargin "
<< VSpace(bottommargin).asLyXCommand() << '\n';
- if (!headheight.empty())
+ if (!headheight.empty())
os << "\\headheight "
<< VSpace(headheight).asLyXCommand() << '\n';
- if (!headsep.empty())
+ if (!headsep.empty())
os << "\\headsep "
<< VSpace(headsep).asLyXCommand() << '\n';
- if (!footskip.empty())
+ if (!footskip.empty())
os << "\\footskip "
<< VSpace(footskip).asLyXCommand() << '\n';
os << "\\secnumdepth " << secnumdepth
// An output operator for insetquotes would be nice
case InsetQuotes::SingleQ:
os << "\\quotes_times 1\n"; break;
- case InsetQuotes::DoubleQ:
+ case InsetQuotes::DoubleQ:
os << "\\quotes_times 2\n"; break;
}
os << "\\papercolumns " << columns
}
else {
os << "\\bulletLaTeX " << i
- << "\n\t"
+ << "\n\t\""
<< user_defined_bullets[i].getText()
- << "\n\\end_bullet\n";
+ << "\"\n\\end_bullet\n";
}
}
}
void BufferParams::useClassDefaults()
{
- LyXTextClass const & tclass = textclasslist.TextClass(textclass);
+ LyXTextClass const & tclass = textclasslist[textclass];
sides = tclass.sides();
columns = tclass.columns();
bool BufferParams::hasClassDefaults() const
{
- LyXTextClass const & tclass = textclasslist.TextClass(textclass);
-
+ LyXTextClass const & tclass = textclasslist[textclass];
+
return (sides == tclass.sides()
&& columns == tclass.columns()
&& pagestyle == tclass.pagestyle()
void BufferParams::readLanguage(LyXLex & lex)
{
if (!lex.next()) return;
-
+
string const tmptok = lex.getString();
// check if tmptok is part of tex_babel in tex-defs.h
void BufferParams::readGraphicsDriver(LyXLex & lex)
{
if (!lex.next()) return;
-
+
string const tmptok = lex.getString();
// check if tmptok is part of tex_graphics in tex_defs.h
int n = 0;
while (true) {
string const test = tex_graphics[n++];
-
- if (test == tmptok) {
+
+ if (test == tmptok) {
graphicsDriver = tmptok;
break;
} else if (test == "last_item") {
" Setting graphics driver to `default'.\n");
graphicsDriver = "default";
break;
- }
+ }
}
}