diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-05-25 22:25:01 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-05-26 18:42:23 (GMT) |
commit | 1941e88efd5d0f1f049b50eb258dff2a19e739d9 (patch) | |
tree | 9aa73264d2b7ace20267f8171299a3cde9c64074 /src/commentscan.l | |
parent | ae845dea83a92093c18081db96014eb604f76d79 (diff) | |
download | Doxygen-1941e88efd5d0f1f049b50eb258dff2a19e739d9.zip Doxygen-1941e88efd5d0f1f049b50eb258dff2a19e739d9.tar.gz Doxygen-1941e88efd5d0f1f049b50eb258dff2a19e739d9.tar.bz2 |
Bug 691315 - Line breaks are not copied/displayed properly when using @copydoc.
Bug 700788 - probably unintentional modification of behaviour of @copydetails
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index 45f5425..ef70dfd 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -116,6 +116,8 @@ static bool handleToc(const QCString &s); static bool handleInherit(const QCString &); static bool handleExtends(const QCString &); static bool handleCopyDoc(const QCString &); +static bool handleCopyBrief(const QCString &); +static bool handleCopyDetails(const QCString &); typedef bool (*DocCmdFunc)(const QCString &name); @@ -218,8 +220,8 @@ static DocCmdMap docCmdMap[] = { "author", 0, TRUE }, { "authors", 0, TRUE }, { "copydoc", &handleCopyDoc, TRUE }, - { "copybrief", 0, FALSE }, - { "copydetails", 0, TRUE }, + { "copybrief", &handleCopyBrief, FALSE }, + { "copydetails", &handleCopyDetails, TRUE }, { "copyright", 0, TRUE }, { "date", 0, TRUE }, { "dotfile", 0, TRUE }, @@ -2674,9 +2676,43 @@ static bool handleExtends(const QCString &) return FALSE; } +static bool handleCopyBrief(const QCString &) +{ + if (current->brief.isEmpty() && current->doc.isEmpty()) + { // if we don't have a brief or detailed description yet, + // then the @copybrief should end up in the brief description. + // otherwise it will be copied inline (see bug691315 & bug700788) + setOutput(OutputBrief); + } + if (g_spaceBeforeCmd) + { + addOutput(' '); + g_spaceBeforeCmd=FALSE; + } + addOutput("\\copybrief "); + return FALSE; +} + +static bool handleCopyDetails(const QCString &) +{ + setOutput(OutputDoc); + if (g_spaceBeforeCmd) + { + addOutput(' '); + g_spaceBeforeCmd=FALSE; + } + addOutput("\\copydetails "); + return FALSE; +} + static bool handleCopyDoc(const QCString &) { setOutput(OutputBrief); + if (g_spaceBeforeCmd) + { + addOutput(' '); + g_spaceBeforeCmd=FALSE; + } addOutput("\\copybrief "); g_copyDocArg.resize(0); BEGIN(CopyDoc); |