From c3221a5d49e9e2f157d2ac23f22be03150d39a24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 14 May 2002 14:22:11 +0000 Subject: [PATCH] bug338patch.gz git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4163 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/buffer.C | 7 ++++--- src/buffer.h | 2 +- src/insets/ChangeLog | 9 +++++++++ src/insets/insetfoot.C | 12 ++++++++++++ src/insets/insettext.C | 4 ++-- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 33177df7ab..e3bcb36aca 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2002-05-11 Dekel Tsur + + * buffer.C (latexParagraphs): Add new argument (moving_arg). + 2002-05-14 Juergen Vigna * text.C (breakParagraph): fixed function to honor the keepempty diff --git a/src/buffer.C b/src/buffer.C index 930074c404..51cc8b611f 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -2644,7 +2644,8 @@ void Buffer::makeLaTeXFile(string const & fname, // LaTeX all paragraphs from par to endpar, if endpar == 0 then to the end // void Buffer::latexParagraphs(ostream & ofs, Paragraph * par, - Paragraph * endpar, TexRow & texrow) const + Paragraph * endpar, TexRow & texrow, + bool moving_arg) const { bool was_title = false; bool already_title = false; @@ -2679,10 +2680,10 @@ void Buffer::latexParagraphs(ostream & ofs, Paragraph * par, { par = par->TeXEnvironment(this, params, ofs, texrow); } else { - par = par->TeXOnePar(this, params, ofs, texrow, false); + par = par->TeXOnePar(this, params, ofs, texrow, moving_arg); } } else { - par = par->TeXOnePar(this, params, ofs, texrow, false); + par = par->TeXOnePar(this, params, ofs, texrow, moving_arg); } } // It might be that we only have a title in this document diff --git a/src/buffer.h b/src/buffer.h index 67e9eeb40b..f18e03e6f8 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -162,7 +162,7 @@ public: \param \a endpar if == 0 then to the end */ void latexParagraphs(std::ostream & os, Paragraph * par, - Paragraph * endpar, TexRow & texrow) const; + Paragraph * endpar, TexRow & texrow, bool moving_arg = false) const; /// void simpleDocBookOnePar(std::ostream &, Paragraph * par, int & desc_on, diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index b2ee4bc2e5..cee2d90a1b 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,12 @@ +2002-05-11 Dekel Tsur + + * insettext.C (latex): Honor the moving_arg argument. + +2002-04-22 Jean-Marc Lasgouttes + + * insetfoot.C (latex): if a footnote is in a title layout, then it + is a \thanks. And then, its contents is a moving argument. + 2002-05-14 Juergen Vigna * insetcollapsable.C (InsetCollapsable): forgot to initialize diff --git a/src/insets/insetfoot.C b/src/insets/insetfoot.C index cf1576383b..28ee366ce0 100644 --- a/src/insets/insetfoot.C +++ b/src/insets/insetfoot.C @@ -22,6 +22,12 @@ #include "insets/insettext.h" #include "support/LOstream.h" #include "debug.h" +// the following are needed just to get the layout of the enclosing +// paragraph. This seems a bit too much to me (JMarc) +#include "lyxlayout.h" +#include "lyxtextclasslist.h" +#include "buffer.h" +#include "paragraph.h" using std::ostream; @@ -58,6 +64,12 @@ string const InsetFoot::editMessage() const int InsetFoot::latex(Buffer const * buf, ostream & os, bool fragile, bool fp) const { + if (buf && parOwner()) { + LyXLayout const & layout = + textclasslist[buf->params.textclass][parOwner()->layout()]; + fragile |= layout.intitle; + } + os << "%\n\\footnote{"; int const i = inset.latex(buf, os, fragile, fp); diff --git a/src/insets/insettext.C b/src/insets/insettext.C index a2190ca1da..b375b56d1e 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -1546,10 +1546,10 @@ InsetText::localDispatch(BufferView * bv, } -int InsetText::latex(Buffer const * buf, ostream & os, bool, bool) const +int InsetText::latex(Buffer const * buf, ostream & os, bool moving_arg, bool) const { TexRow texrow; - buf->latexParagraphs(os, par, 0, texrow); + buf->latexParagraphs(os, par, 0, texrow, moving_arg); return texrow.rows(); } -- 2.39.2