X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxtextclasslist.C;h=39b0f2faba62c0e2b85e4c4754d82dda3e971c7e;hb=e5b8f6956160631022fede155f55bad7951eecb8;hp=bec917d8b0bb02bea12fae0f2620d786da2ea25a;hpb=8e6e970d7ba017dba14bdb821f4c4489665d947c;p=lyx.git diff --git a/src/lyxtextclasslist.C b/src/lyxtextclasslist.C index bec917d8b0..39b0f2faba 100644 --- a/src/lyxtextclasslist.C +++ b/src/lyxtextclasslist.C @@ -27,6 +27,7 @@ namespace lyx { namespace fs = boost::filesystem; +using support::FileName; using support::libFileSearch; using support::makeDisplayPath; @@ -34,10 +35,6 @@ using boost::bind; using boost::regex; using boost::smatch; -#ifndef CXX_GLOBAL_CSTD -using std::exit; -#endif - using std::endl; using std::equal_to; using std::find_if; @@ -182,15 +179,15 @@ LyXTextClassList::addTextClass(std::string const & textclass, std::string const { // only check for textclass.layout file, .cls can be anywhere in $TEXINPUTS // NOTE: latex class name is defined in textclass.layout, which can be different from textclass - string layout_file = path + "/" + textclass + ".layout"; - if (fs::exists(layout_file)) { + FileName const layout_file(path + '/' + textclass + ".layout"); + if (fs::exists(layout_file.toFilesystemEncoding())) { lyxerr[Debug::TCLASS] << "Adding class " << textclass << " from directory " << path << endl; // Read .layout file and get description, real latex classname etc // // This is a C++ version of function processLayoutFile in configure.py, // which uses the following regex // \Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)} - ifstream ifs(layout_file.c_str()); + ifstream ifs(layout_file.toFilesystemEncoding().c_str()); static regex const reg("^#\\s*\\\\Declare(LaTeX|DocBook)Class\\s*" "(?:\\[([^,]*)(?:,.*)*\\])*\\s*\\{(.*)\\}\\s*"); string line;