On Fri, May 05, 2017 at 08:30:51AM +0200, Tommaso Cucinotta wrote:
> commit 0cf394dd79337b14adb2930a617c2027e0d6f2d8
> Author: Tommaso Cucinotta <tomm...@lyx.org>
> Date:   Thu May 4 07:49:07 2017 +0200
> 
>     skip graphics conversion when runparams.dryrun is true

After this commit, if I copy a selection that has an image in it, I get
the following message:

insets/InsetGraphics.cpp (956): InsetGraphics::xhtml: Unable to prepare file 
`/home/scott/lyxbuilds/2017-05-17/repo/lib/images/buffer-write.svgz' for 
output. File missing?

Attached is a patch but I have no idea if it's correct.

Scott
diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp
index 16a482f..2a0a90a 100644
--- a/src/insets/InsetGraphics.cpp
+++ b/src/insets/InsetGraphics.cpp
@@ -952,8 +952,10 @@ docstring InsetGraphics::xhtml(XHTMLStream & xs, 
OutputParams const & op) const
                prepareHTMLFile(op);
 
        if (output_file.empty()) {
-               LYXERR0("InsetGraphics::xhtml: Unable to prepare file `" 
-                       << params().filename << "' for output. File missing?");
+               if (!op.dryrun) {
+                       LYXERR0("InsetGraphics::xhtml: Unable to prepare file 
`" 
+                               << params().filename << "' for output. File 
missing?");
+               }
                string const attr = "src='" + params().filename.absFileName() 
                                    + "' alt='image: " + output_file + "'";
                xs << html::CompTag("img", attr);

Attachment: signature.asc
Description: PGP signature

Reply via email to