From: Juergen Spitzmueller Date: Wed, 25 Jul 2018 09:00:00 +0000 (+0200) Subject: Fix text direction issue for InsetInfo in RTL context X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3252 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=79cf3f5ec1088e7de988e889247ec300d42fb70b;p=features.git Fix text direction issue for InsetInfo in RTL context Fixes: #10463 --- diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index d949de1b3a..97fe6ff06e 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -21,6 +21,7 @@ #include "InsetSpecialChar.h" #include "KeyMap.h" #include "LaTeXFeatures.h" +#include "Language.h" #include "LayoutFile.h" #include "Length.h" #include "LyXAction.h" @@ -296,6 +297,12 @@ void InsetInfo::setText(docstring const & str) } +bool InsetInfo::forceLTR() const +{ + return !buffer().params().language->rightToLeft(); +} + + void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) { // If the Buffer is a clone, then we neither need nor want to do any // of what follows. We want, rather, just to inherit how things were diff --git a/src/insets/InsetInfo.h b/src/insets/InsetInfo.h index 86f957aac1..4a1637fd82 100644 --- a/src/insets/InsetInfo.h +++ b/src/insets/InsetInfo.h @@ -125,6 +125,8 @@ public: bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; /// void doDispatch(Cursor & cur, FuncRequest & cmd); + /// Force inset into LTR environment if surroundings are RTL + bool forceLTR() const; /// void setInfo(std::string const & info); ///