Fix used and unused sector math when pasting a copied partition

This change is in preparation for supporting sectors sizes > 512 bytes.
This commit is contained in:
Curtis Gedak 2010-05-04 15:18:43 -06:00
parent bec2a6f176
commit 8155d4786d
1 changed files with 5 additions and 0 deletions

View File

@ -143,6 +143,11 @@ void Dialog_Partition_Copy::Set_Data( const Partition & selected_partition, cons
this ->selected_partition .inside_extended = selected_partition .inside_extended ;
this ->selected_partition .type =
selected_partition .inside_extended ? GParted::TYPE_LOGICAL : GParted::TYPE_PRIMARY ;
//Handle situation where src sector size is smaller than dst sector size and an additional partial dst sector is required.
this ->selected_partition .set_used(
( (copied_partition .sectors_used * copied_partition .sector_size)
+ (selected_partition .sector_size - 1)
) / selected_partition .sector_size ) ;
this ->show_all_children() ;
}