From a0ab2df6a0936518dfb69945d50d6238cc40da91 Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 06:50:12 +0000 Subject: [PATCH] 2002/08/18 05:30:45 darcs-hash:20040130065012-2ba56-9beba3bf530edf7498ec92071f137f9981a22e5b.gz --- CHANGES | 2 ++ src/org/xwt/Template.java | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 3efe222..36b6ba7 100644 --- a/CHANGES +++ b/CHANGES @@ -382,4 +382,6 @@ 17-Aug megacz Main.java: initial instantiation now happens in a background thread +17-Aug megacz Template.java: fixed a bug that was keeping retheme() from working + diff --git a/src/org/xwt/Template.java b/src/org/xwt/Template.java index 6a8113e..f345718 100644 --- a/src/org/xwt/Template.java +++ b/src/org/xwt/Template.java @@ -139,10 +139,12 @@ public class Template { // Methods to apply templates //////////////////////////////////////////////////////// - private Template() { } - private Template(InputStream is, String nodeName) throws XML.SAXException, IOException { + private Template(String nodeName) { this.nodeName = nodeName; cache.put(nodeName, this); + } + private Template(InputStream is, String nodeName) throws XML.SAXException, IOException { + this(nodeName); new TemplateHelper().parseit(is, this); } @@ -303,8 +305,7 @@ public class Template { if (t != b.template) retemplatize = true; b.template = t; } - if (b.template != null && b.template.changed) - retemplatize = true; + if (b.template != null && b.template.changed) retemplatize = true; if (retemplatize) { @@ -526,8 +527,7 @@ public class Template { nodeStack.addElement(t); // instantiate a new node, and set its nodeName/importlist/preapply - Template t2 = new Template(); - t2.nodeName = t.nodeName + "." + t.childvect.size(); + Template t2 = new Template(t.nodeName + "." + t.childvect.size()); t2.importlist = t.importlist; t2.startLine = line; if (!name.equals("box")) t2.preapply = new String[] { name }; -- 1.7.10.4