mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-27 17:48:38 +02:00
Bug 1512 - Extended Import: Crash dragging an importer when there are no rules
This commit is contained in:
parent
ce09f4b883
commit
0f5260e600
@ -218,7 +218,9 @@ void ExtImportPrefs::SwapPluginRows (int row1, int row2)
|
|||||||
ImportPlugin *ip1, *ip2;
|
ImportPlugin *ip1, *ip2;
|
||||||
|
|
||||||
auto &items = Importer::Get().GetImportItems();
|
auto &items = Importer::Get().GetImportItems();
|
||||||
ExtImportItem *item = items[last_selected].get();
|
ExtImportItem *item = NULL;
|
||||||
|
if( last_selected >= 0 )
|
||||||
|
item = items[last_selected].get();
|
||||||
|
|
||||||
t = PluginList->GetItemText (row1);
|
t = PluginList->GetItemText (row1);
|
||||||
d = PluginList->GetItemData (row1);
|
d = PluginList->GetItemData (row1);
|
||||||
@ -229,6 +231,8 @@ void ExtImportPrefs::SwapPluginRows (int row1, int row2)
|
|||||||
{
|
{
|
||||||
PluginList->SetItemData (row1, PluginList->GetItemData (row2));
|
PluginList->SetItemData (row1, PluginList->GetItemData (row2));
|
||||||
PluginList->SetItemData (row2, d);
|
PluginList->SetItemData (row2, d);
|
||||||
|
if( !item )
|
||||||
|
return;
|
||||||
if (d == -1)
|
if (d == -1)
|
||||||
{
|
{
|
||||||
item->divider = row2;
|
item->divider = row2;
|
||||||
@ -240,6 +244,8 @@ void ExtImportPrefs::SwapPluginRows (int row1, int row2)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if( !item )
|
||||||
|
return;
|
||||||
ip1 = item->filter_objects[d];
|
ip1 = item->filter_objects[d];
|
||||||
ip2 = item->filter_objects[d2];
|
ip2 = item->filter_objects[d2];
|
||||||
item->filter_objects[d] = ip2;
|
item->filter_objects[d] = ip2;
|
||||||
@ -332,6 +338,8 @@ void ExtImportPrefs::OnPluginBeginDrag(wxListEvent& WXUNUSED(event))
|
|||||||
dragtext2->SetText(wxT(""));
|
dragtext2->SetText(wxT(""));
|
||||||
dragSource.SetData(*dragtext2);
|
dragSource.SetData(*dragtext2);
|
||||||
mDragFocus = PluginList;
|
mDragFocus = PluginList;
|
||||||
|
if( mDragFocus == NULL )
|
||||||
|
return;
|
||||||
wxDragResult result = dragSource.DoDragDrop(wxDrag_DefaultMove);
|
wxDragResult result = dragSource.DoDragDrop(wxDrag_DefaultMove);
|
||||||
mDragFocus = NULL;
|
mDragFocus = NULL;
|
||||||
switch (result)
|
switch (result)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user