#include <config.h>
#include "lyxrow_funcs.h"
+#include "debug.h"
+#include "lyxlayout.h"
+#include "lyxrow.h"
#include "lyxtext.h"
#include "paragraph.h"
-#include "lyxlayout.h"
-#include "debug.h"
-
-#include "support/LAssert.h"
#include <boost/next_prior.hpp>
-#include <algorithm>
using lyx::pos_type;
-using lyx::support::Assert;
using std::max;
using std::min;
lyxerr << "broken row 1: end: " << rit->end() << " next: "
<< boost::next(rit)->pos() << endl;
lyxerr << endl;
- Assert(false);
+ BOOST_ASSERT(false);
}
#endif
return boost::next(rit) == par.rows.end();
}
-
+#if 1
pos_type lastPos(Paragraph const & par, RowList::iterator rit)
{
if (par.empty())
lyxerr << "broken row 2: end: " << rit->end() << " next: "
<< boost::next(rit)->pos() << endl;
lyxerr << endl;
- Assert(false);
+ BOOST_ASSERT(false);
}
return boost::next(rit)->pos() - 1;
}
-
-
-namespace {
-
-bool nextRowIsAllInset(Paragraph const & par, pos_type last)
+#else
+pos_type lastPos(Paragraph const &, RowList::iterator rit)
{
- if (last + 1 >= par.size())
- return false;
-
- if (!par.isInset(last + 1))
- return false;
-
- InsetOld const * i = par.getInset(last + 1);
- return i->needFullRow() || i->display();
-}
-
-} // anon namespace
-
-
-pos_type lastPrintablePos(Paragraph const & par, RowList::iterator rit)
-{
- pos_type const last = lastPos(par, rit);
-
- // if this row is an end of par, just act like lastPos()
- if (isParEnd(par, rit))
- return last;
-
- if (!nextRowIsAllInset(par, last) && par.isSeparator(last))
- return last - 1;
-
- return last;
+ return rit->end() - 1;
}
+#endif
int numberOfSeparators(Paragraph const & par, RowList::iterator rit)
{
- pos_type const last = lastPrintablePos(par, rit);
+ pos_type const last = lastPos(par, rit);
int n = 0;
pos_type p = max(rit->pos(), par.beginningOfBody());
for ( ; p < last; ++p)