mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-12 16:50:39 +00:00
fix bug 1404
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@9015 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2abde21f38
commit
4a66e4e538
@ -1,3 +1,9 @@
|
||||
2004-09-22 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||
|
||||
* paragraph.C (TeXOnePar): Make sure font setting is the first
|
||||
thing that gets output (and the last at the end). Should fix bug
|
||||
1404.
|
||||
|
||||
2004-07-15 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||
|
||||
* buffer.C (parseSingleLyXformat2Token): fix the off-by-one-error
|
||||
|
123
src/paragraph.C
123
src/paragraph.C
@ -970,51 +970,10 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
||||
bool further_blank_line = false;
|
||||
LyXLayout_ptr style;
|
||||
|
||||
// well we have to check if we are in an inset with unlimited
|
||||
// lenght (all in one row) if that is true then we don't allow
|
||||
// any special options in the paragraph and also we don't allow
|
||||
// any environment other then "Standard" to be valid!
|
||||
if ((in == 0) || !in->forceDefaultParagraphs(in)) {
|
||||
if ((in == 0) || !in->forceDefaultParagraphs(in))
|
||||
style = layout();
|
||||
|
||||
if (params().startOfAppendix()) {
|
||||
os << "\\appendix\n";
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
if (!params().spacing().isDefault()
|
||||
&& (!previous() || !previous()->hasSameLayout(this))) {
|
||||
os << params().spacing().writeEnvirBegin() << '\n';
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
if (style->isCommand()) {
|
||||
os << '\n';
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
if (params().pagebreakTop()) {
|
||||
os << "\\newpage";
|
||||
further_blank_line = true;
|
||||
}
|
||||
if (params().spaceTop().kind() != VSpace::NONE) {
|
||||
os << params().spaceTop().asLatexCommand(bparams);
|
||||
further_blank_line = true;
|
||||
}
|
||||
|
||||
if (params().lineTop()) {
|
||||
os << "\\lyxline{\\" << getFont(bparams, 0).latexSize() << '}'
|
||||
<< "\\vspace{-1\\parskip}";
|
||||
further_blank_line = true;
|
||||
}
|
||||
|
||||
if (further_blank_line) {
|
||||
os << '\n';
|
||||
texrow.newline();
|
||||
}
|
||||
} else {
|
||||
else
|
||||
style = bparams.getLyXTextClass().defaultLayout();
|
||||
}
|
||||
|
||||
Language const * language = getParLanguage(bparams);
|
||||
Language const * doc_language = bparams.language;
|
||||
@ -1056,6 +1015,48 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
// well we have to check if we are in an inset with unlimited
|
||||
// length (all in one row) if that is true then we don't allow
|
||||
// any special options in the paragraph and also we don't allow
|
||||
// any environment other then "Standard" to be valid!
|
||||
if ((in == 0) || !in->forceDefaultParagraphs(in)) {
|
||||
if (params().startOfAppendix()) {
|
||||
os << "\\appendix\n";
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
if (!params().spacing().isDefault()
|
||||
&& (!previous() || !previous()->hasSameLayout(this))) {
|
||||
os << params().spacing().writeEnvirBegin() << '\n';
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
if (style->isCommand()) {
|
||||
os << '\n';
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
if (params().pagebreakTop()) {
|
||||
os << "\\newpage";
|
||||
further_blank_line = true;
|
||||
}
|
||||
if (params().spaceTop().kind() != VSpace::NONE) {
|
||||
os << params().spaceTop().asLatexCommand(bparams);
|
||||
further_blank_line = true;
|
||||
}
|
||||
|
||||
if (params().lineTop()) {
|
||||
os << "\\lyxline{\\" << getFont(bparams, 0).latexSize() << '}'
|
||||
<< "\\vspace{-1\\parskip}";
|
||||
further_blank_line = true;
|
||||
}
|
||||
|
||||
if (further_blank_line) {
|
||||
os << '\n';
|
||||
texrow.newline();
|
||||
}
|
||||
}
|
||||
|
||||
switch (style->latextype) {
|
||||
case LATEX_COMMAND:
|
||||
os << '\\'
|
||||
@ -1133,24 +1134,6 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
||||
}
|
||||
}
|
||||
|
||||
if (!next_ && language->babel() != doc_language->babel()) {
|
||||
// Since \selectlanguage write the language to the aux
|
||||
// file, we need to reset the language at the end of
|
||||
// footnote or float.
|
||||
|
||||
if (lyxrc.language_command_end.empty())
|
||||
os << '\n'
|
||||
<< subst(lyxrc.language_command_begin,
|
||||
"$$lang",
|
||||
doc_language->babel());
|
||||
else
|
||||
os << '\n'
|
||||
<< subst(lyxrc.language_command_end,
|
||||
"$$lang",
|
||||
language->babel());
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
if ((in == 0) || !in->forceDefaultParagraphs(in)) {
|
||||
further_blank_line = false;
|
||||
if (params().lineBottom()) {
|
||||
@ -1180,6 +1163,24 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
|
||||
}
|
||||
}
|
||||
|
||||
if (!next_ && language->babel() != doc_language->babel()) {
|
||||
// Since \selectlanguage write the language to the aux
|
||||
// file, we need to reset the language at the end of
|
||||
// footnote or float.
|
||||
|
||||
if (lyxrc.language_command_end.empty())
|
||||
os << '\n'
|
||||
<< subst(lyxrc.language_command_begin,
|
||||
"$$lang",
|
||||
doc_language->babel());
|
||||
else
|
||||
os << '\n'
|
||||
<< subst(lyxrc.language_command_end,
|
||||
"$$lang",
|
||||
language->babel());
|
||||
texrow.newline();
|
||||
}
|
||||
|
||||
// we don't need it for the last paragraph!!!
|
||||
// Note from JMarc: we will re-add a \n explicitely in
|
||||
// TeXEnvironment, because it is needed in this case
|
||||
|
@ -45,7 +45,7 @@ What's new
|
||||
working correctly [bug #605].
|
||||
|
||||
- Fix nesting of language change commands, especially important for
|
||||
Arabic [bug #1404].
|
||||
Arabic [bugs #1225, #1404].
|
||||
|
||||
- Fix missing line break in front of \end{...} in some cases [bug #1225].
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user