fixed prepending '*' to nontranslated comments by taking also tabs into account
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13731 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e50d37664f
commit
2f77dbc7f4
2 changed files with 6 additions and 6 deletions
|
|
@ -31,7 +31,7 @@
|
|||
* Returns address of file line.
|
||||
*
|
||||
* @param fileName name of the file, where the source line is located
|
||||
* @param line line number
|
||||
* @param line line number
|
||||
* @param isGetSize if set, for every object location both address and size are returned
|
||||
*
|
||||
* @link Connection::getId() @endlink <br>
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ void JavaDocConverter::fillStaticTables() {
|
|||
|
||||
|
||||
JavaDocConverter::JavaDocConverter(bool debugTranslator, bool debugParser)
|
||||
: DoxygenTranslator(true, true) {
|
||||
: DoxygenTranslator(debugTranslator, debugParser) {
|
||||
fillStaticTables();
|
||||
}
|
||||
|
||||
|
|
@ -543,7 +543,7 @@ std::string JavaDocConverter::indentAndInsertAsterisks(const string &doc) {
|
|||
// spaces and '\n' or the text. In any case it is not suitable to detect
|
||||
// indentation, so we have to skip the first '\n'.
|
||||
if (idx != string::npos) {
|
||||
size_t nonspaceIdx = doc.find_first_not_of(' ', idx + 1);
|
||||
size_t nonspaceIdx = doc.find_first_not_of(" \t", idx + 1);
|
||||
if (nonspaceIdx != string::npos) {
|
||||
indent = nonspaceIdx - idx;
|
||||
}
|
||||
|
|
@ -564,14 +564,14 @@ std::string JavaDocConverter::indentAndInsertAsterisks(const string &doc) {
|
|||
|
||||
while (idx != string::npos) {
|
||||
|
||||
size_t nonspaceIdx = translatedStr.find_first_not_of(' ', idx + 1);
|
||||
size_t nonspaceIdx = translatedStr.find_first_not_of(" \t", idx + 1);
|
||||
if (nonspaceIdx != string::npos && translatedStr[nonspaceIdx] != '*') {
|
||||
|
||||
// line without '*' found - is it empty?
|
||||
if (translatedStr[nonspaceIdx] != '\n') {
|
||||
// add '* ' to each line without it
|
||||
translatedStr = translatedStr.substr(0, nonspaceIdx) + "* " +
|
||||
translatedStr.substr(nonspaceIdx);
|
||||
//printf(translatedStr.c_str());
|
||||
} else {
|
||||
// we found empty line, replace it with indented '*'
|
||||
translatedStr = translatedStr.substr(0, idx + 1) + indentStr +
|
||||
|
|
@ -582,7 +582,7 @@ std::string JavaDocConverter::indentAndInsertAsterisks(const string &doc) {
|
|||
}
|
||||
|
||||
// Add the last comment line properly indented
|
||||
size_t nonspaceEndIdx = translatedStr.find_last_not_of(' ');
|
||||
size_t nonspaceEndIdx = translatedStr.find_last_not_of(" \t");
|
||||
if (nonspaceEndIdx != string::npos) {
|
||||
if (translatedStr[nonspaceEndIdx] != '\n') {
|
||||
translatedStr += '\n';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue