diff options
Diffstat (limited to 'src/xmlcomposehelpers.cpp')
-rw-r--r-- | src/xmlcomposehelpers.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/xmlcomposehelpers.cpp b/src/xmlcomposehelpers.cpp index a1bc73f..6612df9 100644 --- a/src/xmlcomposehelpers.cpp +++ b/src/xmlcomposehelpers.cpp @@ -58,7 +58,10 @@ Level::Level(const Level& level) : Level::~Level() { - + if(m_analyser) + m_analyser->done(); + if(m_destination) + m_destination->done(); } LevelPtr Level::pushLevel() @@ -106,15 +109,21 @@ void Level::setAnalyser(AnalyserPtr analyser, bool deep) { if(deep && m_previous && !m_analyser) m_previous->setAnalyser(analyser, deep); + else + { + if(m_analyser != NULL) + m_analyser->done(); + m_analyser = analyser; + } } -DestinationPtr Level::getDestination() +DestinationPtr Level::getDestination(bool deep) { if(m_destination) return m_destination; - else if(m_previous) + else if(deep && m_previous) return m_previous->getDestination(); else return NULL; @@ -125,7 +134,12 @@ void Level::setDestination(DestinationPtr destination, bool deep) if(deep && m_previous && !m_destination) m_previous->setDestination(destination, deep); else + { + if(m_destination != NULL) + m_destination->done(); + m_destination = destination; + } } RtfFormatting& Level::getFormatting() |