diff --git a/decode.cpp b/decode.cpp index 8258e13..c665c72 100644 --- a/decode.cpp +++ b/decode.cpp @@ -32,6 +32,15 @@ TeletextPageDecode::Invocation::Invocation() m_fullScreenCLUT = -1; } +void TeletextPageDecode::Invocation::clear() +{ + m_characterMap.clear(); + m_attributeMap.clear(); + m_rightMostColumn.clear(); + m_fullScreenCLUT = -1; + m_fullRowCLUTMap.clear(); +} + void TeletextPageDecode::Invocation::setTripletList(X26TripletList *tripletList) { m_tripletList = tripletList; @@ -62,11 +71,7 @@ void TeletextPageDecode::Invocation::buildMap(int level) else endTripletNumber = m_endTripletNumber; - m_characterMap.clear(); - m_attributeMap.clear(); - m_rightMostColumn.clear(); - m_fullScreenCLUT = -1; - m_fullRowCLUTMap.clear(); + clear(); for (int i=m_startTripletNumber; i<=endTripletNumber; i++) { const X26Triplet triplet = m_tripletList->at(i); @@ -221,8 +226,10 @@ void TeletextPageDecode::updateSidePanels() void TeletextPageDecode::buildInvocationList(Invocation &invocation, int objectType) { - if (invocation.tripletList()->isEmpty()) + if (invocation.tripletList()->isEmpty()) { + invocation.clear(); return; + } int i; diff --git a/decode.h b/decode.h index c428367..1870e0f 100644 --- a/decode.h +++ b/decode.h @@ -184,6 +184,7 @@ private: Invocation(); X26TripletList *tripletList() const { return m_tripletList; }; + void clear(); void setTripletList(X26TripletList *); int startTripletNumber() const { return m_startTripletNumber; }; void setStartTripletNumber(int);