X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2FPreamble.cpp;h=7b69bc4db5392eaa0bbba2853c42684f4866b721;hb=fd5adacef25eb40f813dedd961920c353448213a;hp=3588086cfa3c23b1ebffea778e92031e0d95db29;hpb=1da80d4d8ff4295a5f35cbf0130eef1d89a46b44;p=features.git diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 3588086cfa..7b69bc4db5 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -2174,17 +2174,17 @@ void Preamble::parse(Parser & p, string const & forceclass, if (detectEncoding && !is_full_document) return; + // Force textclass if the user wanted it + if (!forceclass.empty()) { + setTextClass(forceclass, tc); + class_set = true; + } + while (is_full_document && p.good()) { if (detectEncoding && h_inputencoding != "auto-legacy" && h_inputencoding != "auto-legacy-plain") return; - // Force textclass if the user wanted it - if (!forceclass.empty()) { - setTextClass(forceclass, tc); - class_set = true; - } - Token const & t = p.get_token(); #ifdef FILEDEBUG