]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInclude.cpp
Fix the guiName of external insets.
[lyx.git] / src / insets / InsetInclude.cpp
index c74ec631aa1a5d0197f37f06f65ea1768926c395..fbabcc8b50b5f0770ef05df3f41a719757f82530 100644 (file)
@@ -271,7 +271,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
                                        }                                       
 
                                        if (new_label != old_label) {
-                                               label_->updateCommand(new_label);
+                                               label_->updateLabelAndRefs(new_label, &cur);
                                                // the label might have been adapted (duplicate)
                                                if (new_label != label_->getParam("name")) {
                                                        new_params.addParam("label", "{" + 
@@ -605,10 +605,6 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
                        formats.extension(inc_format)));
 
                // FIXME: handle non existing files
-               // FIXME: Second argument is irrelevant!
-               // since only_body is true, makeLaTeXFile will not look at second
-               // argument. Should we set it to string(), or should makeLaTeXFile
-               // make use of it somehow? (JMarc 20031002)
                // The included file might be written in a different encoding
                // and language.
                Encoding const * const oldEnc = runparams.encoding;
@@ -621,8 +617,7 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
                runparams.master_language = buffer().params().language;
                runparams.par_begin = 0;
                runparams.par_end = tmp->paragraphs().size();
-               if (!tmp->makeLaTeXFile(tmpwritefile, masterFileName(buffer()).
-                               onlyPath().absFileName(), runparams, false)) {
+               if (!tmp->makeLaTeXFile(tmpwritefile, runparams, false)) {
                        docstring msg = bformat(_("Included file `%1$s' "
                                        "was not exported correctly.\nWarning: "
                                        "LaTeX export is probably incomplete."),
@@ -661,7 +656,8 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
                // In this case, it's not a LyX file, so we copy the file
                // to the temp dir, so that .aux files etc. are not created
                // in the original dir. Files included by this file will be
-               // found via input@path, see ../Buffer.cpp.
+               // found via the environment variable TEXINPUTS, which may be
+               // set in preferences and by default includes the original dir.
                unsigned long const checksum_in  = included_file.checksum();
                unsigned long const checksum_out = writefile.checksum();
 
@@ -697,8 +693,8 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
                        os << '\\' << from_ascii(params().getCmdName())
                           << '{' << from_utf8(incfile) << '}';
                } else {
-               incfile = changeExtension(incfile, ".tex");
-               incfile = latex_path(incfile);
+                       incfile = changeExtension(incfile, ".tex");
+                       incfile = latex_path(incfile);
                        // FIXME UNICODE
                        os << '\\' << from_ascii(params().getCmdName())
                           << '{' << from_utf8(incfile) <<  '}';
@@ -1100,7 +1096,7 @@ void InsetInclude::updateCommand()
                return;
 
        docstring old_label = label_->getParam("name");
-       label_->updateCommand(old_label, false);
+       label_->updateLabel(old_label);
        // the label might have been adapted (duplicate)
        docstring new_label = label_->getParam("name");
        if (old_label == new_label)
@@ -1115,6 +1111,7 @@ void InsetInclude::updateCommand()
        setParams(p);   
 }
 
+
 void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype)
 {
        Buffer const * const childbuffer = getChildBuffer();