summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-04-13 13:27:01 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-04-13 13:27:01 (GMT)
commit0a2550ddf63307f4121023c97d117b4935366267 (patch)
treea86c4fb647b5e1aa46100a250eed01747617c464 /src
parente9185650216f3c3fa97759caf67ee79db66cb5e1 (diff)
downloadDoxygen-0a2550ddf63307f4121023c97d117b4935366267.zip
Doxygen-0a2550ddf63307f4121023c97d117b4935366267.tar.gz
Doxygen-0a2550ddf63307f4121023c97d117b4935366267.tar.bz2
Written layout file was empty
With `doxygen -l` the layout file was not written anymore.
Diffstat (limited to 'src')
-rw-r--r--src/layout.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/layout.cpp b/src/layout.cpp
index bd88d35..c0f3a37 100644
--- a/src/layout.cpp
+++ b/src/layout.cpp
@@ -1609,15 +1609,19 @@ void LayoutDocManager::parse(const char *fileName)
void writeDefaultLayoutFile(const char *fileName)
{
- std::ofstream t(fileName,std::ofstream::out | std::ofstream::binary);
- bool ok = openOutputFile(fileName,t);
- if (!ok)
+ std::ofstream f;
+ if (openOutputFile(fileName,f))
+ {
+ TextStream t(&f);
+ QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
+ t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
+ }
+ else
{
err("Failed to open file %s for writing!\n",fileName);
return;
- }
- QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
- t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
+ }
+ f.close();
}
//----------------------------------------------------------------------------------