From: Jürgen Vigna Date: Wed, 18 Jul 2001 08:38:14 +0000 (+0000) Subject: Small fix for spellchecking in tabulars. Removed a check and put an assert X-Git-Tag: 1.6.10~21060 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6189f7ef559d7c63b155553cf243263f487fb728;p=features.git Small fix for spellchecking in tabulars. Removed a check and put an assert in LyXTabular::GetCellNumber. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2266 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index f88ed69891..5a8c35dbcf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-07-18 Juergen Vigna + + * tabular.C (GetCellNumber): put an assert here instead of the check! + 2001-07-17 Juergen Vigna * BufferView_pimpl.C (toggleSelection): adapted too. diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index de2e6acc3d..215c426f52 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2001-07-18 Juergen Vigna + + * insettabular.C (selectNextWord): fixed spellchecking for the + first cell of a tabular (wasn't entered!) + 2001-07-17 Juergen Vigna * various files: implemented the below functions. diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index f02b5e0556..a1fbaf152c 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -2443,15 +2443,16 @@ string InsetTabular::selectNextWord(BufferView * bv, float & value) const str = the_locking_inset->selectNextWord(bv, value); if (!str.empty()) return str; - } - if (tabular->IsLastCell(actcell)) { - bv->unlockInset(const_cast(this)); - return string(); + if (tabular->IsLastCell(actcell)) { + bv->unlockInset(const_cast(this)); + return string(); + } + ++actcell; } // otherwise we have to lock the next inset and ask for it's selecttion UpdatableInset * inset = - static_cast(tabular->GetCellInset(++actcell)); + static_cast(tabular->GetCellInset(actcell)); inset->edit(bv, 0, 0, 0); string str = selectNextWordInt(bv, value); if (!str.empty()) @@ -2461,12 +2462,14 @@ string InsetTabular::selectNextWord(BufferView * bv, float & value) const string InsetTabular::selectNextWordInt(BufferView * bv, float & value) const { - if (the_locking_inset) { - string str; - str = the_locking_inset->selectNextWord(bv, value); - if (!str.empty()) - return str; - } + // when entering this function the inset should be ALWAYS locked! + lyx::Assert(the_locking_inset); + + string str; + str = the_locking_inset->selectNextWord(bv, value); + if (!str.empty()) + return str; + if (tabular->IsLastCell(actcell)) { bv->unlockInset(const_cast(this)); return string(); diff --git a/src/tabular.C b/src/tabular.C index ce9179602b..2202e3367b 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -1534,7 +1534,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl) for (int i = 0; i < par->size(); ++i) { if (par->isNewline(i)) { ++cell; - if (cell > GetNumberOfCells()) { + if (cell > numberofcells) { lyxerr << "Some error in reading old table format occured!" << endl << "Terminating when reading cell[" << cell << "]!" << endl; @@ -1686,7 +1686,7 @@ bool LyXTabular::NeedRotating() const bool LyXTabular::IsLastCell(int cell) const { - if ((cell + 1) < GetNumberOfCells()) + if ((cell + 1) < numberofcells) return false; return true; } @@ -1730,7 +1730,7 @@ int LyXTabular::GetLastCellBelow(int cell) const int LyXTabular::GetCellNumber(int row, int column) const { -#if 1 +#if 0 if (column >= columns_) column = columns_ - 1; else if (column < 0) @@ -1740,7 +1740,7 @@ int LyXTabular::GetCellNumber(int row, int column) const else if (row < 0) row = 0; #else - lyx::Assert(column < 0 || column >= columns_ || row < 0 || row >= rows_); + lyx::Assert(column >= 0 || column < columns_ || row >= 0 || row < rows_); #endif return cell_info[row][column].cellno; }