https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg193248.html
The static InsetLayout could be initialized before its members were, as
JMarc realized here:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg193293.html
docstring const TextClass::plain_layout_ = from_ascii(N_("Plain Layout"));
-InsetLayout DocumentClass::plain_insetlayout_;
-
-
/////////////////////////////////////////////////////////////////////////
//
// TextClass
n = n.substr(0, i);
}
// Layout "name" not found.
+ return plainInsetLayout();
+}
+
+
+InsetLayout const & DocumentClass::plainInsetLayout() {
+ static InsetLayout plain_insetlayout_;
return plain_insetlayout_;
}
/// happen). -- Idea JMarc, comment MV
InsetLayout const & insetLayout(docstring const & name) const;
/// a plain inset layout for use as a default
- static InsetLayout const & plainInsetLayout() { return plain_insetlayout_; }
+ static InsetLayout const & plainInsetLayout();
/// add a new layout \c name if it does not exist in layoutlist_
/// \return whether we had to add one.
bool addLayoutIfNeeded(docstring const & name) const;
friend DocumentClassPtr
getDocumentClass(LayoutFile const &, LayoutModuleList const &,
bool const clone);
- ///
- static InsetLayout plain_insetlayout_;
};