]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFlex.cpp
Fix wrongly copy-pasted entries in SpellcheckerUi.ui
[lyx.git] / src / insets / InsetFlex.cpp
index 9355d42b796fa13b280921f494a47d2ff8ff96b9..44651cc026816ac99ac1807d68e88c9fdd76d810 100644 (file)
@@ -20,6 +20,7 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "Lexer.h"
+#include "TextClass.h"
 
 #include "support/gettext.h"
 
@@ -44,6 +45,9 @@ InsetFlex::InsetFlex(InsetFlex const & in)
 
 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))
@@ -52,6 +56,14 @@ InsetLayout const & InsetFlex::getLayout() const
 }
 
 
+bool InsetFlex::resetFontEdit() const
+{
+       if (getLayout().resetsFont())
+               return true;
+       return InsetCollapsable::resetFontEdit();
+}
+
+
 InsetLayout::InsetDecoration InsetFlex::decoration() const
 {
        InsetLayout::InsetDecoration const dec = getLayout().decoration();