From 3b78aa72c736b856f739123b125fdb36e9160fee Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 7 Nov 2012 13:17:30 +0100 Subject: [PATCH] qdoc: Removed setting of codeindent variable All the qdocconf files in use for Qt 5.0 set the codeindent variable to 1, which prefixes each line of a snippet with one ' '. But this messes up the cutting and pasting of snippets into editors for actual use. qdoc now lets the codeindent variable be initialized to 0, and then it never changes it. This looks ok in the default formatted html output. If the html output formatted with the template CSS files also looks ok, then the codeindent variable can be removed from all the qdocconf files, since it will no longer be used by qdoc. Task number: QTBUG-27798 Change-Id: I398c57bdfc99e747ec086fbd8ddf5994cf3ee6d5 Reviewed-by: Mitch Curtis Reviewed-by: Jerome Pasion --- src/tools/qdoc/ditaxmlgenerator.cpp | 3 ++- src/tools/qdoc/htmlgenerator.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 563df612ab..1ffbcf986c 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -573,7 +573,8 @@ void DitaXmlGenerator::initializeGenerator(const Config &config) customHeadElements = config.getStringList(DitaXmlGenerator::format() + Config::dot + DITAXMLGENERATOR_CUSTOMHEADELEMENTS); - codeIndent = config.getInt(CONFIG_CODEINDENT); + // The following line was changed to fix QTBUG-27798 + //codeIndent = config.getInt(CONFIG_CODEINDENT); version = config.getString(CONFIG_VERSION); vrm = version.split(QLatin1Char('.')); } diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 17dc40f08a..d48c706707 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -94,7 +94,8 @@ static void addLink(const QString &linkTarget, Constructs the HTML output generator. */ HtmlGenerator::HtmlGenerator() - : helpProjectWriter(0), + : codeIndent(0), + helpProjectWriter(0), inObsoleteLink(false), funcLeftParen("\\S(\\()"), obsoleteLinks(false) @@ -210,7 +211,8 @@ void HtmlGenerator::initializeGenerator(const Config &config) ++edition; } - codeIndent = config.getInt(CONFIG_CODEINDENT); + // The following line was changed to fix QTBUG-27798 + //codeIndent = config.getInt(CONFIG_CODEINDENT); helpProjectWriter = new HelpProjectWriter(config, project.toLower() + ".qhp", this);