diff --git a/src/ChangeLog b/src/ChangeLog index 760f3d5b99..2ac0aca3e8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,11 @@ 2003-09-18 Angus Leeming - * LaTeXFeatures.[Ch]: append an '_' to the names of all private member variables. + * LaTeXFeatures.[Ch]: append a '_' to the names of all private member variables. + (ctor): pass and store a 'Buffer const &' + (buffer): new member function. + + * buffer.C (makeDocBookFile, makeLinuxDocFile, makeLaTeXFile): pass '*this' to + the LaTeXFeatures ctor. 2003-09-18 Angus Leeming diff --git a/src/LaTeXFeatures.C b/src/LaTeXFeatures.C index 15cf2b630d..cf96b66de4 100644 --- a/src/LaTeXFeatures.C +++ b/src/LaTeXFeatures.C @@ -42,8 +42,8 @@ using std::ostringstream; using std::set; -LaTeXFeatures::LaTeXFeatures(BufferParams const & p) - : params_(p) +LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p) + : buffer_(b), params_(p) {} @@ -449,6 +449,12 @@ void LaTeXFeatures::showStruct() const { } +Buffer const & LaTeXFeatures::buffer() const +{ + return buffer_; +} + + BufferParams const & LaTeXFeatures::bufferParams() const { return params_; diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h index 38b4ecde08..90b49c2ba5 100644 --- a/src/LaTeXFeatures.h +++ b/src/LaTeXFeatures.h @@ -20,6 +20,7 @@ #include #include +class Buffer; class BufferParams; struct Language; @@ -39,7 +40,7 @@ struct Language; class LaTeXFeatures { public: /// - LaTeXFeatures(BufferParams const &); + LaTeXFeatures(Buffer const &, BufferParams const &); /// The packages needed by the document string const getPackages() const; /// The macros definitions needed by the document @@ -77,6 +78,8 @@ public: /// void useLayout(string const & lyt); /// + Buffer const & buffer() const; + /// BufferParams const & bufferParams() const; /// the return value is dependent upon both LyXRC and LaTeXFeatures. bool useBabel() const; @@ -103,6 +106,8 @@ private: /// FileMap IncludedFiles_; /// + Buffer const & buffer_; + /// BufferParams const & params_; }; diff --git a/src/buffer.C b/src/buffer.C index 9bf58d5507..8bdf819992 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -1111,7 +1111,7 @@ void Buffer::makeLaTeXFile(ostream & os, // validate the buffer. lyxerr[Debug::LATEX] << " Validating buffer..." << endl; - LaTeXFeatures features(params()); + LaTeXFeatures features(*this, params()); validate(features); lyxerr[Debug::LATEX] << " Buffer validation done." << endl; @@ -1250,7 +1250,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) niceFile() = nice; // this will be used by included files. - LaTeXFeatures features(params()); + LaTeXFeatures features(*this, params()); validate(features); @@ -1680,7 +1680,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body) niceFile() = nice; // this will be used by Insetincludes. - LaTeXFeatures features(params()); + LaTeXFeatures features(*this, params()); validate(features); texrow().reset();