]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetListings.cpp
Merge branch 'master' into biblatex2
[lyx.git] / src / insets / InsetListings.cpp
index 8211ba363495929029836b637e7b95f63c78fcff..bec33b12cb44ee86ce28d927a1757a21a34cb99d 100644 (file)
@@ -158,8 +158,20 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
                        if (i == 0 && par->isInset(i) && i + 1 == siz)
                                captionline = true;
                        // ignore all struck out text and (caption) insets
-                       if (par->isDeleted(i) || par->isInset(i))
+                       if (par->isDeleted(i)
+                           || (par->isInset(i) && par->getInset(i)->lyxCode() == CAPTION_CODE))
                                continue;
+                       if (par->isInset(i)) {
+                               // Currently, this can only be a quote inset
+                               // that is output as plain quote here, but
+                               // we use more generic code anyway.
+                               otexstringstream ots;
+                               OutputParams rp = runparams;
+                               rp.pass_thru = true;
+                               par->getInset(i)->latex(ots, rp);
+                               code += ots.str();
+                               continue;
+                       }
                        char_type c = par->getChar(i);
                        // we can only output characters covered by the current
                        // encoding!
@@ -224,10 +236,13 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
                OutputParams rp = runparams;
                rp.moving_arg = true;
                TexString caption = getCaption(rp);
+               os << breakln << "\\begin{lstlisting}";
                if (param_string.empty() && caption.str.empty())
-                       os << breakln << "\\begin{lstlisting}\n";
+                       os << "\n";
                else {
-                       os << breakln << "\\begin{lstlisting}[";
+                       if (!runparams.nice)
+                               os << safebreakln;
+                       os << "[";
                        if (!caption.str.empty()) {
                                os << "caption={" << move(caption) << '}';
                                if (!param_string.empty())