summaryrefslogtreecommitdiffstats
path: root/lib/util/filetemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/filetemplate.cpp')
-rw-r--r--lib/util/filetemplate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/util/filetemplate.cpp b/lib/util/filetemplate.cpp
index c2454580..bb2cb7c6 100644
--- a/lib/util/filetemplate.cpp
+++ b/lib/util/filetemplate.cpp
@@ -52,13 +52,17 @@ TQString FileTemplate::read(KDevPlugin *part, const TQString &name, Policy p)
TQString FileTemplate::readFile(KDevPlugin *part, const TQString &fileName)
{
- TQDomDocument &dom = *part->projectDom();
+ TQDomDocument dom;
TQFile f(fileName);
if (!f.open(IO_ReadOnly))
return TQString();
TQTextStream stream(&f);
TQString str = stream.read();
+ if (part->projectDom())
+ {
+ dom = *part->projectDom();
+ }
return makeSubstitutions( dom, str );
}