From 2a63b2d1cb4bcbd5ec3f3ab7a71f8005f23427ed Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Tue, 12 Oct 2010 15:37:02 +0000 Subject: [PATCH] Customize getLayout for InsetFlex and change how we report name() back to the simple version. We need to do it this way because we should NOT really require the "Flex" prefix and, in fact, should permit other prefixes to be used. Next commit for that. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35613 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetFlex.cpp | 10 +++++++--- src/insets/InsetFlex.h | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/insets/InsetFlex.cpp b/src/insets/InsetFlex.cpp index 2fd3a21037..9355d42b79 100644 --- a/src/insets/InsetFlex.cpp +++ b/src/insets/InsetFlex.cpp @@ -42,9 +42,13 @@ InsetFlex::InsetFlex(InsetFlex const & in) {} -docstring InsetFlex::name() const -{ - return from_utf8("Flex:" + name_); +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_)); } diff --git a/src/insets/InsetFlex.h b/src/insets/InsetFlex.h index 5799b65f77..922f7c566d 100644 --- a/src/insets/InsetFlex.h +++ b/src/insets/InsetFlex.h @@ -25,7 +25,9 @@ public: /// InsetFlex(Buffer *, std::string const & layoutName); /// - docstring name() const; + docstring name() const { return from_utf8(name_); } + /// + InsetLayout const & getLayout() const; /// InsetCode lyxCode() const { return FLEX_CODE; } /// Default looks -- 2.39.2