X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Ftext.cpp;h=f49012a55941e2760996d1f3ee760a593ce798e6;hb=e43dc9d38cb8919c4acd03bd9cbb1016e980661b;hp=eceb061baeb0531967a630f3b765c91b44aa2ab7;hpb=7075eaadef6751ed7ef8ff3b16992d1eee43e8fb;p=lyx.git diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index eceb061bae..f49012a559 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -14,15 +14,16 @@ #include #include "tex2lyx.h" + #include "Context.h" -#include "Layout.h" #include "FloatList.h" -#include "lengthcommon.h" +#include "Layout.h" +#include "Length.h" + #include "support/lstrings.h" #include "support/convert.h" #include "support/filetools.h" -#include #include #include @@ -52,8 +53,6 @@ using support::suffixIs; using support::contains; using support::subst; -namespace fs = boost::filesystem; - void parse_text_in_inset(Parser & p, ostream & os, unsigned flags, bool outer, Context const & context) @@ -360,7 +359,7 @@ string find_file(string const & name, string const & path, // expects utf8) for (char const * const * what = extensions; *what; ++what) { string const trial = addExtension(name, *what); - if (fs::exists(makeAbsPath(trial, path).toFilesystemEncoding())) + if (makeAbsPath(trial, path).exists()) return trial; } return string(); @@ -1539,7 +1538,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, // therefore path is only used for testing // FIXME UNICODE encoding of name and path may be // wrong (makeAbsPath expects utf8) - if (!fs::exists(makeAbsPath(name, path).toFilesystemEncoding())) { + if (!makeAbsPath(name, path).exists()) { // The file extension is probably missing. // Now try to find it out. string const dvips_name = @@ -1571,7 +1570,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, // FIXME UNICODE encoding of name and path may be // wrong (makeAbsPath expects utf8) - if (fs::exists(makeAbsPath(name, path).toFilesystemEncoding())) + if (makeAbsPath(name, path).exists()) fix_relative_filename(name); else cerr << "Warning: Could not find graphics file '" @@ -2203,7 +2202,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, // FIXME UNICODE encoding of filename and path may be // wrong (makeAbsPath expects utf8) if ((t.cs() == "include" || t.cs() == "input") && - !fs::exists(makeAbsPath(filename, path).toFilesystemEncoding())) { + !makeAbsPath(filename, path).exists()) { // The file extension is probably missing. // Now try to find it out. string const tex_name = @@ -2214,7 +2213,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, } // FIXME UNICODE encoding of filename and path may be // wrong (makeAbsPath expects utf8) - if (fs::exists(makeAbsPath(filename, path).toFilesystemEncoding())) { + if (makeAbsPath(filename, path).exists()) { string const abstexname = makeAbsPath(filename, path).absFilename(); string const abslyxname = @@ -2318,14 +2317,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, opt1 + opt2 + '{' + p.verbatim_item() + '}'; - if (opt2.empty()) { - context.check_layout(os); - begin_inset(os, "FormulaMacro"); - os << "\n" << ert; - end_inset(os); - } else - // we cannot handle optional argument, so only output ERT - handle_ert(os, ert, context); + context.check_layout(os); + begin_inset(os, "FormulaMacro"); + os << "\n" << ert; + end_inset(os); } else if (t.cs() == "vspace") {