]> git.lyx.org Git - features.git/commitdiff
Force latin-only InsetCollapsables into LTR environment if surroundings are RTL.
authorDov Feldstern <dov@lyx.org>
Sat, 3 Nov 2007 18:12:52 +0000 (18:12 +0000)
committerDov Feldstern <dov@lyx.org>
Sat, 3 Nov 2007 18:12:52 +0000 (18:12 +0000)
This fixes, for example, the URL inset, which used to be  included here
explicitly when it was a standalone inset.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21407 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp
src/insets/InsetCollapsable.h

index 05151cd08639b870563fe986c67aa295fd0245fb..675a85edb5112f6c73aa57cfa5776fcb5c349957 100644 (file)
@@ -725,7 +725,11 @@ void Paragraph::Private::latexInset(Buffer const & buf,
 
        if ((inset->lyxCode() == GRAPHICS_CODE
             || inset->lyxCode() == MATH_CODE
-            || inset->lyxCode() == HYPERLINK_CODE)
+            || inset->lyxCode() == HYPERLINK_CODE
+                || (inset->asInsetCollapsable()
+                        && inset->asInsetCollapsable()->forceLTR()
+                        // 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{}";
index dbc88341d6f194943404f71903f2fe38e9b2f6ed..c8733ff48f708258c2bc188040cc96945d35c696 100644 (file)
@@ -147,6 +147,8 @@ public:
        virtual bool isFreeSpacing() const { return layout_->freespacing; }
        /// Don't eliminate empty paragraphs
        virtual bool allowEmpty() const { return layout_->keepempty; }
+       /// Force inset into LTR environment if surroundings are RTL
+       virtual bool forceLTR() const { return layout_->forceltr; }
 
 protected:
        ///