commit 97f4c30796913542c0326f1515604aeaf477ac7e
Author: Juergen Spitzmueller <[email protected]>
Date:   Tue Jan 27 08:51:50 2026 +0100

    Move haveOtherForceProvide() to features
    
    and actually only check used languages.
    
    Don't know what drove me to f*up this.
    
    Should go to 2.5.x eventually.
---
 src/BufferParams.cpp  |  2 +-
 src/LaTeXFeatures.cpp | 12 +++++++++++-
 src/LaTeXFeatures.h   |  2 ++
 src/Language.cpp      | 11 -----------
 src/Language.h        |  2 --
 5 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 7246f0ec9b..bd7559cc8a 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -3979,7 +3979,7 @@ string BufferParams::babelCall(LaTeXFeatures const & 
features, string lang_opts,
        string force_provide;
        bool have_main_forceprovide = false;
        bool have_other_forceprovide = useNonTeXFonts
-                       ? languages.haveOtherForceProvide()
+                       ? features.haveOtherForceProvide()
                        : false;
        for (auto const & l : langs) {
                string blang = l->babel();
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 6f7957a199..4b3316366c 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -1967,7 +1967,7 @@ docstring const LaTeXFeatures::getBabelPostsettings() 
const
                if (!lang->babel_postsettings().empty())
                        tmp << lang->babel_postsettings() << '\n';
                if (lang->babelOptFormat() != "modifier" && 
lang->useBabelProvide() == 0
-                   && (!params_.useNonTeXFonts || 
!languages.haveOtherForceProvide())) {
+                   && (!params_.useNonTeXFonts || !haveOtherForceProvide())) {
                        // user-set options
                        string const opts = 
bufferParams().babelLangOptions(lang->lang());
                        if (!opts.empty())
@@ -1986,6 +1986,16 @@ docstring const LaTeXFeatures::getBabelPostsettings() 
const
 }
 
 
+bool LaTeXFeatures::haveOtherForceProvide() const
+{
+       for (auto const & l : UsedLanguages_) {
+               if (l->useBabelProvide())
+                       return true;
+       }
+       return false;
+}
+
+
 string const LaTeXFeatures::getThmDefinitions() const
 {
        ostringstream tmp;
diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h
index 101fe87730..af0e42b7b3 100644
--- a/src/LaTeXFeatures.h
+++ b/src/LaTeXFeatures.h
@@ -220,6 +220,8 @@ public:
        /// mentioned in the Require tag of layouts/custom insets that
        /// that have not already been accounted for
        std::string getUnknownPackages() const;
+       ///
+       bool haveOtherForceProvide() const;
 
 private:
        ///
diff --git a/src/Language.cpp b/src/Language.cpp
index 82f89199cf..718031218b 100644
--- a/src/Language.cpp
+++ b/src/Language.cpp
@@ -627,15 +627,4 @@ Language const * Languages::getLanguage(string const & 
language) const
 }
 
 
-bool Languages::haveOtherForceProvide() const
-{
-       for (auto const & l : languagelist_) {
-               if (l.second.useBabelProvide())
-                       return true;
-       }
-       return false;
-}
-
-
-
 } // namespace lyx
diff --git a/src/Language.h b/src/Language.h
index 76ea01ed26..80f56198db 100644
--- a/src/Language.h
+++ b/src/Language.h
@@ -233,8 +233,6 @@ public:
        const_iterator begin() const { return languagelist_.begin(); }
        ///
        const_iterator end() const { return languagelist_.end(); }
-       ///
-       bool haveOtherForceProvide() const;
        /// Special characters
        std::map<std::string, SpecialChar> special_chars_;
 
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to