]> git.lyx.org Git - lyx.git/blobdiff - src/Text2.cpp
Fix bug http://bugzilla.lyx.org/show_bug.cgi?id=4599
[lyx.git] / src / Text2.cpp
index 39300ba3f71160275004e73252326683b25c3c67..fa0ed179b30bbe775ac20737593e8fcdd8182078 100644 (file)
@@ -199,7 +199,7 @@ void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end,
        BOOST_ASSERT(start != end);
 
        BufferParams const & bufparams = buffer.params();
-       LayoutPtr const & lyxlayout = bufparams.textClass()[layout];
+       LayoutPtr const & lyxlayout = bufparams.documentClass()[layout];
 
        for (pit_type pit = start; pit != end; ++pit) {
                Paragraph & par = pars_[pit];
@@ -218,7 +218,7 @@ void Text::setLayout(Cursor & cur, docstring const & layout)
        // special handling of new environment insets
        BufferView & bv = cur.bv();
        BufferParams const & params = bv.buffer().params();
-       LayoutPtr const & lyxlayout = params.textClass()[layout];
+       LayoutPtr const & lyxlayout = params.documentClass()[layout];
        if (lyxlayout->is_environment) {
                // move everything in a new environment inset
                LYXERR(Debug::DEBUG, "setting layout " << to_utf8(layout));