commit 7b896e0db8ce23b743d58b6ae9dd643b96afaa75
Author: Richard Heck <[email protected]>
Date:   Sun Mar 27 16:54:46 2016 -0400

    Fix problem reported by Kornel in this thread:
                
https://www.mail-archive.com/[email protected]/msg193248.html
    The static InsetLayout could be initialized before its members were, as
    JMarc realized here:
                
https://www.mail-archive.com/[email protected]/msg193293.html
    
    (cherry picked from commit 23f6c1c9621a012c1f91c5e26d1e8d80d717841f)
    
    Conflicts:
        src/TextClass.cpp

diff --git a/src/TextClass.cpp b/src/TextClass.cpp
index 31f27d9..6a40fc2 100644
--- a/src/TextClass.cpp
+++ b/src/TextClass.cpp
@@ -129,9 +129,6 @@ string translateReadType(TextClass::ReadType rt)
 docstring const TextClass::plain_layout_ = from_ascii("Plain Layout");
 
 
-InsetLayout DocumentClass::plain_insetlayout_;
-
-
 /////////////////////////////////////////////////////////////////////////
 //
 // TextClass
@@ -1428,6 +1425,13 @@ InsetLayout const & DocumentClass::insetLayout(docstring 
const & name) const
                        break;
                n = n.substr(0, i);
        }
+       // Layout "name" not found.
+       return plainInsetLayout();
+}
+
+
+InsetLayout const & DocumentClass::plainInsetLayout() {
+       static InsetLayout plain_insetlayout_;
        return plain_insetlayout_;
 }
 
diff --git a/src/TextClass.h b/src/TextClass.h
index fff3c23..8b3c817 100644
--- a/src/TextClass.h
+++ b/src/TextClass.h
@@ -396,7 +396,7 @@ public:
        /// 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;
@@ -493,8 +493,6 @@ private:
        friend DocumentClassPtr
                getDocumentClass(LayoutFile const &, LayoutModuleList const &,
                                 bool const clone);
-       ///
-       static InsetLayout plain_insetlayout_;
 };
 
 
diff --git a/status.21x b/status.21x
index 64a88f4..5a7b0d8 100644
--- a/status.21x
+++ b/status.21x
@@ -152,6 +152,8 @@ What's new
 
 - Fix a crash when introducing a new shortcut (bug 9869).
 
+- Fix initialization oblem with default Inset Layout.
+
 
 * INTERNALS
 

Reply via email to