X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxtextclasslist.C;h=17282854e39356f2944ace0320ffd62dbe85578e;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=0b845e4c9b2aa0289826f62ad737b90da1ca60ff;hpb=da9cdaf2189fde92ba33703d9cc3c1cc8fe93321;p=lyx.git diff --git a/src/lyxtextclasslist.C b/src/lyxtextclasslist.C index 0b845e4c9b..17282854e3 100644 --- a/src/lyxtextclasslist.C +++ b/src/lyxtextclasslist.C @@ -22,12 +22,13 @@ #include #include #include -namespace fs = boost::filesystem; -using lyx::textclass_type; -using lyx::support::libFileSearch; -using lyx::support::makeDisplayPath; +namespace lyx { +namespace fs = boost::filesystem; + +using support::libFileSearch; +using support::makeDisplayPath; using boost::bind; using boost::regex; @@ -104,7 +105,7 @@ bool LyXTextClassList::read() if (real_file.empty()) { lyxerr << "LyXTextClassList::Read: unable to find " - "textclass file `" << makeDisplayPath(real_file, 1000) + "textclass file `" << to_utf8(makeDisplayPath(real_file, 1000)) << "'. Exiting." << endl; return false; // This causes LyX to end... Not a desirable behaviour. Lgb @@ -122,7 +123,7 @@ bool LyXTextClassList::read() if (!lex.isOK()) { lyxerr << "LyXTextClassList::Read: unable to open " - "textclass file `" << makeDisplayPath(real_file, 1000) + "textclass file `" << to_utf8(makeDisplayPath(real_file, 1000)) << "'\nCheck your installation. LyX can't continue." << endl; return false; @@ -174,7 +175,7 @@ bool LyXTextClassList::read() } -std::pair const +std::pair const LyXTextClassList::addTextClass(std::string const & textclass, std::string const & path) { // only check for textclass.layout file, .cls can be anywhere in $TEXINPUTS @@ -186,9 +187,9 @@ LyXTextClassList::addTextClass(std::string const & textclass, std::string const // // This is a C++ version of function processLayoutFile in configure.py, // which uses the following regex - // \Declare(LaTeX|DocBook|LinuxDoc)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)} + // \Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)} ifstream ifs(layout_file.c_str()); - static regex const reg("^#\\s*\\\\Declare(LaTeX|DocBook|LinuxDoc)Class\\s*" + static regex const reg("^#\\s*\\\\Declare(LaTeX|DocBook)Class\\s*" "(?:\\[([^,]*)(?:,.*)*\\])*\\s*\\{(.*)\\}\\s*"); string line; while (getline(ifs, line)) { @@ -230,3 +231,6 @@ bool LyXSetStyle() lyxerr[Debug::TCLASS] << "LyXSetStyle: configuration parsed." << endl; return true; } + + +} // namespace lyx