Restore ability to grow primary w/unallocated space before extended (#778700)

A regression which prevented growing a primary partition that had
unallocated space between it and the following extended partition was
introduced with the following commit:

  Create and use general find_extended_partition() function
  aa98107706

To fix the regression, restore the logic that checked for a logical
partition before seeking the index of the extended partition.

Bug 778700 - Unable to grow partition even though unallocated space is
             adjacent
This commit is contained in:
Curtis Gedak 2017-02-16 10:10:14 -07:00 committed by Mike Fleetwood
parent 4cc5103dbd
commit 4a0931c50d
1 changed files with 6 additions and 3 deletions

View File

@ -1783,9 +1783,12 @@ void Win_GParted::activate_resize()
g_assert( valid_display_partition_ptr( selected_partition_ptr ) ); // Bug: Not pointing at a valid display partition object
PartitionVector * display_partitions_ptr = &display_partitions;
if ( selected_partition_ptr->type == TYPE_LOGICAL )
{
int index_extended = find_extended_partition( display_partitions );
if ( index_extended >= 0 )
display_partitions_ptr = &display_partitions[index_extended].logicals;
}
FS fs_cap = gparted_core.get_fs( selected_partition_ptr->get_filesystem_partition().filesystem );
Partition * working_ptn;