From f0282ddff4ecfa3dc33eac2a2dbd9e0bf45b28a2 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 15 Mar 2019 11:23:53 +0100 Subject: [PATCH] Do not force LTR with nameref and non-TeX fonts Fixes: #11518 --- src/insets/InsetRef.cpp | 8 ++++++++ src/insets/InsetRef.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index c9fcd993d0..e8eecedde9 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -471,6 +471,14 @@ void InsetRef::validate(LaTeXFeatures & features) const features.require("nameref"); } +bool InsetRef::forceLTR() const +{ + // We force LTR for references. Namerefs are output in the scripts direction + // at least with fontspec/bidi, though (see #11518). + // FIXME: Re-Audit all other RTL cases. + return (getCmdName() != "nameref" || !buffer().masterParams().useNonTeXFonts); +} + InsetRef::type_info const InsetRef::types[] = { { "ref", N_("Standard"), N_("Ref: ")}, diff --git a/src/insets/InsetRef.h b/src/insets/InsetRef.h index 267b72e494..3e3e7b07d9 100644 --- a/src/insets/InsetRef.h +++ b/src/insets/InsetRef.h @@ -73,7 +73,7 @@ public: void addToToc(DocIterator const & di, bool output_active, UpdateType utype, TocBackend & backend) const; /// - bool forceLTR() const { return true; } + bool forceLTR() const; //@} /// \name Static public methods obligated for InsetCommand derived classes -- 2.39.2