X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetListings.cpp;h=b54b4106fd537bc4517e1c8538dd880d6ba4be49;hb=51d4d42906dd553ec72fa03e6c707c02bd73d494;hp=aa8a831a600a7e85a3d3a999788a5e6676aa93f4;hpb=33c665676952a3883bef162aeda554c4d3e7c2d1;p=lyx.git diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index aa8a831a60..b54b4106fd 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -135,7 +135,7 @@ int InsetListings::latex(odocstream & os, OutputParams const & runparams) const // NOTE: I use {} to quote text, which is an experimental feature // of the listings package (see page 25 of the manual) int lines = 0; - bool isInline = params().isInline(); + bool const isInline = params().isInline(); // get the paragraphs. We can not output them directly to given odocstream // because we can not yet determine the delimiter character of \lstinline docstring code; @@ -273,6 +273,37 @@ int InsetListings::latex(odocstream & os, OutputParams const & runparams) const } +docstring InsetListings::xhtml(odocstream & os, OutputParams const & rp) const +{ + odocstringstream out; + + bool const isInline = params().isInline(); + if (isInline) + out << "
\n"; + else { + out << "
\n"; + docstring caption = getCaptionHTML(rp); + if (!caption.empty()) + out << "
" << caption << "
\n"; + } + + out << "
\n";
+	docstring def = InsetText::xhtml(out, rp);
+	out << "\n
\n"; + + if (isInline) { + out << "
\n"; + os << out.str(); + } else { + out << "
"; + // In this case, this needs to be deferred, but we'll put it + // before anything the text itself deferred. + def = out.str() + '\n' + def; + } + return def; +} + + docstring InsetListings::contextMenu(BufferView const &, int, int) const { return from_ascii("context-listings");