mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 06:20:28 +00:00
Coding style/de-indent
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36939 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
41aa051d22
commit
2ab1601311
@ -590,8 +590,8 @@ void TeXOnePar(Buffer const & buf,
|
|||||||
// Switch file encoding if necessary; no need to do this for "default"
|
// Switch file encoding if necessary; no need to do this for "default"
|
||||||
// encoding, since this only affects the position of the outputted
|
// encoding, since this only affects the position of the outputted
|
||||||
// \inputencoding command; the encoding switch will occur when necessary
|
// \inputencoding command; the encoding switch will occur when necessary
|
||||||
if (bparams.inputenc == "auto" &&
|
if (bparams.inputenc == "auto"
|
||||||
runparams.encoding->package() != Encoding::none) {
|
&& runparams.encoding->package() != Encoding::none) {
|
||||||
// Look ahead for future encoding changes.
|
// Look ahead for future encoding changes.
|
||||||
// We try to output them at the beginning of the paragraph,
|
// We try to output them at the beginning of the paragraph,
|
||||||
// since the \inputencoding command is not allowed e.g. in
|
// since the \inputencoding command is not allowed e.g. in
|
||||||
@ -602,9 +602,9 @@ void TeXOnePar(Buffer const & buf,
|
|||||||
char_type const c = par.getChar(i);
|
char_type const c = par.getChar(i);
|
||||||
Encoding const * const encoding =
|
Encoding const * const encoding =
|
||||||
par.getFontSettings(bparams, i).language()->encoding();
|
par.getFontSettings(bparams, i).language()->encoding();
|
||||||
if (encoding->package() != Encoding::CJK &&
|
if (encoding->package() != Encoding::CJK
|
||||||
runparams.encoding->package() == Encoding::inputenc &&
|
&& runparams.encoding->package() == Encoding::inputenc
|
||||||
c < 0x80)
|
&& c < 0x80)
|
||||||
continue;
|
continue;
|
||||||
if (par.isInset(i))
|
if (par.isInset(i))
|
||||||
break;
|
break;
|
||||||
@ -613,38 +613,39 @@ void TeXOnePar(Buffer const & buf,
|
|||||||
// encoding to that required by the language of c.
|
// encoding to that required by the language of c.
|
||||||
// With CJK, only add switch if we have CJK content at the beginning
|
// With CJK, only add switch if we have CJK content at the beginning
|
||||||
// of the paragraph
|
// of the paragraph
|
||||||
if (encoding->package() != Encoding::CJK || i == 0) {
|
if (i != 0 && encoding->package() == Encoding::CJK)
|
||||||
pair<bool, int> enc_switch = switchEncoding(os, bparams, runparams,
|
continue;
|
||||||
*encoding);
|
|
||||||
// the following is necessary after a CJK environment in a multilingual
|
pair<bool, int> enc_switch = switchEncoding(os, bparams, runparams,
|
||||||
// context (nesting issue).
|
*encoding);
|
||||||
if (par_language->encoding()->package() == Encoding::CJK &&
|
// the following is necessary after a CJK environment in a multilingual
|
||||||
open_encoding_ != CJK && cjk_inherited_ == 0) {
|
// context (nesting issue).
|
||||||
os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName())
|
if (par_language->encoding()->package() == Encoding::CJK
|
||||||
<< "}{" << from_ascii(bparams.fonts_cjk) << "}%\n";
|
&& open_encoding_ != CJK && cjk_inherited_ == 0) {
|
||||||
open_encoding_ = CJK;
|
os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName())
|
||||||
|
<< "}{" << from_ascii(bparams.fonts_cjk) << "}%\n";
|
||||||
|
open_encoding_ = CJK;
|
||||||
|
texrow.newline();
|
||||||
|
}
|
||||||
|
if (encoding->package() != Encoding::none && enc_switch.first) {
|
||||||
|
if (enc_switch.second > 0) {
|
||||||
|
// the '%' is necessary to prevent unwanted whitespace
|
||||||
|
os << "%\n";
|
||||||
texrow.newline();
|
texrow.newline();
|
||||||
}
|
}
|
||||||
if (encoding->package() != Encoding::none && enc_switch.first) {
|
// With CJK, the CJK tag had to be closed first (see above)
|
||||||
if (enc_switch.second > 0) {
|
if (runparams.encoding->package() == Encoding::CJK) {
|
||||||
// the '%' is necessary to prevent unwanted whitespace
|
os << from_ascii(subst(
|
||||||
os << "%\n";
|
lang_begin_command,
|
||||||
texrow.newline();
|
"$$lang",
|
||||||
}
|
par_lang))
|
||||||
// With CJK, the CJK tag had to be closed first (see above)
|
// the '%' is necessary to prevent unwanted whitespace
|
||||||
if (runparams.encoding->package() == Encoding::CJK) {
|
<< "%\n";
|
||||||
os << from_ascii(subst(
|
texrow.newline();
|
||||||
lang_begin_command,
|
|
||||||
"$$lang",
|
|
||||||
par_lang))
|
|
||||||
// the '%' is necessary to prevent unwanted whitespace
|
|
||||||
<< "%\n";
|
|
||||||
texrow.newline();
|
|
||||||
}
|
|
||||||
runparams.encoding = encoding;
|
|
||||||
}
|
}
|
||||||
break;
|
runparams.encoding = encoding;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user