Changeset 2455

Show
Ignore:
Timestamp:
02/16/12 23:13:59 (15 months ago)
Author:
mauser
Message:

Bugfix for #238: Moving cells in the songeditor

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/src/SongEditor/SongEditor.cpp

    r2447 r2455  
    533533                         */ 
    534534 
    535                         bool moved = false; 
    536                         for ( uint i = 0; i < movingCells.size(); i++ ) { 
    537                                 QPoint cell2 = movingCells[ i ]; 
    538                                 if(cell.x() == cell2.x()){ 
    539                                         moved = true;    
    540                                 } 
    541                         } 
    542  
    543                         if( moved ) 
    544                         { 
    545                                 continue; 
    546                         } 
    547  
    548                         if( undo ) 
    549                         { 
    550                             bool existing = false; 
    551                             for ( uint i = 0; i < existingCells.size(); i++ ) { 
    552                                 QPoint existing_cell = existingCells[ i ]; 
    553                                 if(existing_cell.x() == cell.x() && existing_cell.y() == cell.y()) existing = true; 
    554                             } 
    555  
    556                             //this cell existed before. Don't delete it! 
    557                             if(existing){ 
    558                                 continue; 
    559                             } 
    560                         } 
    561                          
    562  
    563                         if ( cell.x() < (int)pColumns->size() ) { 
    564                                 pColumn = (*pColumns)[ cell.x() ]; 
    565                         } 
    566                         else { 
    567                                 pColumn = new PatternList(); 
    568                                 pColumns->push_back( pColumn ); 
    569                         } 
    570                         pColumn->del(pPatternList->get( cell.y() ) ); 
    571                 } 
     535            bool moved = false; 
     536            for ( uint i = 0; i < movingCells.size(); i++ ) { 
     537                QPoint cell2 = movingCells[ i ]; 
     538                if( cell.x() == cell2.x() && cell.y() == cell2.y() ){ 
     539                    moved = true; 
     540                } 
     541            } 
     542 
     543            if( moved ) 
     544            { 
     545                continue; 
     546            } 
     547 
     548            if( undo ) 
     549            { 
     550                bool existing = false; 
     551                for ( uint i = 0; i < existingCells.size(); i++ ) { 
     552                    QPoint existing_cell = existingCells[ i ]; 
     553                    if(existing_cell.x() == cell.x() && existing_cell.y() == cell.y()) existing = true; 
     554                } 
     555 
     556                //this cell existed before. Don't delete it! 
     557                if(existing){ 
     558                    continue; 
     559                } 
     560            } 
     561 
     562 
     563            if ( cell.x() < (int)pColumns->size() ) { 
     564                pColumn = (*pColumns)[ cell.x() ]; 
     565            } 
     566            else { 
     567                pColumn = new PatternList(); 
     568                pColumns->push_back( pColumn ); 
     569            } 
     570            pColumn->del(pPatternList->get( cell.y() ) ); 
     571        } 
    572572        } 
    573573