]> 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>
Sun, 11 Aug 2019 06:15:57 +0000 (08:15 +0200)
Fixes: #3005
src/insets/InsetCitation.cpp
src/insets/InsetCitation.h

index 401d0142b5cab1e410278d635b0c6b94ce839514..a6a2738a9a75af3ff9855f9be5c39965d5e8ae9e 100644 (file)
@@ -445,6 +445,18 @@ 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.useBidiPackage())
+               return false;
+       return (buffer().masterParams().citeEngine() == "basic"
+               || buffer().masterParams().citeEngineType() == ENGINE_TYPE_NUMERICAL);
+}
+
 docstring InsetCitation::screenLabel() const
 {
        return cache.screen_label;
index 7c8231c538d9eca2a3e8e44f12a9db2aa228adc3..d94aefe4e0b3da9b8fc40d81fe506cc30ce3287d 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