| 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 | } |