summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-07-26 17:06:10 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-07-26 17:06:10 (GMT)
commit2eaaf3aca438066677f732054188fee0be48433e (patch)
tree6325b7cad893b75aed257cc208cd75efce818c29
parente9b7e9d8719bbc317a26f31017df2255cbd314b9 (diff)
downloadDoxygen-2eaaf3aca438066677f732054188fee0be48433e.zip
Doxygen-2eaaf3aca438066677f732054188fee0be48433e.tar.gz
Doxygen-2eaaf3aca438066677f732054188fee0be48433e.tar.bz2
issue @7140 DoxygenLayout does not support UTF8 BOM format
Read the DoxygenLayout file in a similar way as the header / footer etc. for HTML and feed the (converted) result into the XML reader.
-rw-r--r--src/doxygen.cpp4
-rw-r--r--src/layout.cpp5
-rw-r--r--src/layout.h2
3 files changed, 5 insertions, 6 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 85ed747..3cb12a0 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -11270,9 +11270,7 @@ void parseInput()
if (layoutFile.open(IO_ReadOnly))
{
msg("Parsing layout file %s...\n",layoutFileName.data());
- QTextStream t(&layoutFile);
- t.setEncoding(QTextStream::Latin1);
- LayoutDocManager::instance().parse(t,layoutFileName);
+ LayoutDocManager::instance().parse(layoutFileName);
}
else if (!defaultLayoutUsed)
{
diff --git a/src/layout.cpp b/src/layout.cpp
index a5df6f4..4ffdfb8 100644
--- a/src/layout.cpp
+++ b/src/layout.cpp
@@ -1538,10 +1538,11 @@ void LayoutDocManager::clear(LayoutDocManager::LayoutPart p)
d->docEntries[(int)p].clear();
}
-void LayoutDocManager::parse(QTextStream &t,const char *fileName)
+void LayoutDocManager::parse(const char *fileName)
{
LayoutErrorHandler errorHandler(fileName);
- QXmlInputSource source( t );
+ QXmlInputSource source;
+ source.setData(fileToString(fileName));
QXmlSimpleReader reader;
reader.setContentHandler( &LayoutParser::instance() );
reader.setErrorHandler( &errorHandler );
diff --git a/src/layout.h b/src/layout.h
index b25aa4e..b1facf5 100644
--- a/src/layout.h
+++ b/src/layout.h
@@ -201,7 +201,7 @@ class LayoutDocManager
LayoutNavEntry *rootNavEntry() const;
/** Parses a user provided layout */
- void parse(QTextStream &t,const char *fileName);
+ void parse(const char *fileName);
void init();
private:
void addEntry(LayoutPart p,LayoutDocEntry*e);