fix last printable pos

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6182 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-02-17 01:53:13 +00:00
parent ced5b14359
commit e3833fbf0a
2 changed files with 11 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2003-02-17 John Levon <levon@movementarian.org>
* lyxrow.C: fix lastPrintablePos()
2003-02-16 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* bufferparams.C (writeLaTeX): add a std:here

View File

@ -147,12 +147,6 @@ namespace {
bool nextRowIsAllInset(Row const & row, pos_type last)
{
if (!row.next())
return false;
if (row.par() != row.next()->par())
return false;
if (!row.par()->isInset(last + 1))
return false;
@ -166,9 +160,14 @@ bool nextRowIsAllInset(Row const & row, pos_type last)
pos_type Row::lastPrintablePos() const
{
pos_type const last = lastPos();
bool const ignore_space_at_last = !nextRowIsAllInset(*this, last);
if (ignore_space_at_last && par()->isSeparator(last))
// if this row is an end of par, just act like lastPos()
if (!next() || par() != next()->par())
return last;
bool const nextrownotinset = !nextRowIsAllInset(*this, last);
if (nextrownotinset && par()->isSeparator(last))
return last - 1;
return last;