From c40e1ea9039c3161ae201b10489a62feb2d77880 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 31 Dec 2018 15:40:20 +0100 Subject: issue #6708 Invalid UTF-8 characters in hover title The replace function has as side effect that it affect UTF-8 characters as well. Removing `id="node[0-9]*"` no by searching its start and end. --- src/dot.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/dot.cpp b/src/dot.cpp index 0944a02..3853487 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -377,7 +377,6 @@ static bool convertMapFile(FTextStream &t,const char *mapName, const QCString &context=QCString()) { QFile f(mapName); - static QRegExp re("id=\"node[0-9]*\""); if (!f.open(IO_ReadOnly)) { err("problems opening map file %s for inclusion in the docs!\n" @@ -396,7 +395,17 @@ static bool convertMapFile(FTextStream &t,const char *mapName, if (buf.left(5)=="=0 && (indexE=buf.find('"',indexS))!=-1) + { + t << replBuf.left(indexS-1) << replBuf.right(replBuf.length() - indexE - 1); + } + else + { + t << replBuf; + } } } } -- cgit v0.12 From 3fc42fad071d1fb05daf9270e1815c79d7407257 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 31 Dec 2018 16:49:34 +0100 Subject: issue #6708 Invalid UTF-8 characters in hover title Corrected test and setting of indexE (was working by accident). --- src/dot.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dot.cpp b/src/dot.cpp index 3853487..eb6c03c 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -397,8 +397,7 @@ static bool convertMapFile(FTextStream &t,const char *mapName, { QCString replBuf = replaceRef(buf,relPath,urlOnly,context); int indexS = replBuf.find("id=\""), indexE; - indexE=replBuf.find('"',indexS+4); - if (indexS>=0 && (indexE=buf.find('"',indexS))!=-1) + if (indexS>=0 && (indexE=replBuf.find('"',indexS+4))!=-1) { t << replBuf.left(indexS-1) << replBuf.right(replBuf.length() - indexE - 1); } -- cgit v0.12 From 979b00385f963a7433ee7ad87dba1102d8f63f3a Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 31 Dec 2018 20:25:57 +0100 Subject: Fixed range and added code comment --- src/dot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dot.cpp b/src/dot.cpp index eb6c03c..07a1a43 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -396,8 +396,9 @@ static bool convertMapFile(FTextStream &t,const char *mapName, if (buf.left(5)=="=0 && (indexE=replBuf.find('"',indexS+4))!=-1) + if (indexS>0 && (indexE=replBuf.find('"',indexS+4))!=-1) { t << replBuf.left(indexS-1) << replBuf.right(replBuf.length() - indexE - 1); } -- cgit v0.12