From 37e08bbdd4b1a9fcd0733e92515a28bd8a90a7cd Mon Sep 17 00:00:00 2001 From: Jarek Kobus <jkobus@trolltech.com> Date: Fri, 13 Nov 2009 08:48:28 +0100 Subject: [PATCH] Fix a bug when processing the comment When we meet /* we look for closing */ and continue processing from the next char, not from '/' which was a part of the closing comment --- src/plugins/designer/qtcreatorintegration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 87a087caf3f..31ecc39d2b3 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -368,13 +368,13 @@ static int findClassEndPosition(const QString &headerContents, int classStartPos if (contents.mid(idx, 2) == QLatin1String("//")) { idx = contents.indexOf(QLatin1Char('\n'), idx + 2) + 1; // drop everything up to the end of line } else if (contents.mid(idx, 2) == QLatin1String("/*")) { - idx = contents.indexOf(QLatin1String("*/"), idx + 2) + 1; // drop everything up to the nearest */ + idx = contents.indexOf(QLatin1String("*/"), idx + 2) + 2; // drop everything up to the nearest */ } else if (contents.mid(idx, 4) == QLatin1String("'\\\"'")) { idx += 4; // drop it } else if (contents.at(idx) == QLatin1Char('\"')) { do { idx = contents.indexOf(QLatin1Char('\"'), idx + 1); // drop everything up to the nearest " - } while (idx > 0 && !isEndingQuote(contents, idx)); // if the nearest " is preceeded by \ (or by \\\ or by \\\\\, but not by \\ nor \\\\) we find next one + } while (idx > 0 && !isEndingQuote(contents, idx)); // if the nearest " is preceded by \ (or by \\\ or by \\\\\, but not by \\ nor \\\\) we find next one if (idx < 0) break; idx++; -- GitLab