* output_latex:cpp:

- fix some CJK nesting issues.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27665 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-11-22 16:40:39 +00:00
parent 09738dbba4
commit 17e11a930d

View File

@ -180,8 +180,9 @@ TeXEnvironment(Buffer const & buf,
bool cjk_nested = false; bool cjk_nested = false;
if (par_language->encoding()->package() == Encoding::CJK && if (par_language->encoding()->package() == Encoding::CJK &&
open_encoding_ != CJK && pit->isMultiLingual(bparams)) { open_encoding_ != CJK && pit->isMultiLingual(bparams)) {
os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName()) if (prev_par_language->encoding()->package() == Encoding::CJK)
<< "}{" << from_ascii(bparams.fontsCJK) << "}%\n"; os << "\\begin{CJK}{" << from_ascii(par_language->encoding()->latexName())
<< "}{" << from_ascii(bparams.fontsCJK) << "}%\n";
open_encoding_ = CJK; open_encoding_ = CJK;
cjk_nested = true; cjk_nested = true;
texrow.newline(); texrow.newline();
@ -658,8 +659,8 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
if (nextpit != paragraphs.end() && open_encoding_ == CJK && if (nextpit != paragraphs.end() && open_encoding_ == CJK &&
(nextpit->getParLanguage(bparams)->encoding()->package() != Encoding::CJK || (nextpit->getParLanguage(bparams)->encoding()->package() != Encoding::CJK ||
nextpit->layout().isEnvironment() && nextpit->isMultiLingual(bparams)) nextpit->layout().isEnvironment() && nextpit->isMultiLingual(bparams))
// in environments, CJK has to be closed later (nesting!) // inbetween environments, CJK has to be closed later (nesting!)
&& !style.isEnvironment()) { && (!style.isEnvironment() || !nextpit->layout().isEnvironment())) {
os << "\\end{CJK}\n"; os << "\\end{CJK}\n";
open_encoding_ = none; open_encoding_ = none;
} }