>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
>>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: Martin> Didn't JM want this in 1.4 too? Jean-Marc> That would be this. I am going to apply soon. I meant *this*. Applying now. JMarc
Index: src/paragraph.h =================================================================== --- src/paragraph.h (revision 16320) +++ src/paragraph.h (working copy) @@ -262,7 +262,7 @@ public: std::string const getLabelWidthString() const; /// void setLabelWidthString(std::string const & s); - /// + /// Actual paragraph alignment used char getAlign() const; /// The nesting depth of a paragraph depth_type getDepth() const; Index: src/ChangeLog =================================================================== --- src/ChangeLog (revision 16320) +++ src/ChangeLog (working copy) @@ -1,3 +1,11 @@ +2006-12-18 Martin Vermeer <[EMAIL PROTECTED]> + + * rowpainter.C (paintPar): do not use wide insets when the + paragraph is centered or right-justified. + + * paragraph.C (getAlign): take in account LYX_ALIGN_LAYOUT if + needed. + 2006-12-10 Enrico Forestieri <[EMAIL PROTECTED]> * text3.C (cursorPrevious): use cur.dispatch(FuncRequest(LFUN_UP)) Index: src/rowpainter.C =================================================================== --- src/rowpainter.C (revision 16320) +++ src/rowpainter.C (working copy) @@ -809,6 +809,9 @@ void paintPar bool cursor_on_row = CursorOnRow(pi, pit, rit, text); bool in_inset_alone_on_row = innerCursorOnRow(pi, pit, rit, text); + bool leftEdgeFixed = + (par.getAlign() == LYX_ALIGN_LEFT || + par.getAlign() == LYX_ALIGN_BLOCK); // If this is the only object on the row, we can make it wide for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) { @@ -816,7 +819,8 @@ void paintPar if (in) { InsetText const * const t = in->asTextInset(); if (t) - t->Wide() = in_inset_alone_on_row; + t->Wide() = in_inset_alone_on_row + && leftEdgeFixed; } } @@ -833,7 +837,8 @@ void paintPar // Clear background of this row // (if paragraph background was not cleared) if (!repaintAll && - (!in_inset_alone_on_row || row_has_changed)) { + (!(in_inset_alone_on_row && leftEdgeFixed) + || row_has_changed)) { pi.pain.fillRectangle(x, y - rit->ascent(), text.maxwidth_, rit->height(), text.backgroundColor()); Index: src/paragraph.C =================================================================== --- src/paragraph.C (revision 16320) +++ src/paragraph.C (working copy) @@ -594,7 +594,10 @@ Paragraph::depth_type Paragraph::getMaxD char Paragraph::getAlign() const { - return params().align(); + if (params().align() == LYX_ALIGN_LAYOUT) + return layout()->align; + else + return params().align(); }