Jean-Marc Lasgouttes wrote:

> Le 18/10/15 17:01, Georg Baum a écrit :
>> What is wrong with the new alignment handling? It is IMHO confusing and
>> not needed, we have paragraph alignment. Look at the attached example: I
>> set the box alignment to centered, and the paragraph alignment to right.
>> This will produce \centered \begin{flushright} which does not really make
>> sense. I think we should try to be consistent and not offer different
>> ways to do the same thing unless there is a very clear advantage (which I
>> do not see in this case). Has this change been discussed on the list? If
>> yes, then I missed it.
> 
> I'd like to hear about reasons for this feature, but s you describe it,
> I think it should be removed.

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 
paragarph 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.

>> I do therefore vote for removing the new aligment handling again. I have
>> no strong optinion whether we should prefer option 2) or 3). Basically we
>> need to decide which is more important: Old documents imported into 2.2
>> during the last 5 months, or new documents created during the last 5
>> months? I slightly tend towards 2), also because it is less work.
> 
> How much less work is it?

2) can be implemented by applying the attached patch. 3) would need the 
attached patch + the one from the last mail + lyx2lyx code to convert the 
alignment options to ERT (I think anything else than ERT would be far too 
much work). If I would do it, it would take me probably a few hours (but 
honestly I currently have zero motivation for doing it, since the next new 
feature that needs to be cleaned up was committed).


Georg
diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp
index 21d7feb..bfa188e 100644
--- a/src/insets/InsetBox.cpp
+++ b/src/insets/InsetBox.cpp
@@ -508,23 +508,6 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
 		os << "\\begin{shaded}%\n";
 	}
 
-	// \framebox and \makebox handle hor_pos their own way
-	// hor_pos is senseless for \mbox and \fbox
-	if (!params_.use_makebox
-		&& !(btype == Boxed && !params_.inner_box)) {
-			switch (params_.hor_pos) {
-			case 'l':
-				// do nothing because this is LaTeX's default
-				break;
-			case 'c':
-				os << "\\centering ";
-				break;
-			case 'r':
-				os << "\\raggedleft ";
-				break;
-			}
-	}
-
 	InsetText::latex(os, runparams);
 
 	if (btype == Shaded)

Reply via email to