+2001-01-25 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * FormPreferences.C (GetFrom): fix crash when there is no format
+ defined.
+ (GetTo): ditto.
+
2001-01-23 Angus Leeming <a.leeming@ic.ac.uk>
* FormPreferences.C (LoadBrowserLyX): convert unsigned short to
string const FormPreferences::Converters::GetFrom() const
{
int const i = fl_get_choice(dialog_->choice_from);
- if (i > 0)
+ if (i > 0 && i <= local_formats.size())
return local_formats.Get(i-1).name();
else {
lyxerr << "FormPreferences::Converters::GetFrom: No choice!"
string const FormPreferences::Converters::GetTo() const
{
int const i = fl_get_choice(dialog_->choice_to);
- if (i > 0)
+ if (i > 0 && i <= local_formats.size())
return local_formats.Get(i-1).name();
else {
lyxerr << "FormPreferences::Converters::GetTo: No choice!"