]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetGraphics.cpp
Pure HTML output for math macros.
[lyx.git] / src / insets / InsetGraphics.cpp
index 0fa18359078cd8dfd75c8836b800222b48c8de14..ec085707b4e15de8179e4ac3e24f047c9150f3a0 100644 (file)
@@ -66,6 +66,7 @@ TODO
 #include "MetricsInfo.h"
 #include "Mover.h"
 #include "OutputParams.h"
+#include "output_xhtml.h"
 #include "sgml.h"
 #include "TocBackend.h"
 
@@ -222,6 +223,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
 
        case LFUN_GRAPHICS_RELOAD:
+               params_.filename.refresh();
                graphic_->reload();
                break;
 
@@ -941,20 +943,25 @@ string InsetGraphics::prepareHTMLFile(OutputParams const & runparams) const
 }
 
 
-docstring InsetGraphics::xhtml(odocstream & os, OutputParams const & op) const
+docstring InsetGraphics::xhtml(XHTMLStream & xs, OutputParams const & op) const
 {
-       string output_file = prepareHTMLFile(op);
+       string const output_file = prepareHTMLFile(op);
        if (output_file.empty()) {
-               LYXERR0("InsetGraphics::xhtml: File `" << params().filename 
-                                               << "' not found.");
-               os << "<img src=\"" << params().filename.absFilename() << "\" />";
+               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);
                return docstring();
        }
 
-       // FIXME Do we want to do something with the parameters, other than
-       // use them to do another conversion?
-       // FIXME Do the other conversion! Cropping, rotating, etc.
-       os << "<img src=\"" << from_utf8(output_file) << "\" />";
+       // FIXME XHTML 
+       // Do we want to do something with the parameters, other than use them to 
+       // crop, etc, the image?
+       // Speaking of which: Do the cropping, rotating, etc.
+       string const attr = "src='" + output_file + "' alt='image: " 
+                           + output_file + "'";
+       xs << html::CompTag("img", attr);
        return docstring();
 }