X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetERT.cpp;h=403df75032da7d1c5263c65e785b42be7d68cbd1;hb=a6b07608d8e9de24383d3ebaec20b6b265ed9314;hp=ce9d3834d2b74d3e5c20394ccdfcac7ecad721de;hpb=11ca1406671f3e7b126bbe9b51694e8d32ba161c;p=features.git diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp index ce9d3834d2..403df75032 100644 --- a/src/insets/InsetERT.cpp +++ b/src/insets/InsetERT.cpp @@ -27,10 +27,11 @@ #include "OutputParams.h" #include "ParagraphParameters.h" #include "Paragraph.h" -#include "TextClass.h" +#include "support/docstream.h" #include "support/gettext.h" #include "support/lstrings.h" +#include "support/TempFile.h" #include @@ -40,16 +41,21 @@ using namespace lyx::support; namespace lyx { InsetERT::InsetERT(Buffer * buf, CollapseStatus status) - : InsetCollapsable(buf) + : InsetCollapsible(buf) { status_ = status; } +InsetERT::InsetERT(InsetERT const & old) + : InsetCollapsible(old) +{} + + void InsetERT::write(ostream & os) const { os << "ERT" << "\n"; - InsetCollapsable::write(os); + InsetCollapsible::write(os); } @@ -117,7 +123,7 @@ void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd) } //fall-through default: - InsetCollapsable::doDispatch(cur, cmd); + InsetCollapsible::doDispatch(cur, cmd); break; } @@ -128,6 +134,9 @@ bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const { switch (cmd.action()) { + case LFUN_INSET_INSERT: + status.setEnabled(false); + return true; case LFUN_INSET_MODIFY: if (cmd.getArg(0) == "ert") { status.setEnabled(true); @@ -136,11 +145,12 @@ bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd, //fall through default: - return InsetCollapsable::getStatus(cur, cmd, status); + return InsetCollapsible::getStatus(cur, cmd, status); } } + docstring const InsetERT::buttonLabel(BufferView const & bv) const { if (decoration() == InsetLayout::CLASSIC) @@ -150,7 +160,7 @@ docstring const InsetERT::buttonLabel(BufferView const & bv) const } -InsetCollapsable::CollapseStatus InsetERT::string2params(string const & in) +InsetCollapsible::CollapseStatus InsetERT::string2params(string const & in) { if (in.empty()) return Collapsed; @@ -173,7 +183,7 @@ string InsetERT::params2string(CollapseStatus status) } -docstring InsetERT::xhtml(XHTMLStream &, OutputParams const &) const +docstring InsetERT::xhtml(XMLStream &, OutputParams const &) const { return docstring(); }