From 705649888a5eccb8996b4674907527122a9ce26f Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Wed, 5 Jan 2011 17:22:28 -0200 Subject: [PATCH] Initialize the variable GeneratorPage::outputCodec before using it. This will avoid a crash when using the WebXml output format and also means that probably the WebXml backend doesn't obey the output codec choosen by the user, but this is another problem. --- tools/qdoc3/pagegenerator.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index f01bd7c..327d04d 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE /*! Nothing to do in the constructor. */ -PageGenerator::PageGenerator() +PageGenerator::PageGenerator() : outputCodec(0) { // nothing. } @@ -281,7 +281,9 @@ void PageGenerator::beginSubPage(const Location& location, location.fatal(tr("Cannot open output file '%1'") .arg(outFile->fileName())); QTextStream *out = new QTextStream(outFile); - out->setCodec(outputCodec); + + if (outputCodec) + out->setCodec(outputCodec); outStreamStack.push(out); } -- 1.7.3.4