Le 19/10/2015 21:46, Georg Baum a écrit :
I found another reason for removal: The display in LyX does only consider the paragraph alignment, so if you set that to left (which means that the paragraph does not output any alignment command), and set it so something else than left in the box, the display in LyX will be wrong. Fixing this would probably result in ugly, hard to maintain code.
Actually fixing this for LR boxes (so-called makebox in the code) is not difficult because we have the framework for table cells already. I propose to put that in master. Would it be OK?
JMarc
>From c3d39f5ef0247d447446a81684b3090eccf591c8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Fri, 23 Oct 2015 11:16:21 +0200 Subject: [PATCH] Implement on screen rendering of alignment in LR boxes. --- src/insets/InsetBox.cpp | 24 ++++++++++++++++++++++++ src/insets/InsetBox.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index 21d7feb..02a998e 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -223,6 +223,30 @@ ColorCode InsetBox::backgroundColor(PainterInfo const &) const } +LyXAlignment InsetBox::contentAlignment() const +{ + if (!params_.use_makebox) + return LYX_ALIGN_NONE; + + LyXAlignment align = LYX_ALIGN_NONE; + switch (params_.hor_pos) { + case 'l': + align = LYX_ALIGN_LEFT; + break; + case 'c': + align = LYX_ALIGN_CENTER; + break; + case 'r': + align = LYX_ALIGN_RIGHT; + break; + case 's': + // we do cannot show 'stretch' wysiwym yet + break; + } + return align; +} + + void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd) { switch (cmd.action()) { diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h index 877dd60..151d622 100644 --- a/src/insets/InsetBox.h +++ b/src/insets/InsetBox.h @@ -115,6 +115,8 @@ public: /// ColorCode backgroundColor(PainterInfo const &) const; /// + LyXAlignment contentAlignment() const; + /// bool allowParagraphCustomization(idx_type = 0) const { return !forcePlainLayout(); } /// bool allowMultiPar() const; -- 1.7.9.5