From 21b0a4ab9b3694c223adfae8c943de651a94f81f Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 17 Dec 2006 10:11:28 +0000 Subject: [PATCH] Fix for bug 3027 by Martin V. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16309 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/paragraph.C | 5 ++++- src/paragraph.h | 2 +- src/rowpainter.C | 8 ++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/paragraph.C b/src/paragraph.C index b030b7ff8f..9aab8c122d 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -601,7 +601,10 @@ depth_type Paragraph::getMaxDepthAfter() const char Paragraph::getAlign() const { - return params().align(); + if (params().align() == LYX_ALIGN_LAYOUT) + return layout()->align; + else + return params().align(); } diff --git a/src/paragraph.h b/src/paragraph.h index 7bf747527b..951a9d537d 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -241,7 +241,7 @@ public: 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; diff --git a/src/rowpainter.C b/src/rowpainter.C index 5b83338af9..eee68028b4 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -893,6 +893,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 // @@ -905,7 +908,7 @@ void paintPar if (in) { InsetText * t = const_cast(in->asTextInset()); if (t) - t->setWide(in_inset_alone_on_row); + t->setWide(in_inset_alone_on_row && leftEdgeFixed); } } @@ -924,7 +927,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()); -- 2.39.2