Commit 8c45a841 authored by Olivier Teulière's avatar Olivier Teulière

* ./modules/gui/win32/preferences.cpp: fixed a segfault when a module

   forgets to declare 'add_category_hint'
 * ./modules/demux/mpeg/ts.c: added a missing 'add_category_hint' :p
parent 9430cc59
......@@ -2,7 +2,7 @@
* mpeg_ts.c : Transport Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: ts.c,v 1.12 2003/01/07 15:12:48 jobi Exp $
* $Id: ts.c,v 1.13 2003/01/08 03:01:55 ipkiss Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr>
......@@ -109,6 +109,7 @@ vlc_module_begin();
set_capability( "demux", 170 );
add_shortcut( "ts_dvbpsi" );
#endif
add_category_hint( N_("Miscellaneous"), NULL );
add_bool( "vls-backwards-compat", 0, NULL,
VLS_BACKWARDS_COMPAT_TEXT, VLS_BACKWARDS_COMPAT_LONGTEXT );
set_callbacks( Activate, Deactivate );
......
......@@ -41,24 +41,24 @@
/****************************************************************************
* A THintWindow with a limited width
****************************************************************************/
void __fastcall TNarrowHintWindow::ActivateHint(const Windows::TRect &Rect,
const System::AnsiString AHint)
void __fastcall TNarrowHintWindow::ActivateHint( const Windows::TRect &Rect,
const System::AnsiString AHint )
{
TRect NarrowRect = CalcHintRect ( 300 , AHint , NULL );
TRect NarrowRect = CalcHintRect( 300, AHint, NULL );
NarrowRect.Left = Rect.Left;
NarrowRect.Top = Rect.Top;
NarrowRect.Right += Rect.Left;
NarrowRect.Bottom += Rect.Top;
THintWindow::ActivateHint ( NarrowRect , AHint );
THintWindow::ActivateHint( NarrowRect, AHint );
}
/****************************************************************************
* Just a wrapper to embed an AnsiString into a TObject
****************************************************************************/
__fastcall TObjectString::TObjectString(char * String)
__fastcall TObjectString::TObjectString( char * String )
{
FString = AnsiString(String);
FString = AnsiString( String );
}
//---------------------------------------------------------------------------
AnsiString __fastcall TObjectString::String()
......@@ -73,9 +73,10 @@ AnsiString __fastcall TObjectString::String()
****************************************************************************/
__fastcall TCleanCheckListBox::~TCleanCheckListBox()
{
for ( int i = 0 ; i < Items->Count ; i++ )
for( int i = 0 ; i < Items->Count ; i++ )
{
if ( Items->Objects[i] != NULL ) delete Items->Objects[i];
if( Items->Objects[i] != NULL )
delete Items->Objects[i];
}
}
......@@ -214,7 +215,7 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner,
ButtonConfig->OnClick = ButtonConfigClick;
/* init label */
AnsiString Text = AnsiString(p_config->psz_text) + ":";
AnsiString Text = AnsiString( p_config->psz_text ) + ":";
Label = CreateLabel( this,
LIBWIN32_PREFSIZE_LEFT,
LIBWIN32_PREFSIZE_RIGHT - LIBWIN32_PREFSIZE_BUTTON_WIDTH
......@@ -233,9 +234,9 @@ __fastcall TPanelPlugin::TPanelPlugin( TComponent* Owner,
CleanCheckListBox = CreateCleanCheckListBox( this,
LIBWIN32_PREFSIZE_EDIT_LEFT,
LIBWIN32_PREFSIZE_EDIT_WIDTH,
max ( Label->Top + Label->Height , ButtonConfig->Top
+ ButtonConfig->Height ) + LIBWIN32_PREFSIZE_VPAD,
LIBWIN32_PREFSIZE_CHECKLISTBOX_HEIGHT );
max( Label->Top + Label->Height , ButtonConfig->Top
+ ButtonConfig->Height ) + LIBWIN32_PREFSIZE_VPAD,
LIBWIN32_PREFSIZE_CHECKLISTBOX_HEIGHT );
CleanCheckListBox->OnClick = CheckListBoxClick;
CleanCheckListBox->OnClickCheck = CheckListBoxClickCheck;
CleanCheckListBox->Hint = p_config->psz_longtext;
......@@ -532,7 +533,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
int i_pages, i_ctrl;
TTabSheet *TabSheet;
TScrollBox *ScrollBox;
TScrollBox *ScrollBox = NULL;
TPanel *Panel;
TPanelPlugin *PanelPlugin;
TPanelString *PanelString;
......@@ -605,21 +606,21 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
{
AnsiString ModuleDesc;
if ( p_parser->psz_longname != NULL ) {
ModuleDesc = AnsiString(p_parser->psz_longname) +
" (" + AnsiString(p_parser->psz_object_name) +
ModuleDesc = AnsiString( p_parser->psz_longname ) +
" (" + AnsiString( p_parser->psz_object_name ) +
")";
}
else
ModuleDesc = AnsiString(p_parser->psz_object_name);
ModuleDesc = AnsiString( p_parser->psz_object_name );
int item = PanelPlugin->CleanCheckListBox->Items->AddObject(
ModuleDesc.c_str(),
new TObjectString(p_parser->psz_object_name) );
new TObjectString( p_parser->psz_object_name ) );
/* check the box if it's the default module */
AnsiString Name = p_item->psz_value ?
p_item->psz_value : "";
if( !strcmp( p_parser->psz_object_name, Name.c_str()) )
if( !strcmp( p_parser->psz_object_name, Name.c_str() ) )
{
PanelPlugin->CleanCheckListBox->Checked[item] = true;
}
......
......@@ -39,8 +39,8 @@
class TCleanCheckListBox : public TCheckListBox
{
public:
__fastcall TCleanCheckListBox(Classes::TComponent* AOwner)
: TCheckListBox( AOwner ) { };
__fastcall TCleanCheckListBox( Classes::TComponent* AOwner )
: TCheckListBox( AOwner ) {};
virtual __fastcall ~TCleanCheckListBox();
};
//---------------------------------------------------------------------------
......@@ -48,8 +48,8 @@ public:
class TNarrowHintWindow : public THintWindow
{
public:
virtual void __fastcall ActivateHint(const Windows::TRect &Rect,
const System::AnsiString AHint);
virtual void __fastcall ActivateHint( const Windows::TRect &Rect,
const System::AnsiString AHint );
};
//---------------------------------------------------------------------------
/* Just a wrapper to embed an AnsiString into a TObject */
......@@ -58,7 +58,7 @@ class TObjectString : public TObject
private:
AnsiString FString;
public:
__fastcall TObjectString(char * String);
__fastcall TObjectString( char * String );
AnsiString __fastcall String();
};
//---------------------------------------------------------------------------
......
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