]> git.lyx.org Git - lyx.git/commitdiff
Move definition out of loop
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 23 Apr 2018 14:19:41 +0000 (16:19 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 23 Apr 2018 14:21:08 +0000 (16:21 +0200)
src/Language.cpp

index d6a8fa3623da82a21865571a7897d2d12c7aec95..4f69a616ddd37a0e43846baad76920b6e9efc61f 100644 (file)
@@ -76,11 +76,12 @@ string Language::fontenc(BufferParams const & params) const
 {
        // Determine optimal font encoding
        // We check whether the used rm font supports an encoding our language supports
+       LaTeXFont const & lf =
+               theLaTeXFonts().getLaTeXFont(from_ascii(params.fontsRoman()));
+       vector<string> const lfe = lf.fontencs();
        for (auto & fe : fontenc_) {
-               LaTeXFont const & lf = theLaTeXFonts().getLaTeXFont(from_ascii(params.fontsRoman()));
                // ASCII means: support all T* encodings plus OT1
                if (fe == "ASCII") {
-                       vector<string> const lfe = lf.fontencs();
                        for (auto & afe : lfe) {
                                if (afe == "OT1" || prefixIs(afe, "T"))
                                        // we found a suitable one; return that.