diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-12-13 21:11:09 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 19:10:20 -0300 |
commit | e648d0b0398f46afd2d5c5113a3b95a0522f5c2a (patch) | |
tree | c189ec4a77c348a4db1f7ce80706d812a729837a /typesystem.cpp | |
parent | 5e5009140ec778dd217ce254770ed25c755a906c (diff) |
Fixed insert-template tag when used inside a module level inject-code tag.
Also added unit tests.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'typesystem.cpp')
-rw-r--r-- | typesystem.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/typesystem.cpp b/typesystem.cpp index daffebaa8..bbf7e86a1 100644 --- a/typesystem.cpp +++ b/typesystem.cpp @@ -224,6 +224,14 @@ bool Handler::endElement(const QString &, const QString &localName, const QStrin case StackElement::TemplateInstanceEnum: switch (m_current->parent->type) { case StackElement::InjectCode: + if (m_current->parent->parent->type == StackElement::Root) { + CodeSnipList snips = m_current->parent->entry->codeSnips(); + CodeSnip snip = snips.takeLast(); + snip.addTemplateInstance(m_current->value.templateInstance); + snips.append(snip); + m_current->parent->entry->setCodeSnips(snips); + break; + } case StackElement::NativeToTarget: case StackElement::AddConversion: m_contextStack.top()->codeSnips.last().addTemplateInstance(m_current->value.templateInstance); |