]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
Paragraph::inInset() shall not be used if the owner inset was not initialized. Make...
[lyx.git] / src / output_latex.cpp
index 4ff671633d00e85f3a1b4db4f2234a65d0c9fcb0..cc6373ff319ed1afaecd7c07250fda7c5d01c436 100644 (file)
@@ -901,6 +901,7 @@ pair<bool, int> switchEncoding(odocstream & os, BufferParams const & bparams,
        docstring const inputenc_arg(from_ascii(newEnc.latexName()));
        switch (newEnc.package()) {
                case Encoding::none:
+               case Encoding::japanese:
                        // shouldn't ever reach here, see above
                        return make_pair(true, 0);
                case Encoding::inputenc: {
@@ -917,13 +918,18 @@ pair<bool, int> switchEncoding(odocstream & os, BufferParams const & bparams,
                                open_encoding_ = none;
                                count += 7;
                        }
-                       if (runparams.local_font != 0 && oldEnc.package() == Encoding::CJK) {
-                               // within insets, \inputenc switches need to be 
-                               // embraced within \bgroup ... \egroup; else CJK fails.
+                       if (runparams.local_font != 0
+                           && oldEnc.package() == Encoding::CJK) {
+                               // within insets, \inputenc switches need
+                               // to be embraced within \bgroup...\egroup;
+                               // else CJK fails.
                                os << "\\bgroup";
                                count += 7;
                                open_encoding_ = inputenc;
                        }
+                       // with the japanese option, inputenc is omitted.
+                       if (runparams.use_japanese)
+                               return make_pair(true, count);
                        os << "\\inputencoding{" << inputenc_arg << '}';
                        return make_pair(true, count + 16);
                }