diff --git a/include/Dialog_Base_Partition.h b/include/Dialog_Base_Partition.h index dca4d1a7..f262443f 100644 --- a/include/Dialog_Base_Partition.h +++ b/include/Dialog_Base_Partition.h @@ -55,7 +55,9 @@ protected: NEW = 1, PASTE = 2 }; - + + void prepare_new_partition( Byte_Value sector_size ); + void Set_Confirm_Button( CONFIRMBUTTON button_type ) ; void Set_MinMax_Text( Sector min, Sector max ) ; diff --git a/src/Dialog_Base_Partition.cc b/src/Dialog_Base_Partition.cc index 37375b4a..4f4f6546 100644 --- a/src/Dialog_Base_Partition.cc +++ b/src/Dialog_Base_Partition.cc @@ -136,7 +136,13 @@ void Dialog_Base_Partition::Set_Resizer( bool extended ) this ->show_all_children() ; } -Partition Dialog_Base_Partition::Get_New_Partition( Byte_Value sector_size ) +Partition Dialog_Base_Partition::Get_New_Partition( Byte_Value sector_size ) +{ + prepare_new_partition( sector_size ); + return selected_partition; +} + +void Dialog_Base_Partition::prepare_new_partition( Byte_Value sector_size ) { //set sector size of new partition selected_partition .sector_size = sector_size; @@ -221,8 +227,6 @@ Partition Dialog_Base_Partition::Get_New_Partition( Byte_Value sector_size ) //if the original before value has not changed, then set indicator to keep start sector unchanged if ( ORIG_BEFORE == spinbutton_before .get_value_as_int() ) selected_partition .strict_start = TRUE ; - - return selected_partition ; } void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type ) diff --git a/src/Dialog_Partition_Copy.cc b/src/Dialog_Partition_Copy.cc index e3d4f53e..7744f666 100644 --- a/src/Dialog_Partition_Copy.cc +++ b/src/Dialog_Partition_Copy.cc @@ -97,7 +97,7 @@ void Dialog_Partition_Copy::Set_Data( const Partition & selected_partition, cons , ceil( fs .MAX / double(MEBIBYTE) ) ) ; - //set global selected_partition (see Dialog_Base_Partition::Get_New_Partition ) + // Set member variable used in Dialog_Base_Partition::prepare_new_partition() this ->selected_partition = copied_partition ; this ->selected_partition .device_path = selected_partition .device_path ; this ->selected_partition .inside_extended = selected_partition .inside_extended ; @@ -118,7 +118,7 @@ void Dialog_Partition_Copy::Set_Data( const Partition & selected_partition, cons Partition Dialog_Partition_Copy::Get_New_Partition( Byte_Value sector_size ) { //first call baseclass to get the correct new partition - selected_partition = Dialog_Base_Partition::Get_New_Partition( sector_size ) ; + Dialog_Base_Partition::prepare_new_partition( sector_size ); //set proper name and status for partition selected_partition .status = GParted::STAT_COPY ;