]> git.lyx.org Git - features.git/commitdiff
A couple comments and some very minor cleanup.
authorRichard Heck <rgheck@comcast.net>
Sun, 25 Oct 2009 02:22:36 +0000 (02:22 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 25 Oct 2009 02:22:36 +0000 (02:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31720 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetGraphics.cpp

index fb615bf8ee9114678ac0ec1e820e52f78499ac6c..85bf2e31bbcb22049456d67ac005d5ba5f34bb1a 100644 (file)
@@ -555,10 +555,6 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
        if (runparams.dryrun)
                return stripExtensionIfPossible(rel_file, runparams.nice);
 
-       // temp_file will contain the file for LaTeX to act on if, for example,
-       // we move it to a temp dir or uncompress it.
-       FileName temp_file = params().filename;
-
        // The master buffer. This is useful when there are multiple levels
        // of include files
        Buffer const * masterBuffer = buffer().masterBuffer();
@@ -575,6 +571,9 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
        // This is necessary for DVI export.
        string const temp_path = masterBuffer->temppath();
 
+       // temp_file will contain the file for LaTeX to act on if, for example,
+       // we move it to a temp dir or uncompress it.
+       FileName temp_file;
        GraphicsCopyStatus status;
        boost::tie(status, temp_file) =
                        copyToDirIfNeeded(params().filename, temp_path);
@@ -669,6 +668,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
        LYXERR(Debug::GRAPHICS, "\tthe orig file is: " << orig_file);
 
        if (from == to) {
+               // source and destination formats are the same
                if (!runparams.nice && !FileName(temp_file).hasExtension(ext)) {
                        // The LaTeX compiler will not be able to determine
                        // the file format from the extension, so we must
@@ -693,6 +693,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
                return stripExtensionIfPossible(output_file, to, runparams.nice);
        }
 
+       // so the source and destination formats are different
        FileName const to_file = FileName(changeExtension(temp_file.absFilename(), ext));
        string const output_to_file = changeExtension(output_file, ext);