summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Klopcic <marko.klopcic@isystem.si>2012-08-30 20:35:23 +0000
committerMarko Klopcic <marko.klopcic@isystem.si>2012-08-30 20:35:23 +0000
commit2f77dbc7f4e2b406cb52aeaa10758dd35fffeca5 (patch)
tree1ca0360c43ff3ec8d24b8cd4ee3d0eb97b19023b
parente50d37664f86ae31722826c40113a8662b3d899c (diff)
downloadswig-2f77dbc7f4e2b406cb52aeaa10758dd35fffeca5.tar.gz
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
-rw-r--r--Examples/test-suite/doxygen_misc_constructs.i2
-rw-r--r--Source/DoxygenTranslator/src/JavaDocConverter.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/Examples/test-suite/doxygen_misc_constructs.i b/Examples/test-suite/doxygen_misc_constructs.i
index 80627559b..0af22c72d 100644
--- a/Examples/test-suite/doxygen_misc_constructs.i
+++ b/Examples/test-suite/doxygen_misc_constructs.i
@@ -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>
diff --git a/Source/DoxygenTranslator/src/JavaDocConverter.cpp b/Source/DoxygenTranslator/src/JavaDocConverter.cpp
index 2144ffb9e..667e4f74e 100644
--- a/Source/DoxygenTranslator/src/JavaDocConverter.cpp
+++ b/Source/DoxygenTranslator/src/JavaDocConverter.cpp
@@ -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';