mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 17:50:04 +00:00 
			
		
		
		
	Fix layer model sign comparisons
This commit is contained in:
		
							parent
							
								
									ba75326c0c
								
							
						
					
					
						commit
						f7851488d6
					
				
					 1 changed files with 8 additions and 7 deletions
				
			
		|  | @ -839,7 +839,7 @@ bool LayerModel::dropMimeData(const QMimeData* data, | ||||||
|    // Ensure rows are in numerical order
 |    // Ensure rows are in numerical order
 | ||||||
|    std::sort(sourceRows.begin(), sourceRows.end()); |    std::sort(sourceRows.begin(), sourceRows.end()); | ||||||
| 
 | 
 | ||||||
|    if (sourceRows.back() >= p->layers_.size()) |    if (sourceRows.back() >= static_cast<int>(p->layers_.size())) | ||||||
|    { |    { | ||||||
|       logger_->error("Cannot perform drop action, invalid source rows"); |       logger_->error("Cannot perform drop action, invalid source rows"); | ||||||
|       return false; |       return false; | ||||||
|  | @ -910,9 +910,10 @@ bool LayerModel::moveRows(const QModelIndex& sourceParent, | ||||||
|    if (sourceParent != destinationParent || // Only accept internal moves
 |    if (sourceParent != destinationParent || // Only accept internal moves
 | ||||||
|        count < 1 ||                         // Minimum selection size of 1
 |        count < 1 ||                         // Minimum selection size of 1
 | ||||||
|        sourceRow < 0 ||                     // Valid source row (start)
 |        sourceRow < 0 ||                     // Valid source row (start)
 | ||||||
|        sourceRow + count > p->layers_.size() || // Valid source row (end)
 |        sourceRow + count > | ||||||
|  |           static_cast<int>(p->layers_.size()) || // Valid source row (end)
 | ||||||
|        destinationChild < 0 ||                   // Valid destination row
 |        destinationChild < 0 ||                   // Valid destination row
 | ||||||
|        destinationChild > p->layers_.size()) |        destinationChild > static_cast<int>(p->layers_.size())) | ||||||
|    { |    { | ||||||
|       return false; |       return false; | ||||||
|    } |    } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat