From 3bb41590f217c48587a2581693f9ac48b9d2adf5 Mon Sep 17 00:00:00 2001 From: Dekel Tsur Date: Sat, 29 Dec 2001 17:20:57 +0000 Subject: [PATCH] Allow entering the '|' char. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3274 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 4 ++++ src/frontends/xforms/FormMathsMatrix.C | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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;