]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetexternal.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insetexternal.C
index c04fb78434875c4f2bb08bfeaf7aa8eb5f5edb31..d8f4c83af2c889fa4fa8423d7af0a751eaea5f5e 100644 (file)
 #include "support/lstrings.h"
 #include "support/lyxalgo.h"
 #include "support/path.h"
+#include "support/path_defines.h"
 #include "support/tostr.h"
+#include "support/LAssert.h"
+#include "support/translator.h"
 
 #include <boost/bind.hpp>
 
@@ -50,6 +53,13 @@ using std::ostream;
 using std::endl;
 using std::auto_ptr;
 
+namespace lyx {
+namespace graphics {
+/// The translator between the DisplayType and the corresponding lyx string.
+extern Translator<DisplayType, string> displayTranslator;
+}
+}
+
 namespace {
 
 lyx::graphics::DisplayType const defaultDisplayType = lyx::graphics::NoDisplay;
@@ -299,7 +309,7 @@ void InsetExternal::read(Buffer const * buffer, LyXLex & lex)
                { "template", EX_TEMPLATE }
        };
 
-       lex.pushTable(external_tags, EX_END);
+       pushpophelper pph(lex, external_tags, EX_END);
 
        bool found_end  = false;
        bool read_error = false;
@@ -353,8 +363,6 @@ void InsetExternal::read(Buffer const * buffer, LyXLex & lex)
                               "Missing \\end_inset.");
        }
 
-       lex.popTable();
-
        // Replace the inset's store
        setParams(params, buffer);
 
@@ -550,7 +558,7 @@ string const doSubstitution(InsetExternal::Params const & params,
        result = subst(result, "$$Basename", basename);
        result = subst(result, "$$FPath", filepath);
        result = subst(result, "$$Tempname", params.tempname);
-       result = subst(result, "$$Sysdir", system_lyxdir);
+       result = subst(result, "$$Sysdir", system_lyxdir());
 
        // Handle the $$Contents(filename) syntax
        if (contains(result, "$$Contents(\"")) {