From 4456dede9c0b4a6a3edb63ab07a833484c7bda25 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 (cherry picked from commit f0282ddff4ecfa3dc33eac2a2dbd9e0bf45b28a2) --- src/insets/InsetRef.cpp | 8 ++++++++ src/insets/InsetRef.h | 2 +- status.23x | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index eef6a9751b..d5901d505a 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 diff --git a/status.23x b/status.23x index 3030704bd5..487d9f0414 100644 --- a/status.23x +++ b/status.23x @@ -87,6 +87,9 @@ What's new - Fix paragraph alignment in RTL when using polyglossia (bidi) (bug 11399). +- Fix text direction of namerefs in RTL scripts when using polyglossia (bidi) + (bug 11518). + - Fix LaTeX export of query strings in Hyperlinks (bugs 11482, 11511). - Fix breakage caused by commas in the caption of listings (bug 11484). -- 2.39.5