]> git.lyx.org Git - features.git/blobdiff - src/Text3.cpp
Make sure that language is "latex" in InsetArgument when pass-thru.
[features.git] / src / Text3.cpp
index b1bf879a55a02755b840d76cd03eb3e1c898fc97..c8483fe380e0f49a04a9a39f3b64867a13b1e534 100644 (file)
@@ -252,7 +252,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
        cur.recordUndo();
        if (cmd.action() == LFUN_ARGUMENT_INSERT) {
                bool cotextinsert = false;
-               InsetArgument const * const ia = static_cast<InsetArgument const *>(inset);
+               InsetArgument * const ia = static_cast<InsetArgument *>(inset);
                Layout const & lay = cur.paragraph().layout();
                Layout::LaTeXArgMap args = lay.args();
                Layout::LaTeXArgMap::const_iterator const lait = args.find(ia->name());
@@ -275,6 +275,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
                        else
                                ds = cur.paragraph().asString();
                        text->insertInset(cur, inset);
+                       ia->init(cur.paragraph());
                        if (edit)
                                inset->edit(cur, true);
                        // Now put co-text into inset
@@ -321,6 +322,11 @@ static bool doInsertInset(Cursor & cur, Text * text,
                inset_text->setOuterFont(cur.bv(), font.fontInfo());
        }
 
+       if (cmd.action() == LFUN_ARGUMENT_INSERT) {
+               InsetArgument * const ia = static_cast<InsetArgument *>(inset);
+               ia->init(cur.paragraph());
+       }
+
        if (edit)
                inset->edit(cur, true);