]> git.lyx.org Git - features.git/commitdiff
Remove Language::fontenc()
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 23 Apr 2018 10:59:57 +0000 (12:59 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 23 Apr 2018 10:59:57 +0000 (12:59 +0200)
This raw vector of fontenc alternatives is not needed outside Language,
and it should actually never be used.

src/LaTeXFeatures.cpp
src/Language.cpp
src/Language.h

index 37735c6c9a0682343950bcb3daaae8b852995731..49b93f615c5ed0fa0c1df6c041abca45dfea8ab4 100644 (file)
@@ -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 {
index 51e1a5b896cef4d4ceed0f6035aa9ba9b370628f..d6a8fa3623da82a21865571a7897d2d12c7aec95 100644 (file)
@@ -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();
 }
 
 
index 390e0a6f7276f8d7e568e73cd8be3d33b5c66ec4..d3f0e171392e966f6872247d9eb9b1d69c208439 100644 (file)
@@ -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