summaryrefslogtreecommitdiff
path: root/src/qdoc/doc.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@theqtcompany.com>2015-11-24 15:48:10 +0100
committerTopi Reiniƶ <topi.reinio@theqtcompany.com>2015-11-27 12:44:46 +0000
commit82b6bcaeb30c29e9152e97e6898414acba7d402f (patch)
tree3034385ee87f132f3ba278c43325e5f51fa6cbf9 /src/qdoc/doc.cpp
parentbce6d7fb63f33a627287ee4ce9373fb2747acf7f (diff)
downloadqttools-82b6bcaeb30c29e9152e97e6898414acba7d402f.tar.gz
qdoc: Always remove excess indentation from code snippets
QDoc kept track of a 'minimum indent' between code snippets seen in the same comment block. If the first snippet had 0 indentation, all other snippets were output with their indentation intact. This change removes the stored minimum indent, causing the least indented line in any <pre> block to never have leading spaces. Has no effect on the indentation within a code snippet. Change-Id: Ie27a4b4d370c545036dfaa573807ba9f59bbdce1 Task-number: QTBUG-49617 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Diffstat (limited to 'src/qdoc/doc.cpp')
-rw-r--r--src/qdoc/doc.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp
index cfe28ab9f..b8fd5f931 100644
--- a/src/qdoc/doc.cpp
+++ b/src/qdoc/doc.cpp
@@ -526,7 +526,6 @@ private:
QString pendingParaString;
int braceDepth;
- int minIndent;
Doc::Sections currentSection;
QMap<QString, Location> targetMap_;
QMap<int, QString> pendingFormats;
@@ -575,7 +574,6 @@ void DocParser::parse(const QString& source,
pendingParaRightType = Atom::Nop;
braceDepth = 0;
- minIndent = INT_MAX;
currentSection = Doc::NoSection;
openedCommands.push(CMD_OMIT);
quoter.reset();
@@ -2544,9 +2542,7 @@ QString DocParser::getCode(int cmd, CodeMarker *marker)
{
QString code = untabifyEtc(getUntilEnd(cmd));
int indent = indentLevel(code);
- if (indent < minIndent)
- minIndent = indent;
- code = unindent(minIndent, code);
+ code = unindent(indent, code);
if (!marker)
marker = CodeMarker::markerForCode(code);
return marker->markedUpCode(code, 0, location());