X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetListings.cpp;h=d3deadb6242df1fc3a51a4cf5b6cef0c2fe46098;hb=2c357c1d23b7b83839a9beb8225d4f1ae4f793b4;hp=b52e9fb9afa9b09b51ea23e7976bc20a88d4c060;hpb=3d443b4c9dc657663a7d67c8254894345e551a06;p=lyx.git diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index b52e9fb9af..d3deadb624 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -21,56 +21,34 @@ #include "DispatchResult.h" #include "FuncRequest.h" #include "FuncStatus.h" -#include "gettext.h" +#include "support/gettext.h" #include "InsetList.h" #include "Language.h" #include "MetricsInfo.h" +#include "TextClass.h" +#include "support/docstream.h" #include "support/lstrings.h" #include -namespace lyx { +using namespace std; +using namespace lyx::support; -using support::token; -using support::contains; -using support::subst; +namespace lyx { -using std::istringstream; -using std::ostream; -using std::ostringstream; -using std::string; char const lstinline_delimiters[] = "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm"; -void InsetListings::init() -{ - setButtonLabel(); - FontInfo font = sane_font; - font.decSize(); - font.decSize(); - font.setColor(Color_none); - setLabelFont(font); - // FIXME: what to do with those? - //text_.current_font.setLanguage(latex_language); - //text_.real_current_font.setLanguage(latex_language); -} - - InsetListings::InsetListings(BufferParams const & bp, InsetListingsParams const & par) : InsetCollapsable(bp, par.status()) -{ - setLayout(bp); - init(); -} +{} InsetListings::InsetListings(InsetListings const & in) : InsetCollapsable(in), params_(in.params_) -{ - init(); -} +{} Inset * InsetListings::clone() const @@ -220,8 +198,7 @@ int InsetListings::latex(Buffer const & buf, odocstream & os, os << from_utf8(param_string) << "]\n"; } lines += 4; - os << code - << "\n\\end{lstlisting}\n\\endgroup\n"; + os << code << "\n\\end{lstlisting}\n\\endgroup\n"; lines += 3; } @@ -274,7 +251,7 @@ bool InsetListings::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetListings::setButtonLabel() { // FIXME UNICODE - if (decoration() == Classic) + if (decoration() == Deco_Classic) setLabel(isOpen() ? _("Listing") : getNewLabel(_("Listing"))); else setLabel(getNewLabel(_("Listing"))); @@ -296,7 +273,7 @@ bool InsetListings::showInsetDialog(BufferView * bv) const docstring InsetListings::getCaption(Buffer const & buf, - OutputParams const & runparams) const + OutputParams const & runparams) const { if (paragraphs().empty()) return docstring();