Commit 72fb9033 authored by Boris Dorès's avatar Boris Dorès

- added a NULL pointer test

- cosmetic changes
parent e56eff61
...@@ -268,6 +268,11 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner, ...@@ -268,6 +268,11 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner,
ButtonDown->Hint = "Decrease the plugin priority"; ButtonDown->Hint = "Decrease the plugin priority";
ButtonDown->ShowHint = true; ButtonDown->ShowHint = true;
} }
else
{
ButtonUp = NULL;
ButtonDown = NULL;
}
/* panel height */ /* panel height */
Height = CleanCheckListBox->Top + CleanCheckListBox->Height Height = CleanCheckListBox->Top + CleanCheckListBox->Height
...@@ -284,8 +289,8 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender ) ...@@ -284,8 +289,8 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
* started on an item */ * started on an item */
if( CleanCheckListBox->ItemIndex == -1 ) if( CleanCheckListBox->ItemIndex == -1 )
{ {
ButtonUp->Enabled = false; if ( ButtonUp != NULL ) ButtonUp->Enabled = false;
ButtonDown->Enabled = false; if ( ButtonDown != NULL ) ButtonDown->Enabled = false;
return; return;
} }
...@@ -295,9 +300,7 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender ) ...@@ -295,9 +300,7 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
return; return;
/* enable up and down buttons */ /* enable up and down buttons */
if ( b_multi_plugins ) if ( b_multi_plugins && ButtonUp != NULL && ButtonDown != NULL )
{
if ( CleanCheckListBox->ItemIndex != -1 )
{ {
if ( CleanCheckListBox->ItemIndex == 0 ) if ( CleanCheckListBox->ItemIndex == 0 )
ButtonUp->Enabled = false; else ButtonUp->Enabled = true; ButtonUp->Enabled = false; else ButtonUp->Enabled = true;
...@@ -305,7 +308,6 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender ) ...@@ -305,7 +308,6 @@ void __fastcall TPanelPlugin::CheckListBoxClick( TObject *Sender )
== CleanCheckListBox->Items->Count - 1 ) == CleanCheckListBox->Items->Count - 1 )
ButtonDown->Enabled = false; else ButtonDown->Enabled = true; ButtonDown->Enabled = false; else ButtonDown->Enabled = true;
} }
}
/* look for module 'Name' */ /* look for module 'Name' */
list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment