Clear invocation QMaps on empty triplet list

Fixes a bug where local enhancements hung around when switching to a subpage
without enhancements.
This commit is contained in:
G.K.MacGregor
2023-05-09 23:35:29 +01:00
parent 021fbfa60f
commit 955a1262e9
2 changed files with 14 additions and 6 deletions

View File

@@ -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;

View File

@@ -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);