On Wed, Oct 31, 2007 at 01:03:16AM +0200, Dov Feldstern wrote:
> Hi!
> 
> Martin --- thanks for all your work towards the ForceLTR option!
> 
> The attached patch uses this option in order to make sure that insets 
> which define this option are put in an LTR environment if they are in 
> RTL surroundings (which is why I originally asked for this option).
> 
> To this end, I also define two new functions:
> 
> 1) An accessor method InsetCollapsable::ForceLTR
> 2) The virtual Inset::asCollapsableInset for identifying insets which 
> are (or inherit from) Collapsable. (Similar to asTextInset, asMathInset).
> 
> Please look this over, I will commit in the next few days if there are 
> no objections.
> 
> Dov

> diff -r 14ceb06dbd35 src/Paragraph.cpp
> --- a/src/Paragraph.cpp       Wed Oct 31 00:15:34 2007 +0200
> +++ b/src/Paragraph.cpp       Wed Oct 31 00:40:23 2007 +0200
> @@ -718,7 +718,11 @@ void Paragraph::Private::latexInset(Buff
>  
>       if ((inset->lyxCode() == GRAPHICS_CODE
>            || inset->lyxCode() == MATH_CODE
> -          || inset->lyxCode() == HYPERLINK_CODE)
> +          || inset->lyxCode() == HYPERLINK_CODE
> +              || (inset->asCollapsableInset()
> +                      && inset->asCollapsableInset()->forceLTR()

Hmmm, I see the ERT calls its own version of resetParagraphsFont().  I
believe it can be removed so it uses the InsetCollapsable one. Saves a
few lines. (I think I planned on doing this, but forgot.)

> +                      // ERT is an exception, since it doesn't go to output
> +                      && inset->lyxCode() != ERT_CODE))
>           && running_font.isRightToLeft()) {
>               if (running_font.language()->lang() == "farsi")
>                       os << "\\beginL{}";

- Martin

Reply via email to