Fix Java doxygen:notranslate for single line comments
Remove extra generated line
This commit is contained in:
parent
57f7070406
commit
d22ecafb36
4 changed files with 17 additions and 4 deletions
|
|
@ -718,10 +718,12 @@ std::string JavaDocConverter::indentAndInsertAsterisks(const string &doc) {
|
|||
|
||||
size_t idx = doc.find('\n');
|
||||
size_t indent = 0;
|
||||
bool singleLineComment = idx == string::npos;
|
||||
// Detect indentation.
|
||||
// The first line in comment is the one after '/**', which may be
|
||||
// spaces and '\n' or the text. In any case it is not suitable to detect
|
||||
// indentation, so we have to skip the first '\n'.
|
||||
// However, if there is just one line, then use that line to detect indentation.
|
||||
if (idx != string::npos) {
|
||||
size_t nonspaceIdx = doc.find_first_not_of(" \t", idx + 1);
|
||||
if (nonspaceIdx != string::npos) {
|
||||
|
|
@ -767,7 +769,8 @@ std::string JavaDocConverter::indentAndInsertAsterisks(const string &doc) {
|
|||
size_t nonspaceEndIdx = translatedStr.find_last_not_of(" \t");
|
||||
if (nonspaceEndIdx != string::npos) {
|
||||
if (translatedStr[nonspaceEndIdx] != '\n') {
|
||||
translatedStr += '\n';
|
||||
if (!singleLineComment)
|
||||
translatedStr += '\n';
|
||||
} else {
|
||||
// remove trailing spaces
|
||||
translatedStr = translatedStr.substr(0, nonspaceEndIdx + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue