From 1532b5ae1b607857b85d6f94944e570dd597a08b Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 1 May 2019 19:53:08 +0200 Subject: issue #6950 XML - for array of structure only contains references in first array element Don't stop at a hexadecimal number, but output the hexadecimal number (plus the part that has not been printed yet) and continue with the next input part. --- src/util.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 2719c73..bbd5773 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2031,10 +2031,16 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope, int floatingIndex=0; if (strLen==0) return; // read a word from the text string - while ((newIndex=regExp.match(txtStr,index,&matchLen))!=-1 && - (newIndex==0 || !(txtStr.at(newIndex-1)>='0' && txtStr.at(newIndex-1)<='9')) // avoid matching part of hex numbers - ) + newIndex=regExp.match(txtStr,index,&matchLen); + while ((newIndex=regExp.match(txtStr,index,&matchLen))!=-1) { + if (!(newIndex == 0 || !(txtStr.at(newIndex-1)>='0' && txtStr.at(newIndex-1)<='9'))) // avoid matching part of hex numbers + { + out.writeString(txtStr.mid(skipIndex,newIndex+matchLen-skipIndex),keepSpaces); + floatingIndex+=newIndex-skipIndex+matchLen; + skipIndex=index=newIndex+matchLen; + continue; + } // add non-word part to the result floatingIndex+=newIndex-skipIndex+matchLen; bool insideString=FALSE; -- cgit v0.12 From b8ed98e5b9e84f70bbe485094320201caf1f1ecb Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 29 Jul 2019 14:00:52 +0200 Subject: Some code simplifications --- src/util.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 9cf7b82..013b0e4 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2032,18 +2032,17 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope, int floatingIndex=0; if (strLen==0) return; // read a word from the text string - newIndex=regExp.match(txtStr,index,&matchLen); while ((newIndex=regExp.match(txtStr,index,&matchLen))!=-1) { - if (!(newIndex == 0 || !(txtStr.at(newIndex-1)>='0' && txtStr.at(newIndex-1)<='9'))) // avoid matching part of hex numbers + floatingIndex+=newIndex-skipIndex+matchLen; + if (newIndex>0 && txtStr.at(newIndex-1)=='0') // ignore hex numbers (match x00 in 0x00) { out.writeString(txtStr.mid(skipIndex,newIndex+matchLen-skipIndex),keepSpaces); - floatingIndex+=newIndex-skipIndex+matchLen; skipIndex=index=newIndex+matchLen; continue; } + // add non-word part to the result - floatingIndex+=newIndex-skipIndex+matchLen; bool insideString=FALSE; int i; for (i=index;i