]> git.lyx.org Git - lyx.git/commitdiff
Fix for insetERT in RTL docs.
authorDekel Tsur <dekelts@tau.ac.il>
Sun, 5 May 2002 16:33:19 +0000 (16:33 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Sun, 5 May 2002 16:33:19 +0000 (16:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4132 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/paragraph.C
src/text.C

index 36d7bc71f0bced649d6cab6e41af50df0f1edf20..c9ea41585318962a581c609c32fa86c6ba4e2cad 100644 (file)
@@ -1390,7 +1390,10 @@ void BufferView::Pimpl::setState()
                return;
 
        LyXText * text = bv_->getLyXText();
-       if (text->real_current_font.isRightToLeft()) {
+       if (text->real_current_font.isRightToLeft()
+           && !(bv_->theLockingInset()
+                && bv_->theLockingInset()->lyxCode()== Inset::ERT_CODE))
+       {
                if (owner_->getIntl()->keymap == Intl::PRIMARY)
                        owner_->getIntl()->KeyMapSec();
        } else {
index 28bc8713dfe17e25662e23d7c94925e0afa9f6b5..844c87a1cb52a4ab9a5d4a553d3269403b5fa20e 100644 (file)
@@ -1,3 +1,13 @@
+2002-05-05  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * paragraph.C (isRightToLeftPar): Return false for a paragraph
+       inside insetERT.
+
+       * text.C (computeBidiTables): No bidi in insetERT.
+
+       * BufferView_pimpl.C (setState): Fix keymap handling inside insetERT
+       in RTL documents.
+
 2002-05-03  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * version.C.in: pre 5
index 055f0d435982d8b0aa3515d5475e76aa1b3f6e18..09d5a7131e0c08007b12dff53005b13679244a5d 100644 (file)
@@ -1984,7 +1984,9 @@ Paragraph::getParLanguage(BufferParams const & bparams) const
 bool Paragraph::isRightToLeftPar(BufferParams const & bparams) const
 {
        return lyxrc.rtl_support
-               && getParLanguage(bparams)->RightToLeft();
+               && getParLanguage(bparams)->RightToLeft()
+               && !(inInset() && inInset()->owner() &&
+                    inInset()->owner()->lyxCode() == Inset::ERT_CODE);
 }
 
 
index b8078303abdd54b349bcc788de58448375cc5807..17cdc7c930f76cab1205b060846833971b40ca87 100644 (file)
@@ -283,6 +283,13 @@ void LyXText::computeBidiTables(Buffer const * buf, Row * row) const
                return;
        }
 
+       Inset * inset = row->par()->inInset();
+       if (inset && inset->owner() &&
+           inset->owner()->lyxCode() == Inset::ERT_CODE) {
+               bidi_start = -1;
+               return;
+       }
+
        bidi_start = row->pos();
        bidi_end = rowLastPrintable(row);
 
@@ -306,7 +313,7 @@ void LyXText::computeBidiTables(Buffer const * buf, Row * row) const
 
        pos_type stack[2];
        bool const rtl_par =
-               row->par()->getParLanguage(buf->params)->RightToLeft();
+               row->par()->isRightToLeftPar(buf->params);
        int level = 0;
        bool rtl = false;
        bool rtl0 = false;