]> 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>
Fri, 15 Mar 2019 10:23:53 +0000 (11:23 +0100)
Fixes: #11518
src/insets/InsetRef.cpp
src/insets/InsetRef.h

index c9fcd993d09dbcc29114c7adbc2e5266e859ca32..e8eecedde90d8dc9bf6295e0dd1e358b223ff53e 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