gui/widget/hintboxext.cpp: fix invalid iterator advance

Origin commit data
------------------
Branch: ni/coolstream
Commit: 1c89d21b41
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-05-09 (Wed, 09 May 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-05-09 17:31:43 +04:00
parent 6bf5dd0268
commit eade8b8fba

View File

@@ -258,26 +258,33 @@ void CHintBoxExt::refresh(bool toround)
// it != m_startEntryOfPage.end();it++) { // it != m_startEntryOfPage.end();it++) {
// printf(" %d",*it); // printf(" %d",*it);
// } // }
// printf("\n current page: %d",m_currentPage); printf("\n current page: %d lines %d ",m_currentPage, m_lines.size());
// printf("von %d bis %d\n",m_startEntryOfPage[m_currentPage],m_startEntryOfPage[m_currentPage+1]-1); printf("start %d bis %d\n",m_startEntryOfPage[m_currentPage],m_startEntryOfPage[m_currentPage+1]-1);
#if 0
for (ContentLines::iterator it = m_lines.begin() + m_startEntryOfPage[m_currentPage]; for (ContentLines::iterator it = m_lines.begin() + m_startEntryOfPage[m_currentPage];
it != m_lines.begin() + m_startEntryOfPage[m_currentPage+1] it != m_lines.begin() + m_startEntryOfPage[m_currentPage+1]
&& it != m_lines.end(); ++it) && it != m_lines.end(); ++it)
#endif
for (int count = 0; count < (int) m_lines.size(); count++)
{ {
int xPos = textStartX; if ((count >= m_startEntryOfPage[m_currentPage]) &&
int maxHeight = 0; (count < m_startEntryOfPage[m_currentPage+1]))
for (std::vector<Drawable*>::iterator d = it->begin();d!=it->end();++d)
{ {
// (*d)->print(); int xPos = textStartX;
// printf("\n"); int maxHeight = 0;
//(*d)->draw(m_window,xPos,yPos,m_width); for (std::vector<Drawable*>::iterator d = m_lines[count].begin(); d != m_lines[count].end(); ++d)
(*d)->draw(m_window,xPos,yPos,m_width-20); {
xPos += (*d)->getWidth() + 20; // (*d)->print();
if ((*d)->getHeight() > maxHeight) // printf("\n");
maxHeight = (*d)->getHeight(); //(*d)->draw(m_window,xPos,yPos,m_width);
(*d)->draw(m_window,xPos,yPos,m_width-20);
xPos += (*d)->getWidth() + 20;
if ((*d)->getHeight() > maxHeight)
maxHeight = (*d)->getHeight();
}
yPos += maxHeight;
} }
yPos += maxHeight;
} }
if (has_scrollbar()) if (has_scrollbar())