From 7c3a57673be5526d1b748f5838c39f01c91e49b2 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Fri, 5 Dec 2003 02:42:41 +0000 Subject: [PATCH] Tiny clean-ups. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8196 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 7 +++++++ src/frontends/xforms/FormVSpace.C | 8 ++------ src/frontends/xforms/xforms_helpers.C | 6 +++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index bce43e9b73..0ced2c897b 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,10 @@ +2003-12-05 Angus Leeming + + * FormVSpace.C (apply): remove unnecessary test on form(). + (input): correct spelling. + + * xforms_helpers.C (updateWidgetsFromLengthString): add some asserts. + 2003-12-04 Angus Leeming * checkwidgets.[Ch]: add 'xforms/' to the file header so that diff --git a/src/frontends/xforms/FormVSpace.C b/src/frontends/xforms/FormVSpace.C index 20413130e6..09777af5fe 100644 --- a/src/frontends/xforms/FormVSpace.C +++ b/src/frontends/xforms/FormVSpace.C @@ -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; diff --git a/src/frontends/xforms/xforms_helpers.C b/src/frontends/xforms/xforms_helpers.C index 5483ea810e..597e9938d2 100644 --- a/src/frontends/xforms/xforms_helpers.C +++ b/src/frontends/xforms/xforms_helpers.C @@ -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, ""); -- 2.39.5