Skip to content

Commit 83118ee

Browse files
authored
Merge pull request doxygen#11312 from albert-github/featurte/issue_11310_doxywizard
String representation at "show configuration" in doxywizard
2 parents 645f444 + d3d0a1d commit 83118ee

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

addon/doxywizard/config_doxyw.l

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
%{
2020

2121
/*
22-
* includes
22+
* includes
2323
*/
2424
#include "config.h"
2525
#include "input.h"
@@ -46,7 +46,7 @@
4646

4747
/* -----------------------------------------------------------------
4848
*
49-
* static variables
49+
* static variables
5050
*/
5151

5252
struct ConfigFileState
@@ -77,8 +77,8 @@ static const char *stateToString(int state);
7777

7878
/* -----------------------------------------------------------------
7979
*/
80-
#undef YY_INPUT
81-
#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
80+
#undef YY_INPUT
81+
#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
8282

8383
static int yyread(char *buf,int maxSize)
8484
{
@@ -334,7 +334,7 @@ static void readIncludeFile(const QString &incName)
334334
if (g_includeDepth==MAX_INCLUDE_DEPTH)
335335
{
336336
config_err("maximum include depth (%d) reached, %s is not included.",
337-
MAX_INCLUDE_DEPTH,qPrintable(incName));
337+
MAX_INCLUDE_DEPTH,qPrintable(incName));
338338
}
339339

340340
QString inc = incName;
@@ -722,7 +722,7 @@ static void upgradeConfig(const QHash<QString,Input*> &options)
722722
bool classGraph = InputBool::convertToBool(v3,isValid3);
723723
if (isValid1 && isValid2 && isValid3 && !classDiagrams && !haveDot && classGraph)
724724
{
725-
config_warn("Changing CLASS_GRAPH option to TEXT because obsolete option CLASS_DIAGRAM was found and set to NO.\n");
725+
config_warn("Changing CLASS_GRAPH option to TEXT because obsolete option CLASS_DIAGRAM was found and set to NO.\n");
726726
optClassGraph->setValue(QString::fromLatin1("TEXT"));
727727
}
728728
}
@@ -800,10 +800,10 @@ void writeStringValue(QTextStream &t,TextCodecAdapter *codec,const QString &s)
800800
while (!(c=*p++).isNull() && !needsEscaping)
801801
{
802802
needsEscaping = (c==QChar::fromLatin1(' ') ||
803-
c==QChar::fromLatin1(',') ||
804-
c==QChar::fromLatin1('\n') ||
805-
c==QChar::fromLatin1('\t') ||
806-
c==QChar::fromLatin1('"'));
803+
c==QChar::fromLatin1(',') ||
804+
c==QChar::fromLatin1('\n') ||
805+
c==QChar::fromLatin1('\t') ||
806+
c==QChar::fromLatin1('"'));
807807
}
808808
p=s.data();
809809
while (!(c=*p++).isNull() && !needsHashEscaping)
@@ -820,15 +820,27 @@ void writeStringValue(QTextStream &t,TextCodecAdapter *codec,const QString &s)
820820
p=s.data();
821821
while (!p->isNull())
822822
{
823-
if (*p ==QChar::fromLatin1(' ') &&
824-
*(p+1)==QChar::fromLatin1('\0')) break; // skip inserted space at the end
825-
if (*p ==QChar::fromLatin1('"')) t << "\\"; // escape quotes
826-
t << *p++;
823+
if (*p ==QChar::fromLatin1(' ') &&
824+
*(p+1)==QChar::fromLatin1('\0')) break; // skip inserted space at the end
825+
if (*p ==QChar::fromLatin1('"')) t << "\\"; // escape quotes
826+
if (*p ==QChar::fromLatin1('<')) t << "&lt;";
827+
else if (*p ==QChar::fromLatin1('>')) t << "&gt;";
828+
else if (*p ==QChar::fromLatin1('&')) t << "&amp;";
829+
else t << *p;
830+
p++;
827831
}
828832
}
829833
else
830834
{
831-
t << s;
835+
p=s.data();
836+
while (!p->isNull())
837+
{
838+
if (*p ==QChar::fromLatin1('<')) t << "&lt;";
839+
else if (*p ==QChar::fromLatin1('>')) t << "&gt;";
840+
else if (*p ==QChar::fromLatin1('&')) t << "&amp;";
841+
else t << *p;
842+
p++;
843+
}
832844
}
833845
if (needsHashEscaping || needsEscaping)
834846
{

0 commit comments

Comments
 (0)