Fixed bug that disabled permanently addition of new converters using the

Preferences dialog.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2104 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2001-06-12 11:32:34 +00:00
parent 4f816fd13b
commit 3171db33d2
4 changed files with 20 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2001-06-12 Angus Leeming <a.leeming@ic.ac.uk>
* converter.h (Get): changed argument type from int to
FormatList::size_type to avoid unnecessary conversion.
2001-06-07 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* gettext.h: include LString.h even when --disable-nls is on.

View File

@ -89,7 +89,7 @@ public:
///
typedef FormatList::const_iterator const_iterator;
///
Format const & Get(int i) const {
Format const & Get(FormatList::size_type i) const {
return formatlist[i];
}
///

View File

@ -1,3 +1,9 @@
2001-06-12 Angus Leeming <a.leeming@ic.ac.uk>
* FormPreferences.C white-space change in various places.
(Converters::GetTo): get the contents of "to" not "from"! Thus fix bug
that disabled addition of new converters.
2001-06-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
* FormToc.C (input): change test slightly.

View File

@ -31,8 +31,8 @@
#include "form_preferences.h"
#include "input_validators.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "language.h"
#include "lyxfunc.h"
#include "Dialogs.h"
#include "lyxrc.h"
#include "combox.h"
@ -1086,8 +1086,7 @@ bool FormPreferences::Converters::Browser()
fl_set_input(dialog_->input_flags, c.flags.c_str());
fl_set_object_label(dialog_->button_add, idex(_("Modify|#M")));
fl_set_button_shortcut(dialog_->button_add,
scex(_("Modify|#M")), 1);
fl_set_button_shortcut(dialog_->button_add, scex(_("Modify|#M")), 1);
setEnabled(dialog_->button_add, false);
setEnabled(dialog_->button_delete, true);
@ -1117,17 +1116,15 @@ bool FormPreferences::Converters::Input()
fl_freeze_form(dialog_->form);
if (sel < 0) {
fl_set_object_label(dialog_->button_add,
idex(_("Add|#A")));
fl_set_button_shortcut(dialog_->button_add,
scex(_("Add|#A")), 1);
fl_set_object_label(dialog_->button_add, idex(_("Add|#A")));
fl_set_button_shortcut(dialog_->button_add,
scex(_("Add|#A")), 1);
fl_deselect_browser(dialog_->browser_all);
setEnabled(dialog_->button_delete, false);
} else {
fl_set_object_label(dialog_->button_add,
idex(_("Modify|#M")));
fl_set_object_label(dialog_->button_add, idex(_("Modify|#M")));
fl_set_button_shortcut(dialog_->button_add,
scex(_("Modify|#M")), 1);
@ -1137,7 +1134,7 @@ bool FormPreferences::Converters::Input()
setEnabled(dialog_->button_delete, true);
}
string const command = fl_get_input(dialog_->input_converter);
string const command = strip(fl_get_input(dialog_->input_converter));
bool const enable = !(command.empty() || from == to);
setEnabled(dialog_->button_add, enable);
@ -1164,7 +1161,7 @@ string const FormPreferences::Converters::GetFrom() const
string const FormPreferences::Converters::GetTo() const
{
::Formats::FormatList::size_type const i =
fl_get_choice(dialog_->choice_from);
fl_get_choice(dialog_->choice_to);
if (i > 0 && i <= local_formats.size())
return local_formats.Get(i-1).name();