]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetexternal.C
prepare for 1.1.6pre2
[lyx.git] / src / insets / insetexternal.C
index 7af977b034df247b43333beeb818605a5c0d8b75..77435740d298fe1637a8a0e3c6032ac762c04f3f 100644 (file)
@@ -36,7 +36,7 @@ using std::endl;
 InsetExternal::InsetExternal() 
        : form_external(0)
 {
-       tempname = TmpFileName();
+       tempname = lyx::tempName(); //TmpFileName();
 }
 
 
@@ -137,7 +137,6 @@ void InsetExternal::browseCB(FL_OBJECT * ob, long)
 
        bool error = false;
        do {
-               //      ProhibitInput(current_view);
                if (once) {
                        p = fileDlg.Select(_("External inset file"),
                                           current_path,
@@ -146,7 +145,6 @@ void InsetExternal::browseCB(FL_OBJECT * ob, long)
                        p = fileDlg.Select(_("External inset file"), buf,
                                           regexp, string());
                }
-               //      AllowInput(current_view);
 
                if (p.empty()) return;
 
@@ -293,8 +291,8 @@ void InsetExternal::Edit(BufferView * bv,
                fl_raise_form(form_external->form_external);
        } else {
                fl_show_form(form_external->form_external,
-                            FL_PLACE_MOUSE | FL_FREE_SIZE,
-                            FL_FULLBORDER, _("Insert external inset"));
+                            FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
+                            _("Insert external inset"));
                if (ow < 0) {
                        ow = form_external->form_external->w;
                        oh = form_external->form_external->h;
@@ -314,10 +312,10 @@ void InsetExternal::Write(Buffer const *, std::ostream & os) const
 void InsetExternal::Read(Buffer const *, LyXLex & lex)
 {
        lex.EatLine();
-       string format = lex.GetString();
-       int pos1 = format.find(",");
+       string const format = lex.GetString();
+       string::size_type const pos1 = format.find(",");
        templatename = format.substr(0, pos1);
-       int pos2 = format.find("\",\"", pos1);
+       string::size_type const pos2 = format.find("\",\"", pos1);
        filename = format.substr(pos1 + 2, pos2 - (pos1 + 2));
        parameters = format.substr(pos2 + 3, format.length() - (pos2 + 4));
 
@@ -356,7 +354,7 @@ int InsetExternal::Latex(Buffer const * buf,
 }
 
 
-int InsetExternal::Ascii(Buffer const * buf, std::ostream & os) const
+int InsetExternal::Ascii(Buffer const * buf, std::ostream & os, int) const
 {
        return write("Ascii", buf, os);
 }
@@ -392,7 +390,7 @@ void InsetExternal::Validate(LaTeXFeatures & features) const
 }
 
 
-Inset * InsetExternal::Clone() const
+Inset * InsetExternal::Clone(Buffer const &) const
 {
        InsetExternal * inset = new InsetExternal();
        inset->templatename = templatename;
@@ -473,7 +471,7 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
                                     string const & s) const
 {
        string result;
-       string basename = ChangeExtension(filename, string());
+       string const basename = ChangeExtension(filename, string());
        result = subst(s, "$$FName", filename);
        result = subst(result, "$$Basename", basename);
        result = subst(result, "$$Parameters", parameters);
@@ -484,8 +482,8 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
        // Handle the $$Contents(filename) syntax
        if (contains(result, "$$Contents(\"")) {
 
-               int const pos = result.find("$$Contents(\"");
-               int const end = result.find("\")", pos);
+               string::size_type const pos = result.find("$$Contents(\"");
+               string::size_type const end = result.find("\")", pos);
                string const file = result.substr(pos + 12, end - (pos + 12));
                string contents;
                if (buffer) {