+2002-04-12 Juergen Vigna <jug@sad.it>
+
+ * text.C (leftMargin): return LYX_PAPER_MARGIN if this row contains
+ an inset which uses the whole row!
+ (rightMargin): ditto.
+ (insertChar): force a rebreak if we inserted an inset!
+
2002-03-28 Herbert Voss <voss@lyx.org>
* lyxlength.[Ch]: add inBP() to get the right PS-point
2002-04-11 Juergen Vigna <jug@sad.it>
* text2.C (setCursorFromCoordinates): set iy to the right value.
+ (setCursor): add check if row->previous exists!
* buffer.C (parseSingleLyXformat2Token): reset font after read of
an old float_type as this was the case in the old code!
// exactly the label-width.
int LyXText::leftMargin(BufferView * bview, Row const * row) const
{
+ Inset * ins;
+ if ((row->par()->getChar(row->pos()) == Paragraph::META_INSET) &&
+ (ins=row->par()->getInset(row->pos())) &&
+ (ins->needFullRow() || ins->display()))
+ return LYX_PAPER_MARGIN;
+
LyXTextClass const & tclass =
textclasslist[bview->buffer()->params.textclass];
LyXLayout const & layout = tclass[row->par()->layout()];
int LyXText::rightMargin(Buffer const * buf, Row const * row) const
{
+ Inset * ins;
+ if ((row->par()->getChar(row->pos()) == Paragraph::META_INSET) &&
+ (ins=row->par()->getInset(row->pos())) &&
+ (ins->needFullRow() || ins->display()))
+ return LYX_PAPER_MARGIN;
+
LyXTextClass const & tclass = textclasslist[buf->params.textclass];
LyXLayout const & layout = tclass[row->par()->layout()];
}
// Is there a break one row above
- if ((cursor.par()->isLineSeparator(cursor.pos())
- || cursor.par()->isNewline(cursor.pos())
- || ((cursor.pos() < cursor.par()->size()) &&
- cursor.par()->isInset(cursor.pos()+1))
- || cursor.row()->fill() == -1)
- && row->previous() && row->previous()->par() == row->par())
+ if (row->previous() && row->previous()->par() == row->par()
+ && (cursor.par()->isLineSeparator(cursor.pos())
+ || cursor.par()->isNewline(cursor.pos())
+ || ((cursor.pos() < cursor.par()->size()) &&
+ cursor.par()->isInset(cursor.pos()+1))
+ || cursor.row()->fill() == -1))
{
pos_type z = nextBreakPoint(bview,
row->previous(),
* will set fill to -1. Otherwise
* we would not get a rebreak! */
row->fill(fill(bview, row, workWidth(bview)));
- if (row->fill() < 0) {
+ if (c == Paragraph::META_INSET || row->fill() < 0) {
refresh_y = y;
refresh_row = row;
refresh_x = cursor.x();
x = (workWidth(bview) > 0)
? rightMargin(bview->buffer(), row) : 0;
} else
- x = (workWidth(bview) > 0) ? leftMargin(bview, row) : 0;
+ x = (workWidth(bview) > 0)
+ ? leftMargin(bview, row) : 0;
// is there a manual margin with a manual label
LyXTextClass const & tclass = textclasslist[bview->buffer()->params.textclass];