Ticket #2028: CInput_iterators.patch

File CInput_iterators.patch, 1.7 KB (added by Jorma Rebane, 11 years ago)

Less hacky fix

  • CInput.cpp

     
    13901390    m_iBufferPos = std::min(m_iBufferPos, (int)caption.size());
    13911391    m_iBufferPos_Tail = std::min(m_iBufferPos_Tail, (int)caption.size());
    13921392
    1393     if (font_name == CStrW())
     1393    if (font_name.empty())
    13941394    {
    13951395        // Destroy everything stored, there's no font, so there can be
    13961396        //  no data.
     
    14371437        //  when continuing to see how much more after 'to' we need to remake.
    14381438        int i=0;
    14391439        for (std::list<SRow>::iterator it=m_CharacterPositions.begin();
    1440              it!=m_CharacterPositions.end(); ++it, ++i)
     1440             it != m_CharacterPositions.end(); ++it, ++i)
    14411441        {
    14421442            if (destroy_row_from_used == false &&
    14431443                it->m_ListStart > from)
     
    15171517        // Setup the first row
    15181518        row.m_ListStart = destroy_row_from->m_ListStart;
    15191519
    1520         // Set current line, new rows will be added before current_line, so
    1521         //  we'll choose the destroy_row_to, because it won't be deleted
    1522         //  in the coming erase.
    1523         current_line = destroy_row_to;
    1524 
    15251520        std::list<SRow>::iterator temp_it = destroy_row_to;
    15261521        --temp_it;
    15271522
    1528         m_CharacterPositions.erase(destroy_row_from, destroy_row_to);
     1523        current_line = m_CharacterPositions.erase(destroy_row_from, destroy_row_to);
    15291524       
    15301525        // If there has been a change in number of characters
    15311526        //  we need to change all m_ListStart that comes after
     
    15341529        int delta = to_after - to_before;
    15351530        if (delta != 0)
    15361531        {
    1537             for (std::list<SRow>::iterator it=current_line;
    1538                  it!=m_CharacterPositions.end();
     1532            for (std::list<SRow>::iterator it = current_line;
     1533                 it != m_CharacterPositions.end();
    15391534                 ++it)
    15401535            {
    15411536                it->m_ListStart += delta;