Commit c26c8eec authored by gbazin's avatar gbazin
Browse files

* modules/gui/wxwindows/preferences*: beware, casts from strings to char * are allocated on the stack.
parent 414b3c3b
......@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.36 2003/10/19 22:41:18 sigmunau Exp $
* $Id: preferences.cpp,v 1.37 2003/10/20 00:09:27 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -927,8 +927,8 @@ void PrefsPanel::ApplyChanges()
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE:
config_PutPsz( p_intf, config_data->option_name.mb_str(), (char *)
config_data->control->GetPszValue() );
config_PutPsz( p_intf, config_data->option_name.mb_str(),
config_data->control->GetPszValue().mb_str() );
break;
case CONFIG_ITEM_INTEGER:
case CONFIG_ITEM_KEY:
......
......@@ -2,7 +2,7 @@
* preferences_widgets.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: preferences_widgets.cpp,v 1.2 2003/10/19 23:38:09 gbazin Exp $
* $Id: preferences_widgets.cpp,v 1.3 2003/10/20 00:09:27 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
......@@ -69,9 +69,9 @@ float ConfigControl::GetFloatValue()
return f_value;
}
const char *ConfigControl::GetPszValue()
wxString ConfigControl::GetPszValue()
{
return psz_value;
return wxString(psz_value ? wxU(psz_value) : wxT(""));
}
/*****************************************************************************
......@@ -184,9 +184,9 @@ ModuleConfigControl::~ModuleConfigControl()
;
}
const char *ModuleConfigControl::GetPszValue()
wxString ModuleConfigControl::GetPszValue()
{
return combo->GetStringSelection().mb_str();
return combo->GetStringSelection();
}
/*****************************************************************************
......@@ -214,9 +214,9 @@ StringConfigControl::~StringConfigControl()
;
}
const char *StringConfigControl::GetPszValue()
wxString StringConfigControl::GetPszValue()
{
return textctrl->GetValue().mb_str();
return textctrl->GetValue();
}
/*****************************************************************************
......@@ -255,9 +255,9 @@ StringListConfigControl::~StringListConfigControl()
;
}
const char *StringListConfigControl::GetPszValue()
wxString StringListConfigControl::GetPszValue()
{
return combo->GetStringSelection().mb_str();
return combo->GetStringSelection();
}
/*****************************************************************************
......@@ -317,9 +317,9 @@ FileConfigControl::~FileConfigControl()
;
}
const char *FileConfigControl::GetPszValue()
wxString FileConfigControl::GetPszValue()
{
return textctrl->GetValue().mb_str();
return textctrl->GetValue();
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* preferences_widgets.h : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2003 VideoLAN
* $Id: preferences_widgets.h,v 1.1 2003/10/19 22:41:18 sigmunau Exp $
* $Id: preferences_widgets.h,v 1.2 2003/10/20 00:09:27 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -29,7 +29,7 @@ public:
wxSizer *Sizer();
virtual int GetIntValue();
virtual float GetFloatValue();
virtual const char * GetPszValue();
virtual wxString GetPszValue();
protected:
wxBoxSizer *sizer;
wxStaticText *label;
......@@ -58,7 +58,7 @@ public:
ModuleConfigControl( intf_thread_t *p_intf, module_config_t *p_item,
wxWindow *parent );
~ModuleConfigControl();
virtual const char *GetPszValue();
virtual wxString GetPszValue();
private:
wxComboBox *combo;
};
......@@ -68,7 +68,7 @@ class StringConfigControl: public ConfigControl
public:
StringConfigControl( module_config_t *p_item, wxWindow *parent );
~StringConfigControl();
virtual const char *GetPszValue();
virtual wxString GetPszValue();
private:
wxTextCtrl *textctrl;
};
......@@ -78,7 +78,7 @@ class StringListConfigControl: public ConfigControl
public:
StringListConfigControl( module_config_t *p_item, wxWindow *parent );
~StringListConfigControl();
virtual const char *GetPszValue();
virtual wxString GetPszValue();
private:
wxComboBox *combo;
};
......@@ -89,7 +89,7 @@ public:
FileConfigControl( module_config_t *p_item, wxWindow *parent );
~FileConfigControl();
void FileConfigControl::OnBrowse( wxCommandEvent& );
virtual const char *GetPszValue();
virtual wxString GetPszValue();
private:
DECLARE_EVENT_TABLE()
wxTextCtrl *textctrl;
......
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