commit f63de41c4c2180705b44c3444718d7f35df89b8a
Author: Juergen Spitzmueller <[email protected]>
Date:   Mon Apr 23 12:59:57 2018 +0200

    Remove Language::fontenc()
    
    This raw vector of fontenc alternatives is not needed outside Language,
    and it should actually never be used.
---
 src/LaTeXFeatures.cpp |   15 +++++++--------
 src/Language.cpp      |    8 +-------
 src/Language.h        |    4 +---
 3 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 37735c6..49b93f6 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -904,15 +904,14 @@ void LaTeXFeatures::getFontEncodings(vector<string> & 
encs, bool const onlylangs
                        encs.insert(encs.begin(), "T2A");
        }
 
-       for (auto const & lang : UsedLanguages_)
-               if (!lang->fontencs().empty()) {
-                       vector<string> extraencs =
-                               
getVectorFromString(lang->fontenc(buffer().masterParams()));
-                       for (auto const & extra : extraencs) {
-                               if (extra != "none" && find(encs.begin(), 
encs.end(), extra) == encs.end())
-                                       encs.insert(encs.begin(), extra);
-                       }
+       for (auto const & lang : UsedLanguages_) {
+               vector<string> extraencs =
+                       
getVectorFromString(lang->fontenc(buffer().masterParams()));
+               for (auto const & extra : extraencs) {
+                       if (extra != "none" && find(encs.begin(), encs.end(), 
extra) == encs.end())
+                               encs.insert(encs.begin(), extra);
                }
+       }
 }
 
 namespace {
diff --git a/src/Language.cpp b/src/Language.cpp
index 51e1a5b..d6a8fa3 100644
--- a/src/Language.cpp
+++ b/src/Language.cpp
@@ -72,12 +72,6 @@ docstring const Language::translateLayout(string const & m) 
const
 }
 
 
-vector<string> Language::fontencs() const
-{
-       return fontenc_;
-}
-
-
 string Language::fontenc(BufferParams const & params) const
 {
        // Determine optimal font encoding
@@ -99,7 +93,7 @@ string Language::fontenc(BufferParams const & params) const
        }
        // We did not find a suitable one; just take the first in the list,
        // the priorized one (which is "T1" for ASCII).
-       return fontencs().front() == "ASCII" ? "T1" : fontencs().front();
+       return fontenc_.front() == "ASCII" ? "T1" : fontenc_.front();
 }
 
 
diff --git a/src/Language.h b/src/Language.h
index 390e0a6..d3f0e17 100644
--- a/src/Language.h
+++ b/src/Language.h
@@ -84,10 +84,8 @@ public:
        docstring babel_presettings() const { return babel_presettings_; }
        /// This language internally sets a font encoding
        bool internalFontEncoding() const { return internal_enc_; }
-       /// fontenc encoding(s)
+       /// The most suitable font encoding(s) for the selected document font
        std::string fontenc(BufferParams const &) const;
-       /// fontenc encoding(s)
-       std::vector<std::string> fontencs() const;
        /// This language needs to be passed to babel itself (not the class)
        bool asBabelOptions() const { return as_babel_options_; }
        /// This language corresponds to a translation of the GUI

Reply via email to