crop_region_to_selection: remove redundant check for a Range

get_edit_op_range() already checks for the existence of a Range
This commit is contained in:
Ben Loftis 2022-05-03 11:51:46 -05:00
parent 256549e0c7
commit 62fd8ecd35
1 changed files with 7 additions and 18 deletions

View File

@ -3452,27 +3452,16 @@ Editor::separate_under_selected_regions ()
void
Editor::crop_region_to_selection ()
{
if (!selection->time.empty()) {
timepos_t start;
timepos_t end;
if (get_edit_op_range (start, end)) {
begin_reversible_command (_("Crop Regions to Edit Range"));
crop_region_to (start, end);
begin_reversible_command (_("Crop Regions to Time Selection"));
for (std::list<TimelineRange>::iterator i = selection->time.begin(); i != selection->time.end(); ++i) {
crop_region_to ((*i).start(), (*i).end());
}
commit_reversible_command();
} else {
timepos_t start;
timepos_t end;
if (get_edit_op_range (start, end)) {
begin_reversible_command (_("Crop Regions to Edit Range"));
crop_region_to (start, end);
commit_reversible_command();
}
}
}
void