From 00a58355ddd5df6e275a96e6cdfb4669c77ae7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Matox?= Date: Sat, 26 Jul 2003 21:37:10 +0000 Subject: [PATCH] Rename arguments of makeLaTeXFile to a sane scheme. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7370 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 ++++++ src/buffer.C | 16 ++++++++-------- src/buffer.h | 8 ++++---- src/bufferlist.C | 2 +- src/graphics/ChangeLog | 5 +++++ src/graphics/PreviewLoader.C | 2 +- src/insets/ChangeLog | 4 ++++ src/insets/insetinclude.C | 2 +- 8 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f9f1514f91..28a046a585 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-07-27 José Matos + + * buffer.[Ch] (makeLaTeXFile): changed name of arguments for + consistency in both functions. + * bufferlist.C (updateIncludedTeXfiles): change client to comply. + 2003-07-26 Asger Alstrup * rowpainter.C (paintRows): Change algorithm to work directly on diff --git a/src/buffer.C b/src/buffer.C index e3bb16dc57..efb8945115 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -910,7 +910,7 @@ void Buffer::writeFileAscii(ostream & os, int linelen) void Buffer::makeLaTeXFile(string const & fname, string const & original_path, LatexRunParams const & runparams, - bool only_body, bool only_preamble) + bool output_preamble, bool output_body) { lyxerr[Debug::LATEX] << "makeLaTeXFile..." << endl; @@ -919,7 +919,7 @@ void Buffer::makeLaTeXFile(string const & fname, return; makeLaTeXFile(ofs, original_path, - runparams, only_body, only_preamble); + runparams, output_preamble, output_body); ofs.close(); if (ofs.fail()) { @@ -931,7 +931,7 @@ void Buffer::makeLaTeXFile(string const & fname, void Buffer::makeLaTeXFile(ostream & os, string const & original_path, LatexRunParams const & runparams_in, - bool only_body, bool only_preamble) + bool output_preamble, bool output_body) { LatexRunParams runparams = runparams_in; niceFile = runparams.nice; // this will be used by Insetincludes. @@ -947,7 +947,7 @@ void Buffer::makeLaTeXFile(ostream & os, // first paragraph of the document. (Asger) texrow.start(paragraphs.begin()->id(), 0); - if (!only_body && runparams.nice) { + if (output_preamble && runparams.nice) { os << "%% " << lyx_docversion << " created this file. " "For more info, see http://www.lyx.org/.\n" "%% Do not edit unless you really know what " @@ -963,7 +963,7 @@ void Buffer::makeLaTeXFile(ostream & os, // input@path is set when the actual parameter // original_path is set. This is done for usual tex-file, but not // for nice-latex-file. (Matthias 250696) - if (!only_body) { + if (output_preamble) { if (!runparams.nice) { // code for usual, NOT nice-latex-file os << "\\batchmode\n"; // changed @@ -985,13 +985,13 @@ void Buffer::makeLaTeXFile(ostream & os, // Write the preamble runparams.use_babel = params.writeLaTeX(os, features, texrow); - if (only_preamble) + if (!output_body) return; // make the body. os << "\\begin{document}\n"; texrow.newline(); - } // only_body + } // output_preamble lyxerr[Debug::INFO] << "preamble finished, now the body." << endl; if (!lyxrc.language_auto_begin) { @@ -1014,7 +1014,7 @@ void Buffer::makeLaTeXFile(ostream & os, texrow.newline(); } - if (!only_body) { + if (output_preamble) { os << "\\end{document}\n"; texrow.newline(); diff --git a/src/buffer.h b/src/buffer.h index 55621f3146..d3fd4229e3 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -141,14 +141,14 @@ public: void makeLaTeXFile(string const & filename, string const & original_path, LatexRunParams const &, - bool only_body = false, - bool only_preamble = false); + bool output_preamble = true, + bool output_body = true); /// void makeLaTeXFile(std::ostream & os, string const & original_path, LatexRunParams const &, - bool only_body = false, - bool only_preamble = false); + bool output_preamble = true, + bool output_body = true); /// void simpleDocBookOnePar(std::ostream &, ParagraphList::iterator par, int & desc_on, diff --git a/src/bufferlist.C b/src/bufferlist.C index 0ae822582e..5b8c6d58df 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -236,7 +236,7 @@ void BufferList::updateIncludedTeXfiles(string const & mastertmpdir, writefile += '/'; writefile += (*it)->getLatexName(); (*it)->makeLaTeXFile(writefile, mastertmpdir, - runparams, true); + runparams, false); (*it)->markDepClean(mastertmpdir); } } diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 3bc09ebf6b..787bf3c3a9 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,8 @@ +2003-07-27 José Matos + + * PreviewLoader.C (Impl::dumpPreamble): comply with makeLaTeXFile + argument change. + 2003-07-21 Angus Leeming * GraphicsCache.h: diff --git a/src/graphics/PreviewLoader.C b/src/graphics/PreviewLoader.C index ecf9aa9b57..c00ff03328 100644 --- a/src/graphics/PreviewLoader.C +++ b/src/graphics/PreviewLoader.C @@ -575,7 +575,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const runparams.nice = true; runparams.moving_arg = true; runparams.free_spacing = true; - tmp.makeLaTeXFile(os, buffer_.filePath(), runparams, false, true); + tmp.makeLaTeXFile(os, buffer_.filePath(), runparams, true, false); // FIXME! This is a HACK! The proper fix is to control the 'true' // passed to WriteStream below: diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 4f2f8de823..d155146562 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-07-27 José Matos + + * insetinclude (latex): comply with makeLaTeXFile argument change. + 2003-07-26 Asger Alstrup * insettext.C (reinitLyXText): Get rid of updateLocal which causes diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 0d49e952e6..03f9d0d5eb 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -345,7 +345,7 @@ int InsetInclude::latex(Buffer const * buffer, ostream & os, tmp->markDepClean(buffer->tmppath); tmp->makeLaTeXFile(writefile, OnlyPath(getMasterFilename()), - runparams, true); + runparams, false); } if (isVerbatim()) {