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
This commit is contained in:
Jean-Marc Lasgouttes 2004-11-15 13:39:06 +00:00
parent f95d6c7a53
commit 3d9f2089dd
3 changed files with 17 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2004-11-10 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* 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 <spray_john@users.sourceforge.net>
* vspace.C: fix off-by-one-error, related to fix #1682

View File

@ -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 =

View File

@ -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;