diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index b4a9e1d75d..59518a055a 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2001-12-29 Dekel Tsur + + * FormMathsMatrix.C (AlignFilter): Allow entering the '|' char. + 2001-12-19 Jean-Marc Lasgouttes * DropDown.C: always include in sources. diff --git a/src/frontends/xforms/FormMathsMatrix.C b/src/frontends/xforms/FormMathsMatrix.C index 23a166d41c..d8a1b6addf 100644 --- a/src/frontends/xforms/FormMathsMatrix.C +++ b/src/frontends/xforms/FormMathsMatrix.C @@ -15,6 +15,8 @@ #pragma implementation #endif +#include + #include "FormMathsMatrix.h" #include "form_maths_matrix.h" #include "Dialogs.h" @@ -116,12 +118,13 @@ bool FormMathsMatrix::input(FL_OBJECT * ob, long) int FormMathsMatrix::AlignFilter(char const * cur, int c) { + size_t len = strlen(cur); int const n = int(fl_get_slider_value(dialog_->slider_columns) + 0.5) - - int(strlen(cur)); + int(len) + std::count(cur, cur+len, '|'); if (n < 0) return FL_INVALID; - if (c == 'c' || c == 'l' || c == 'r') + if (c == 'c' || c == 'l' || c == 'r' || c == '|') return FL_VALID; return FL_INVALID;