X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFlex.cpp;h=6d64c3f8ead6a4f839e1a93f26e2a67b9e0d2b70;hb=a3c84666b2dbfc75c9a80cf4f94612149cb2b570;hp=2e9e97096fd51a6dca41717ac97af1b671c21f76;hpb=4c7a5d00245799695ea81aa0192151eed8f9c5fb;p=lyx.git diff --git a/src/insets/InsetFlex.cpp b/src/insets/InsetFlex.cpp index 2e9e97096f..6d64c3f8ea 100644 --- a/src/insets/InsetFlex.cpp +++ b/src/insets/InsetFlex.cpp @@ -20,6 +20,7 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "Lexer.h" +#include "TextClass.h" #include "support/gettext.h" @@ -42,6 +43,16 @@ InsetFlex::InsetFlex(InsetFlex const & in) {} +InsetLayout const & InsetFlex::getLayout() const +{ + DocumentClass const & dc = buffer().params().documentClass(); + docstring const dname = from_utf8(name_); + if (dc.hasInsetLayout(dname)) + return dc.insetLayout(dname); + return dc.insetLayout(from_utf8("Flex:" + name_)); +} + + InsetLayout::InsetDecoration InsetFlex::decoration() const { InsetLayout::InsetDecoration const dec = getLayout().decoration(); @@ -60,7 +71,7 @@ void InsetFlex::write(ostream & os) const bool InsetFlex::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { - switch (cmd.action_) { + switch (cmd.action()) { case LFUN_INSET_DISSOLVE: if (!cmd.argument().empty()) { InsetLayout const & il = getLayout(); @@ -81,7 +92,7 @@ bool InsetFlex::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetFlex::doDispatch(Cursor & cur, FuncRequest & cmd) { - switch (cmd.action_) { + switch (cmd.action()) { case LFUN_INSET_DISSOLVE: if (!cmd.argument().empty()) { InsetLayout const & il = getLayout();