diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-04-19 12:21:18 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-04-19 12:21:18 (GMT) |
commit | cd581388f3d013c501e3cefbaf3e81cf93d46fcb (patch) | |
tree | bc466f578c4390b054464d777d2bfeaeea65f1fc /src/dotfilepatcher.cpp | |
parent | 28fc7d1fce3cc8e7fa26e3760e8d8d79b9dd23a5 (diff) | |
download | Doxygen-cd581388f3d013c501e3cefbaf3e81cf93d46fcb.zip Doxygen-cd581388f3d013c501e3cefbaf3e81cf93d46fcb.tar.gz Doxygen-cd581388f3d013c501e3cefbaf3e81cf93d46fcb.tar.bz2 |
issue #7706: Md5 hash does not match for two different runs (part 2)
Diffstat (limited to 'src/dotfilepatcher.cpp')
-rw-r--r-- | src/dotfilepatcher.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp index e386af9..20ce4c1 100644 --- a/src/dotfilepatcher.cpp +++ b/src/dotfilepatcher.cpp @@ -132,7 +132,7 @@ static QCString replaceRef(const QCString &buf,const QCString relPath, //bool isXLink=FALSE; int len = 6; int indexS = buf.find("href=\""), indexE; - bool setTarget = FALSE; + bool targetAlreadySet = buf.find("target=")!=-1; if (indexS>5 && buf.find("xlink:href=\"")!=-1) // XLink href (for SVG) { indexS-=6; @@ -152,9 +152,9 @@ static QCString replaceRef(const QCString &buf,const QCString relPath, // fake ref node to resolve the url DocRef *df = new DocRef( (DocNode*) 0, link.mid(5), context ); result+=externalRef(relPath,df->ref(),TRUE); - if (!df->file().isEmpty()) + if (!df->file().isEmpty()) result += df->file().data() + Doxygen::htmlFileExtension; - if (!df->anchor().isEmpty()) + if (!df->anchor().isEmpty()) result += "#" + df->anchor(); delete df; result += "\""; @@ -174,7 +174,6 @@ static QCString replaceRef(const QCString &buf,const QCString relPath, if (!ref.isEmpty()) { result = externalLinkTarget(true); - if (result != "") setTarget = TRUE; } result+= href+"=\""; result+=externalRef(relPath,ref,TRUE); @@ -185,12 +184,14 @@ static QCString replaceRef(const QCString &buf,const QCString relPath, result = href+"=\"" + link + "\""; } } - if (!target.isEmpty() && !setTarget) + if (!target.isEmpty() && !targetAlreadySet) { result+=" target=\""+target+"\""; } QCString leftPart = buf.left(indexS); QCString rightPart = buf.mid(indexE+1); + //printf("replaceRef(\n'%s'\n)->\n'%s+%s+%s'\n", + // buf.data(),leftPart.data(),result.data(),rightPart.data()); return leftPart + result + rightPart; } else @@ -215,7 +216,7 @@ bool DotFilePatcher::convertMapFile(FTextStream &t,const char *mapName, const QCString &context) { QFile f(mapName); - if (!f.open(IO_ReadOnly)) + if (!f.open(IO_ReadOnly)) { err("problems opening map file %s for inclusion in the docs!\n" "If you installed Graphviz/dot after a previous failing run, \n" @@ -250,7 +251,7 @@ bool DotFilePatcher::convertMapFile(FTextStream &t,const char *mapName, return TRUE; } -DotFilePatcher::DotFilePatcher(const char *patchFile) +DotFilePatcher::DotFilePatcher(const char *patchFile) : m_patchFile(patchFile) { m_maps.setAutoDelete(TRUE); @@ -346,7 +347,7 @@ bool DotFilePatcher::run() const } QFile fi(tmpName); QFile fo(patchFile); - if (!fi.open(IO_ReadOnly)) + if (!fi.open(IO_ReadOnly)) { err("problem opening file %s for patching!\n",tmpName.data()); QDir::current().rename(tmpName,patchFile); @@ -380,7 +381,7 @@ bool DotFilePatcher::run() const ASSERT(numBytes<maxLineLen); if (isSVGFile) { - if (interactiveSVG_local) + if (interactiveSVG_local) { if (line.find("<svg")!=-1 && !replacedHeader) { @@ -412,7 +413,7 @@ bool DotFilePatcher::run() const replacedHeader=TRUE; } } - if (!insideHeader || !foundSize) // copy SVG and replace refs, + if (!insideHeader || !foundSize) // copy SVG and replace refs, // unless we are inside the header of the SVG. // Then we replace it with another header. { @@ -508,7 +509,7 @@ bool DotFilePatcher::run() const // dummy link by real ones fi.setName(tmpName); fo.setName(orgName); - if (!fi.open(IO_ReadOnly)) + if (!fi.open(IO_ReadOnly)) { err("problem opening file %s for reading!\n",tmpName.data()); return FALSE; @@ -602,18 +603,18 @@ bool DotFilePatcher::writeSVGFigureLink(FTextStream &out,const QCString &relPath if (height<=60) height=300; else height+=300; // add some extra space for zooming if (height>600) height=600; // clip to maximum height of 600 pixels out << "<div class=\"zoom\">"; - //out << "<object type=\"image/svg+xml\" data=\"" - //out << "<embed type=\"image/svg+xml\" src=\"" - out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" + //out << "<object type=\"image/svg+xml\" data=\"" + //out << "<embed type=\"image/svg+xml\" src=\"" + out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" << relPath << baseName << ".svg\" width=\"100%\" height=\"" << height << "\">"; } else { - //out << "<object type=\"image/svg+xml\" data=\"" - //out << "<embed type=\"image/svg+xml\" src=\"" - out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" - << relPath << baseName << ".svg\" width=\"" - << ((width*96+48)/72) << "\" height=\"" + //out << "<object type=\"image/svg+xml\" data=\"" + //out << "<embed type=\"image/svg+xml\" src=\"" + out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" + << relPath << baseName << ".svg\" width=\"" + << ((width*96+48)/72) << "\" height=\"" << ((height*96+48)/72) << "\">"; } writeSVGNotSupported(out); @@ -650,7 +651,7 @@ bool DotFilePatcher::writeVecGfxFigure(FTextStream &out,const QCString &baseName } //printf("Got PDF/EPS size %d,%d\n",width,height); int maxWidth = 350; /* approx. page width in points, excl. margins */ - int maxHeight = 550; /* approx. page height in points, excl. margins */ + int maxHeight = 550; /* approx. page height in points, excl. margins */ out << "\\nopagebreak\n" "\\begin{figure}[H]\n" "\\begin{center}\n" |