diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2018-04-22 09:32:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-22 09:32:17 (GMT) |
commit | 14f25cfb6b770f00087fc2c918813286f3eac535 (patch) | |
tree | 1bf8abdebafc28c3015274c02e32a81f3c554646 /addon | |
parent | cf18122bdd08cf02a701afcc6b5cde901a0f10a5 (diff) | |
parent | e15c80cbf1c0f35c2d2ddc950e3d653bc24aac4e (diff) | |
download | Doxygen-14f25cfb6b770f00087fc2c918813286f3eac535.zip Doxygen-14f25cfb6b770f00087fc2c918813286f3eac535.tar.gz Doxygen-14f25cfb6b770f00087fc2c918813286f3eac535.tar.bz2 |
Merge pull request #672 from albert-github/feature/doxywizard_780648
Bug 653502 - Can't use pound sign in alias command, escaped or unescaped
Diffstat (limited to 'addon')
-rw-r--r-- | addon/doxywizard/config_doxyw.l | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/addon/doxywizard/config_doxyw.l b/addon/doxywizard/config_doxyw.l index 7874a19..960b7cb 100644 --- a/addon/doxywizard/config_doxyw.l +++ b/addon/doxywizard/config_doxyw.l @@ -540,22 +540,34 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s) { QChar c; bool needsEscaping=false; + bool needsHashEscaping=false; // convert the string back to it original encoding //QByteArray se = codec->fromUnicode(s); t.setCodec(codec); const QChar *p=s.data(); if (!s.isEmpty() && !p->isNull()) { - while (!(c=*p++).isNull() && !needsEscaping) + if (*p != QChar::fromLatin1('"')) { - needsEscaping = (c==QChar::fromLatin1(' ') || - c==QChar::fromLatin1('\n') || - c==QChar::fromLatin1('\t') || - c==QChar::fromLatin1('"')); + while (!(c=*p++).isNull() && !needsEscaping) + { + needsEscaping = (c==QChar::fromLatin1(' ') || + c==QChar::fromLatin1('\n') || + c==QChar::fromLatin1('\t') || + c==QChar::fromLatin1('"')); + } + p=s.data(); + while (!(c=*p++).isNull() && !needsHashEscaping) + { + needsHashEscaping = (c==QChar::fromLatin1('#')); + } } - if (needsEscaping) + if (needsHashEscaping || needsEscaping) { t << "\""; + } + if (needsEscaping) + { p=s.data(); while (!p->isNull()) { @@ -564,12 +576,15 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s) if (*p ==QChar::fromLatin1('"')) t << "\\"; // escape quotes t << *p++; } - t << "\""; } else { t << s; } + if (needsHashEscaping || needsEscaping) + { + t << "\""; + } } } |