From f63de41c4c2180705b44c3444718d7f35df89b8a Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 23 Apr 2018 12:59:57 +0200 Subject: [PATCH] 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 37735c6c9a..49b93f615c 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -904,15 +904,14 @@ void LaTeXFeatures::getFontEncodings(vector & encs, bool const onlylangs encs.insert(encs.begin(), "T2A"); } - for (auto const & lang : UsedLanguages_) - if (!lang->fontencs().empty()) { - vector 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 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 51e1a5b896..d6a8fa3623 100644 --- a/src/Language.cpp +++ b/src/Language.cpp @@ -72,12 +72,6 @@ docstring const Language::translateLayout(string const & m) const } -vector 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 390e0a6f72..d3f0e17139 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 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 -- 2.39.5