On Thu, Dec 14, 2006 at 03:46:43PM +0100, Jean-Marc Lasgouttes wrote: > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > Martin> Attached. Fix along the lines of my bugzilla remark. I am not > Martin> quite sure about the definition of leftEdgeFixed... please > Martin> someone better informed refine this. > > It looks reasonable (and needed also for 1.4 if my testing is > correct). > > Since Paragraph::getAlign is not used currently, it may be a good > occasion to move the logic to use the layout alignment in there, which > would simplify your leftEdgeFixed thingy.
That would be the attached. Tested for trunk. I'll be off to the countryside tomorrow for several days. Feel free to commit for trunk and 1.4 if I don't get around to it. - Martin
Index: paragraph.C
===================================================================
--- paragraph.C (revision 16200)
+++ paragraph.C (working copy)
@@ -599,7 +599,10 @@
char Paragraph::getAlign() const
{
- return params().align();
+ if (params().align() == LYX_ALIGN_LAYOUT)
+ return layout()->align;
+ else
+ return params().align();
}
Index: paragraph.h
===================================================================
--- paragraph.h (revision 16200)
+++ paragraph.h (working copy)
@@ -241,7 +241,7 @@
docstring const getLabelWidthString() const;
///
void setLabelWidthString(docstring const & s);
- ///
+ /// Actual paragraph alignment used
char getAlign() const;
/// The nesting depth of a paragraph
depth_type getDepth() const;
Index: rowpainter.C
===================================================================
--- rowpainter.C (revision 16200)
+++ rowpainter.C (working copy)
@@ -893,6 +893,9 @@
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
//
@@ -905,7 +908,7 @@
if (in) {
InsetText * t = const_cast<InsetText
*>(in->asTextInset());
if (t)
- t->setWide(in_inset_alone_on_row);
+ t->setWide(in_inset_alone_on_row &&
leftEdgeFixed);
}
}
@@ -924,7 +927,8 @@
// 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());
pgp8pklRWQnGe.pgp
Description: PGP signature
