diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2017-12-24 09:38:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-24 09:38:23 (GMT) |
commit | 2025c3b1521222ab6df2beb10dc962ba89930aca (patch) | |
tree | b35a28a9b9725bc24230d3d8a987e3a6d9627f23 | |
parent | 9309327a1856987f0ada23f322aa548bc981e322 (diff) | |
parent | 507dd0a60dd12c61ff2088db419187efc928c010 (diff) | |
download | Doxygen-2025c3b1521222ab6df2beb10dc962ba89930aca.zip Doxygen-2025c3b1521222ab6df2beb10dc962ba89930aca.tar.gz Doxygen-2025c3b1521222ab6df2beb10dc962ba89930aca.tar.bz2 |
Merge pull request #629 from mosra/xml-copy-images
Properly copy images for the XML output
-rw-r--r-- | src/xmldocvisitor.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 55c2b38..93765b1 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -770,17 +770,22 @@ void XmlDocVisitor::visitPre(DocImage *img) visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height()); // copy the image to the output dir - QFile inImage(img->name()); - QFile outImage(Config_getString(XML_OUTPUT)+"/"+baseName.data()); - if (inImage.open(IO_ReadOnly)) + FileDef *fd; + bool ambig; + if ((fd=findFileDef(Doxygen::imageNameDict,img->name(),ambig))) { - if (outImage.open(IO_WriteOnly)) + QFile inImage(fd->absFilePath()); + QFile outImage(Config_getString(XML_OUTPUT)+"/"+baseName.data()); + if (inImage.open(IO_ReadOnly)) { - char *buffer = new char[inImage.size()]; - inImage.readBlock(buffer,inImage.size()); - outImage.writeBlock(buffer,inImage.size()); - outImage.flush(); - delete[] buffer; + if (outImage.open(IO_WriteOnly)) + { + char *buffer = new char[inImage.size()]; + inImage.readBlock(buffer,inImage.size()); + outImage.writeBlock(buffer,inImage.size()); + outImage.flush(); + delete[] buffer; + } } } } |