summaryrefslogtreecommitdiffstats
path: root/src/xmldocvisitor.cpp
diff options
context:
space:
mode:
authorVladimír Vondruš <mosra@centrum.cz>2017-12-07 00:41:11 (GMT)
committerVladimír Vondruš <mosra@centrum.cz>2017-12-07 00:43:00 (GMT)
commit507dd0a60dd12c61ff2088db419187efc928c010 (patch)
tree7f9411521dc07feabe81256f635c6dddbbbe4f02 /src/xmldocvisitor.cpp
parent4f45bd20d4da7d40c793ec4c4c13558581e995ac (diff)
downloadDoxygen-507dd0a60dd12c61ff2088db419187efc928c010.zip
Doxygen-507dd0a60dd12c61ff2088db419187efc928c010.tar.gz
Doxygen-507dd0a60dd12c61ff2088db419187efc928c010.tar.bz2
Properly copy images for the XML output.
Use the exact same mechanism that is used for the HTML/LaTeX/... output, which is findAndCopyImage() in docparser.cpp, because that one works, unlike the method here. Not sure why that function doesn't handle XML as well. Also not sure how to integrate this into the automated tests.
Diffstat (limited to 'src/xmldocvisitor.cpp')
-rw-r--r--src/xmldocvisitor.cpp23
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;
+ }
}
}
}