From b86565cfe5b9ebb146900db272189e0531eab2f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sat, 2 Mar 2002 19:09:56 +0000 Subject: [PATCH] fix calling of LaTeXFeatures git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3641 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/buffer.C | 33 +++++++++++++-------------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index fbd6196de9..31ae9d2322 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2002-03-02 Lars Gullik Bjønnes + * buffer.C (makeLaTeXFile): fix calling of LaTeXFeatures, and + clean up the code slightly. + (makeLinuxDocFile): ditto + (makeDocBookFile): ditto + * text2.C: layout as string * text.C: layout as string diff --git a/src/buffer.C b/src/buffer.C index 331c336463..d74d032ade 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -2015,9 +2015,6 @@ void Buffer::makeLaTeXFile(string const & fname, tex_code_break_column = lyxrc.ascii_linelen; - LyXTextClass const & tclass = - textclasslist[params.textclass]; - ofstream ofs(fname.c_str()); if (!ofs) { Alert::err_alert(_("Error: Cannot open file: "), fname); @@ -2026,7 +2023,7 @@ void Buffer::makeLaTeXFile(string const & fname, // validate the buffer. lyxerr[Debug::LATEX] << " Validating buffer..." << endl; - LaTeXFeatures features(params, tclass.size()); + LaTeXFeatures features(params); validate(features); lyxerr[Debug::LATEX] << " Buffer validation done." << endl; @@ -2072,6 +2069,8 @@ void Buffer::makeLaTeXFile(string const & fname, ofs << "\\documentclass"; + LyXTextClass const & tclass = textclasslist[params.textclass]; + ostringstream options; // the document class options. if (tokenPos(tclass.opt_fontsize(), @@ -2158,9 +2157,7 @@ void Buffer::makeLaTeXFile(string const & fname, ofs << '[' << strOptions << ']'; } - ofs << '{' - << textclasslist[params.textclass].latexname() - << "}\n"; + ofs << '{' << tclass.latexname() << "}\n"; texrow.newline(); // end of \documentclass defs @@ -2612,15 +2609,15 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) niceFile = nice; // this will be used by included files. - LyXTextClass const & tclass = textclasslist[params.textclass]; - - LaTeXFeatures features(params, tclass.size()); + LaTeXFeatures features(params); validate(features); texrow.reset(); - string top_element = textclasslist[params.textclass].latexname(); + LyXTextClass const & tclass = textclasslist[params.textclass]; + + string top_element = tclass.latexname(); if (!body_only) { ofs << " environment_stack(5); while (par) { - LyXLayout const & style = - textclasslist[params.textclass][par->layout()]; + LyXLayout const & style = tclass[par->layout()]; // treat as a special case for compatibility with old code if (par->isInset(0)) { @@ -3053,15 +3049,13 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body) niceFile = nice; // this will be used by Insetincludes. - LyXTextClass const & tclass = - textclasslist[params.textclass]; - - LaTeXFeatures features(params, tclass.size()); + LaTeXFeatures features(params); validate(features); texrow.reset(); - string top_element = textclasslist[params.textclass].latexname(); + LyXTextClass const & tclass = textclasslist[params.textclass]; + string top_element = tclass.latexname(); if (!only_body) { ofs << "layout()]; + LyXLayout const & style = tclass[par->layout()]; // environment tag closing for (; depth > par->params().depth(); --depth) { -- 2.39.2