diff --git a/ChangeLog b/ChangeLog index 882ace15..cd8e4cc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2006-03-06 Bart Hakvoort +2006-03-07 Bart Hakvoort + + * src/Dialog_Partition_Copy.cc, + src/Dialog_Partition_Resize_Move.cc: cleanups + +2006-03-07 Bart Hakvoort * include/GParted_Core.h, include/TreeView_Detail.h, diff --git a/src/Dialog_Partition_Copy.cc b/src/Dialog_Partition_Copy.cc index 6a482863..5ca60c3d 100644 --- a/src/Dialog_Partition_Copy.cc +++ b/src/Dialog_Partition_Copy.cc @@ -39,7 +39,7 @@ void Dialog_Partition_Copy::Set_Data( const Partition & selected_partition, cons //set some widely used values... START = selected_partition .sector_start ; - total_length = selected_partition .sector_end - selected_partition .sector_start ; + total_length = selected_partition .get_length() ; TOTAL_MB = Utils::Round( Utils::sector_to_unit( selected_partition .get_length(), GParted::UNIT_MIB ) ) ; MB_PER_PIXEL = TOTAL_MB / 500.00 ; diff --git a/src/Dialog_Partition_Resize_Move.cc b/src/Dialog_Partition_Resize_Move.cc index be327b36..279b6c76 100644 --- a/src/Dialog_Partition_Resize_Move.cc +++ b/src/Dialog_Partition_Resize_Move.cc @@ -79,9 +79,9 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector= 1 && partitions[t -1].type == GParted::TYPE_UNALLOCATED && ! this ->fixed_start ) { - previous = partitions[t -1] .sector_end - partitions[t -1] .sector_start ; + previous = partitions[t -1] .get_length() ; START = partitions[t -1] .sector_start ; } else START = selected_partition .sector_start ; if ( t +1 < partitions .size() && partitions[t +1] .type == GParted::TYPE_UNALLOCATED ) - next = partitions[t +1].sector_end - partitions[t +1].sector_start ; + next = partitions[t +1] .get_length() ; - total_length = previous + selected_partition.get_length() + next; + total_length = previous + selected_partition .get_length() + next; TOTAL_MB = Utils::Round( Utils::sector_to_unit( total_length, GParted::UNIT_MIB ) ) ; MB_PER_PIXEL = TOTAL_MB / 500.00 ; @@ -166,16 +166,16 @@ void Dialog_Partition_Resize_Move::Resize_Move_Extended( const std::vector 0 && partitions[t -1].type == GParted::TYPE_UNALLOCATED ) { - previous = partitions[t -1].sector_end - partitions[t -1].sector_start ; - START = partitions[t -1].sector_start ; + previous = partitions[t -1] .get_length() ; + START = partitions[t -1] .sector_start ; } else START = selected_partition .sector_start ; //calculate length of next if ( t +1 < partitions .size() && partitions[ t +1 ] .type == GParted::TYPE_UNALLOCATED ) - next = partitions[ t +1 ] .sector_end - partitions[ t +1 ] .sector_start ; - + next = partitions[ t +1 ] .get_length() ; + //now we have enough data to calculate some important values.. total_length = previous + selected_partition .get_length() + next; TOTAL_MB = Utils::Round( Utils::sector_to_unit( total_length, UNIT_MIB ) ) ;