summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStef <stef@ws.local>2004-07-23 22:05:17 +0000
committerStef <stef@ws.local>2004-07-23 22:05:17 +0000
commitb0d7c6324467fb18fa35d4a48eb978aa312553bd (patch)
tree44b159fa6967b4f0fc6aee0b504d2254dce26cac /src
parent44d34e022dbcda08908c298b5328e0b0bdda6f09 (diff)
- Add 'deep' semantics to getElement
Diffstat (limited to 'src')
-rw-r--r--src/xmlcomposehelpers.cpp8
-rw-r--r--src/xmlcomposehelpers.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/src/xmlcomposehelpers.cpp b/src/xmlcomposehelpers.cpp
index 1f1d952..74eb9c1 100644
--- a/src/xmlcomposehelpers.cpp
+++ b/src/xmlcomposehelpers.cpp
@@ -83,16 +83,14 @@ LevelPtr Level::getPrevious()
return m_previous;
}
-DOM::Element Level::getElement()
+DOM::Element Level::getElement(bool deep)
{
if(m_element != NULL)
return m_element;
- else if(m_previous)
+ else if(deep && m_previous)
return m_previous->getElement();
else
- ASSERT(0 && "should always have an element");
-
- return DOM::Element();
+ return DOM::Element();
}
void Level::setElement(DOM::Element element, bool deep)
diff --git a/src/xmlcomposehelpers.h b/src/xmlcomposehelpers.h
index 64f1fc4..6351162 100644
--- a/src/xmlcomposehelpers.h
+++ b/src/xmlcomposehelpers.h
@@ -138,7 +138,7 @@ public:
// The current XML Element
// TODO: Add deep semantics here
- DOM::Element getElement();
+ DOM::Element getElement(bool deep = true);
void setElement(DOM::Element element, bool deep = false);
// The current Analyser