From 3d9f2089dd528ff458c1f18685fffac6a9530d9e Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 15 Nov 2004 13:39:06 +0000 Subject: [PATCH] propagate the need_protect property to optional insets (bug 1739) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9249 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 8 ++++++++ src/output_latex.C | 6 +++++- src/paragraph.C | 10 ++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d2640f3e0a..2874370ecb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-11-10 Jean-Marc Lasgouttes + + * output_latex.C (TeXOnePar): override runparams.moving_arg + according to the needprotect value of the current paragraph (bug 1739) + + * paragraph.C (simpleTeXOnePar): no need to override + runparams.moving_args here + 2004-11-14 John Spray * vspace.C: fix off-by-one-error, related to fix #1682 diff --git a/src/output_latex.C b/src/output_latex.C index 31a8416d46..b50748dd52 100644 --- a/src/output_latex.C +++ b/src/output_latex.C @@ -18,6 +18,7 @@ #include "encoding.h" #include "language.h" #include "lyxrc.h" +#include "outputparams.h" #include "paragraph.h" #include "paragraph_funcs.h" #include "ParagraphParameters.h" @@ -214,7 +215,7 @@ TeXOnePar(Buffer const & buf, ParagraphList const & paragraphs, ParagraphList::const_iterator pit, ostream & os, TexRow & texrow, - OutputParams const & runparams, + OutputParams const & runparams_in, string const & everypar) { lyxerr[Debug::LATEX] << "TeXOnePar... " << &*pit << " '" @@ -230,6 +231,9 @@ TeXOnePar(Buffer const & buf, else style = bparams.getLyXTextClass().defaultLayout(); + OutputParams runparams = runparams_in; + runparams.moving_arg |= style->needprotect; + Language const * language = pit->getParLanguage(bparams); Language const * doc_language = bparams.language; Language const * previous_language = diff --git a/src/paragraph.C b/src/paragraph.C index 5e02c66dd2..516228c5d7 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -929,8 +929,6 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, basefont = getLayoutFont(bparams, outerfont); } - bool const moving_arg = runparams.moving_arg | style->needprotect; - // Which font is currently active? LyXFont running_font(basefont); // Do we have an open font change? @@ -947,7 +945,8 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, ++column; } if (!asdefault) - column += startTeXParParams(bparams, os, moving_arg); + column += startTeXParParams(bparams, os, + runparams.moving_arg); } for (pos_type i = 0; i < size(); ++i) { @@ -971,7 +970,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, if (!asdefault) column += startTeXParParams(bparams, os, - moving_arg); + runparams.moving_arg); } value_type c = getChar(i); @@ -1029,7 +1028,6 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, running_change = change; OutputParams rp = runparams; - rp.moving_arg = moving_arg; rp.free_spacing = style->free_spacing; rp.local_language = font.language()->babel(); rp.intitle = style->intitle; @@ -1073,7 +1071,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, } if (!asdefault) { - column += endTeXParParams(bparams, os, moving_arg); + column += endTeXParParams(bparams, os, runparams.moving_arg); } lyxerr[Debug::LATEX] << "SimpleTeXOnePar...done " << this << endl;