]> git.lyx.org Git - features.git/commitdiff
Do not force LTR with nameref and non-TeX fonts
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 15 Mar 2019 10:23:53 +0000 (11:23 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 17 Mar 2019 16:29:14 +0000 (17:29 +0100)
Fixes: #11518
(cherry picked from commit f0282ddff4ecfa3dc33eac2a2dbd9e0bf45b28a2)

src/insets/InsetRef.cpp
src/insets/InsetRef.h
status.23x

index eef6a9751b8aeacf289717898e33a58c9c5dc13c..d5901d505a16270370593bb911b1828862fd3f3e 100644 (file)
@@ -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: ")},
index 267b72e494525b05deb02e9572f0d8c6fde3eb9c..3e3e7b07d94fd9c2f68f43c5e5c0cd68263f7ba8 100644 (file)
@@ -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
index 3030704bd5658e0ad9a8006bf225251e725d436c..487d9f0414b2107601dba66d0e998d075efd2a27 100644 (file)
@@ -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).