]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetListings.cpp
Revert "Do not crash is release mode if we stumble across an unrealized font."
[lyx.git] / src / insets / InsetListings.cpp
index 9c7daf22198cfa05cd3d0c1c206fc7a332139dcc..1afa0f3612625d663e8500d65dbbcb5c3de9ce11 100644 (file)
@@ -30,6 +30,7 @@
 #include "output_xhtml.h"
 #include "OutputParams.h"
 #include "TextClass.h"
+#include "texstream.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
@@ -126,7 +127,7 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
        // glyphs, except if full-unicode aware backends
        // such as XeTeX or LuaTeX are used, and with pLaTeX.
        bool const multibyte_possible = runparams.isFullUnicode()
-           || (buffer().params().bufferFormat() == "platex"
+           || (buffer().params().encoding().package() == Encoding::japanese
                && runparams.encoding->package() == Encoding::japanese);
 
        if (!multibyte_possible && !runparams.encoding->hasFixedWidth()) {
@@ -395,9 +396,8 @@ docstring InsetListings::getCaption(OutputParams const & runparams) const
        if (ins == 0)
                return docstring();
 
-       TexRow texrow;
        odocstringstream ods;
-       otexstream os(ods, texrow);
+       otexstream os(ods, false);
        ins->getArgs(os, runparams);
        ins->getArgument(os, runparams);
 
@@ -418,7 +418,7 @@ docstring InsetListings::getCaption(OutputParams const & runparams) const
        //
        // NOTE that } is not allowed in blah2.
        regex const reg("(.*)\\\\label\\{(.*?)\\}(.*)");
-       string const new_cap("\\1\\3},label={\\2");
+       string const new_cap("$1$3},label={$2");
        return from_utf8(regex_replace(to_utf8(cap), reg, new_cap));
 }