Tiny clean-ups.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8196 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-12-05 02:42:41 +00:00
parent 8c374dcefb
commit 7c3a57673b
3 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2003-12-05 Angus Leeming <leeming@lyx.org>
* FormVSpace.C (apply): remove unnecessary test on form().
(input): correct spelling.
* xforms_helpers.C (updateWidgetsFromLengthString): add some asserts.
2003-12-04 Angus Leeming <leeming@lyx.org>
* checkwidgets.[Ch]: add 'xforms/' to the file header so that

View File

@ -226,10 +226,6 @@ void FormVSpace::build()
void FormVSpace::apply()
{
if (!form())
return;
// spacing
// If a vspace choice is "Length" but there's no text in
// the input field, insert nothing.
validateVSpaceWidgets(dialog_->choice_space, dialog_->input_space);
@ -261,8 +257,8 @@ void FormVSpace::update()
ButtonPolicy::SMInput FormVSpace::input(FL_OBJECT * ob, long)
{
// Enable input when custum length is choosen,
// disable 'keep' when no space is choosen
// Enable input when custom length is chosen,
// disable 'keep' when no space is chosen
if (ob == dialog_->choice_space) {
bool const custom_length =
fl_get_choice(dialog_->choice_space) == 6;

View File

@ -178,6 +178,10 @@ void updateWidgetsFromLengthString(FL_OBJECT * input, FL_OBJECT * choice,
string const & str,
string const & default_unit)
{
// Paranoia check
BOOST_ASSERT(input && input->objclass == FL_INPUT &&
choice && choice->objclass == FL_CHOICE);
// use input field only for gluelengths
if (!isValidLength(str) && !isStrDbl(str)) {
fl_set_input(input, str.c_str());
@ -198,7 +202,7 @@ void updateWidgetsFromLength(FL_OBJECT * input, FL_OBJECT * choice,
{
// Paranoia check
BOOST_ASSERT(input && input->objclass == FL_INPUT &&
choice && choice->objclass == FL_CHOICE);
choice && choice->objclass == FL_CHOICE);
if (len.empty()) {
fl_set_input(input, "");