mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-13 20:09:59 +00:00
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
This commit is contained in:
parent
2c5ab94d01
commit
6189f7ef55
@ -1,3 +1,7 @@
|
||||
2001-07-18 Juergen Vigna <jug@sad.it>
|
||||
|
||||
* tabular.C (GetCellNumber): put an assert here instead of the check!
|
||||
|
||||
2001-07-17 Juergen Vigna <jug@sad.it>
|
||||
|
||||
* BufferView_pimpl.C (toggleSelection): adapted too.
|
||||
|
@ -1,3 +1,8 @@
|
||||
2001-07-18 Juergen Vigna <jug@sad.it>
|
||||
|
||||
* insettabular.C (selectNextWord): fixed spellchecking for the
|
||||
first cell of a tabular (wasn't entered!)
|
||||
|
||||
2001-07-17 Juergen Vigna <jug@sad.it>
|
||||
|
||||
* various files: implemented the below functions.
|
||||
|
@ -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<InsetTabular *>(this));
|
||||
return string();
|
||||
if (tabular->IsLastCell(actcell)) {
|
||||
bv->unlockInset(const_cast<InsetTabular *>(this));
|
||||
return string();
|
||||
}
|
||||
++actcell;
|
||||
}
|
||||
|
||||
// otherwise we have to lock the next inset and ask for it's selecttion
|
||||
UpdatableInset * inset =
|
||||
static_cast<UpdatableInset*>(tabular->GetCellInset(++actcell));
|
||||
static_cast<UpdatableInset*>(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<InsetTabular *>(this));
|
||||
return string();
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user