diff options
Diffstat (limited to 'src/plugins/cpptools/doxygengenerator.cpp')
-rw-r--r-- | src/plugins/cpptools/doxygengenerator.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/plugins/cpptools/doxygengenerator.cpp b/src/plugins/cpptools/doxygengenerator.cpp index fe48422344..5737192bf1 100644 --- a/src/plugins/cpptools/doxygengenerator.cpp +++ b/src/plugins/cpptools/doxygengenerator.cpp @@ -56,7 +56,6 @@ DoxygenGenerator::DoxygenGenerator() , m_generateBrief(true) , m_startComment(true) , m_style(QtStyle) - , m_commentOffset(0) {} void DoxygenGenerator::setStyle(DocumentationStyle style) @@ -308,16 +307,11 @@ void DoxygenGenerator::assignCommentOffset(QTextCursor cursor) cursor.setPosition(cursor.anchor()); } - m_commentOffset = cursor.positionInBlock(); + cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor); + m_commentOffset = cursor.selectedText(); } QString DoxygenGenerator::offsetString() const { - // Note: Currently we don't indent comments, but simply preserve them in the original - // relative positions. What we do here is just to make sure that such positions are correct, - // although they might still be wrong from an indentation point of view (for instance, - // using spaces instead of tabs). Therefore, the content generated should still have - // the indentation strings fixed. - - return QString(m_commentOffset, QLatin1Char(' ')); + return m_commentOffset; } |