]> git.lyx.org Git - features.git/commitdiff
Inset::forceLTR() only determines whether explicit switches are needed
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 10 Apr 2023 08:20:11 +0000 (10:20 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 10 Apr 2023 08:20:11 +0000 (10:20 +0200)
(as opposed to InsetLayout::forceLTR()). So properly set this for ERT
and remove downstream special casing

src/Paragraph.cpp
src/insets/InsetERT.h

index c332ab0ec1ee23e5ee8a4265aa2a70999f4a444f..3ec79d5c336996bd28b2dfc0041a4a686d7cd5c0 100644 (file)
@@ -1100,10 +1100,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
            // babel with Xe/LuaTeX does not need a switch
            // and \L is not defined there.
            && (!runparams.isFullUnicode() || !runparams.use_babel)
-           && running_font.isRightToLeft()
-           // ERT is an exception, it should be output with no
-           // decorations at all
-           && inset->lyxCode() != ERT_CODE) {
+           && running_font.isRightToLeft()) {
                if (runparams.use_polyglossia) {
                        // (lua)bidi
                        // Displayed environments go in an LTR environment
index 72220d07d0c7aeec383533c681a6071fd63cb9ce..8000c2cac4d25cb1cd39fa9a0e0cacd11e1973e0 100644 (file)
@@ -36,6 +36,9 @@ public:
        static CollapseStatus string2params(std::string const &);
        ///
        static std::string params2string(CollapseStatus);
+       /// Do NOT force inset into LTR environment if surroundings are RTL
+       /// even though insetlayout has (and should have) forceltr true
+       bool forceLTR(OutputParams const &) const override { return false; }
 
        std::string contextMenuName() const override
                { return "context-ert"; }