Hi!
attached find a very simple fix for
http://bugzilla.lyx.org/show_bug.cgi?id=3011 (which is a regression
relative to 1.3.X). The problem is that when typing some LTR in an RTL
paragraph (or vice versa), when an inset is inserted, it gets inserted
in the paragraph language, and not in the current language. It's more
correct for the inset to be inserted in the current language. That's
what this patch achieves.
I actually wanted to solve this in a more complete way, by setting the
font to current_font directly within paragraph::insertInset() if no
explicit font is provided; but I don't have access to real_current_font
within Paragraph... Any thoughts on this? Could the versions of
insertInset which do not take a font be made private, so that one would
always have to provide a font explicitly? I'm not sure that would really
be correct, though...
Anyhow, the attached seems to solve the current issue. Please test and
make sure that this has no ill-effects?
Thanks!
Dov
Index: src/Text2.cpp
===================================================================
--- src/Text2.cpp (revision 18766)
+++ src/Text2.cpp (working copy)
@@ -670,7 +670,7 @@
{
BOOST_ASSERT(this == cur.text());
BOOST_ASSERT(inset);
- cur.paragraph().insertInset(cur.pos(), inset,
+ cur.paragraph().insertInset(cur.pos(), inset, real_current_font,
Change(cur.buffer().params().trackChanges ?
Change::INSERTED :
Change::UNCHANGED));
}