]> git.lyx.org Git - features.git/commitdiff
Force LTR for numeric citations
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 11 Aug 2019 06:15:57 +0000 (08:15 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 19 Oct 2019 13:57:24 +0000 (15:57 +0200)
Fixes: #3005
(cherry picked from commit cce9adc1859f0134800c2405200f1467c8564b13)

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

index 24441268984d2525395e8a913f08ab108faad25c..3e0bd6f05f9412a424659dc961c85252fe858847 100644 (file)
@@ -19,6 +19,7 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "DispatchResult.h"
+#include "Font.h"
 #include "FuncCode.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
@@ -443,6 +444,20 @@ docstring InsetCitation::basicLabel(bool for_xhtml) const
        return '[' + label + ']';
 }
 
+
+bool InsetCitation::forceLTR(OutputParams const & rp) const
+{
+       // We have to force LTR for numeric references
+       // [= plain BibTeX, numeric natbib and biblatex].
+       // Except for XeTeX/bidi . See #3005.
+       if (rp.local_font->isRightToLeft()
+           && rp.use_polyglossia
+           && rp.flavor == OutputParams::XETEX)
+               return false;
+       return (buffer().masterParams().citeEngine().list().front() == "basic"
+               || buffer().masterParams().citeEngineType() == ENGINE_TYPE_NUMERICAL);
+}
+
 docstring InsetCitation::screenLabel() const
 {
        return cache.screen_label;
index a8e9e1853d9fc797b2715b4c41a49e093f8f527e..7962809eda9929b3ea113d58bc186d69030d5097 100644 (file)
@@ -70,6 +70,8 @@ public:
                                  UpdateType utype, TocBackend & backend) const;
        ///
        std::string contextMenuName() const;
+       ///
+       bool forceLTR(OutputParams const &) const;
        //@}
 
        /// \name Static public methods obligated for InsetCommand derived classes
index 160126d34a8d25a71430382908ab042e599d9de4..e005d5eedc5b2e4b71fd8885650ed2cecc2fc213 100644 (file)
@@ -90,6 +90,8 @@ What's new
 
 - Fix direction of roman numbers with RTL documents and LuaTeX.
 
+- Fix direction of numbered citations outside XeTeX/bidi (bug 3005).
+
 - Fix direction of references with XeTeX/bidi (bug 11626).
 
 - Fix interplay of the memoir class and custom page size/geometry (bug 10970).