]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFlex.cpp
tex2lyx/text.cpp: fix typos
[lyx.git] / src / insets / InsetFlex.cpp
index 757accaeab8be19051d806f8d382022728194aed..7b2639f69c9253e7c046179a1d6a78efb2860196 100644 (file)
@@ -20,6 +20,7 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "Lexer.h"
+#include "TextClass.h"
 
 #include "support/gettext.h"
 
@@ -42,6 +43,28 @@ InsetFlex::InsetFlex(InsetFlex const & in)
 {}
 
 
+// special code for InsetFlex when there is not the explicit Flex:: prefix
+InsetLayout const & InsetFlex::getLayout() const
+{
+       if (!buffer_)
+               return DocumentClass::plainInsetLayout();
+
+       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_));
+}
+
+
+bool InsetFlex::resetFontEdit() const
+{
+       if (getLayout().resetsFont())
+               return true;
+       return InsetCollapsable::resetFontEdit();
+}
+
+
 InsetLayout::InsetDecoration InsetFlex::decoration() const
 {
        InsetLayout::InsetDecoration const dec = getLayout().decoration();