]> git.lyx.org Git - lyx.git/commitdiff
getting rid of superfluous lyx::support:: statements.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 12 Dec 2007 19:57:42 +0000 (19:57 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 12 Dec 2007 19:57:42 +0000 (19:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22106 a592a061-630c-0410-9148-cb99ea01b6c8

57 files changed:
src/Buffer.cpp
src/Converter.cpp
src/ConverterCache.cpp
src/Encoding.cpp
src/Format.cpp
src/Lexer.cpp
src/LyX.cpp
src/LyXFunc.cpp
src/LyXRC.cpp
src/ModuleList.cpp
src/Mover.cpp
src/Paragraph.cpp
src/ParagraphParameters.cpp
src/ServerSocket.cpp
src/Session.cpp
src/Text3.cpp
src/TextClass.cpp
src/TextClassList.cpp
src/Trans.cpp
src/client/client.cpp
src/client/debug.cpp
src/factory.cpp
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiCitation.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiFontLoader.cpp
src/frontends/qt4/GuiImage.cpp
src/frontends/qt4/GuiPrint.cpp
src/frontends/qt4/GuiShowFile.cpp
src/frontends/qt4/GuiTexinfo.cpp
src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiWorkArea.cpp
src/frontends/qt4/qt_helpers.cpp
src/graphics/GraphicsConverter.cpp
src/graphics/PreviewLoader.cpp
src/insets/ExternalSupport.cpp
src/insets/ExternalTemplate.cpp
src/insets/ExternalTransforms.cpp
src/insets/InsetBibitem.cpp
src/insets/InsetBibtex.cpp
src/insets/InsetCaption.cpp
src/insets/InsetCitation.cpp
src/insets/InsetExternal.cpp
src/insets/InsetGraphics.cpp
src/insets/InsetLabel.cpp
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathNest.cpp
src/mathed/MathExtern.cpp
src/mathed/MathFactory.cpp
src/support/debug.cpp
src/support/docstring.cpp
src/tex2lyx/Context.cpp
src/tex2lyx/preamble.cpp
src/tex2lyx/tex2lyx.cpp
src/tex2lyx/text.cpp

index 1918850afbe9815fd2ba2c0249e2411ed26d718c..53fc33454466a92c9d2bc81d5ee6083c40da60fe 100644 (file)
@@ -1253,7 +1253,7 @@ int Buffer::runChktex()
        string const name = addName(path.absFilename(), latexName());
        string const org_path = filePath();
 
-       support::PathChanger p(path); // path to LaTeX file
+       PathChanger p(path); // path to LaTeX file
        message(_("Running chktex..."));
 
        // Generate the LaTeX file if neccessary
@@ -1942,7 +1942,7 @@ void Buffer::setGuiDelegate(frontend::GuiBufferDelegate * gui)
 
 namespace {
 
-class AutoSaveBuffer : public support::ForkedProcess {
+class AutoSaveBuffer : public ForkedProcess {
 public:
        ///
        AutoSaveBuffer(Buffer const & buffer, FileName const & fname)
@@ -2149,7 +2149,7 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir,
                if (!makeLaTeXFile(FileName(filename), string(), runparams))
                        return false;
        } else if (!lyxrc.tex_allows_spaces
-                  && support::contains(filePath(), ' ')) {
+                  && contains(filePath(), ' ')) {
                Alert::error(_("File name error"),
                           _("The directory path to the document cannot contain spaces."));
                return false;
index 085ed5fb2f50104a87cd01c08ed8aa6039a8f5ba..03814f10b5240f3244318764898c40be5f1ee231 100644 (file)
@@ -287,7 +287,7 @@ bool Converters::convert(Buffer const * buffer,
                                formats.extension(from_format);
                        string const to_ext = formats.extension(to_format);
                        string const command =
-                               support::os::python() + ' ' +
+                               os::python() + ' ' +
                                quoteName(libFileSearch("scripts", "convertDefault.py").toFilesystemEncoding()) +
                                ' ' +
                                quoteName(from_ext + ':' + from_file.toFilesystemEncoding()) +
@@ -325,7 +325,7 @@ bool Converters::convert(Buffer const * buffer,
        string const path(onlyPath(from_file.absFilename()));
        // Prevent the compiler from optimizing away p
        FileName pp(path);
-       support::PathChanger p(pp);
+       PathChanger p(pp);
 
        // empty the error list before any new conversion takes place.
        errorList.clear();
index ea3bfc70f3f4115bd16ec925f8641f0e45bba8d9..cdb8ae20bc34ae6494481a7d48d09fe1614b33b8 100644 (file)
@@ -169,7 +169,7 @@ void ConverterCache::Impl::writeIndex()
        FileName const index(addName(cache_dir.absFilename(), "index"));
        ofstream os(index.toFilesystemEncoding().c_str());
        os.close();
-       if (!lyx::support::chmod(index, 0600))
+       if (!chmod(index, 0600))
                return;
        os.open(index.toFilesystemEncoding().c_str());
        CacheType::iterator it1 = cache.begin();
@@ -238,7 +238,7 @@ void ConverterCache::init()
                return;
        // We do this here and not in the constructor because package() gets
        // initialized after all static variables.
-       cache_dir = FileName(addName(support::package().user_support().absFilename(), "cache"));
+       cache_dir = FileName(addName(package().user_support().absFilename(), "cache"));
        if (!cache_dir.exists())
                if (support::mkdir(cache_dir, 0700) != 0) {
                        lyxerr << "Could not create cache directory `"
@@ -260,10 +260,10 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
 
        // FIXME: Should not hardcode this (see bug 3819 for details)
        if (to_format == "pstex") {
-               FileName const converted_eps(support::changeExtension(converted_file.absFilename(), "eps"));
+               FileName const converted_eps(changeExtension(converted_file.absFilename(), "eps"));
                add(orig_from, "eps", converted_eps);
        } else if (to_format == "pdftex") {
-               FileName const converted_pdf(support::changeExtension(converted_file.absFilename(), "pdf"));
+               FileName const converted_pdf(changeExtension(converted_file.absFilename(), "pdf"));
                add(orig_from, "pdf", converted_pdf);
        }
 
@@ -289,7 +289,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
                }
                item->checksum = checksum;
                if (!mover.copy(converted_file, item->cache_name,
-                               support::onlyFilename(item->cache_name.absFilename()), 0600)) {
+                               onlyFilename(item->cache_name.absFilename()), 0600)) {
                        LYXERR(Debug::FILES, "ConverterCache::add(" << orig_from << "):\n"
                                                "Could not copy file.");
                }
@@ -297,7 +297,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
                CacheItem new_item(orig_from, to_format, timestamp,
                                orig_from.checksum());
                if (mover.copy(converted_file, new_item.cache_name,
-                              support::onlyFilename(new_item.cache_name.absFilename()), 0600)) {
+                              onlyFilename(new_item.cache_name.absFilename()), 0600)) {
                        FormatCache & format_cache = pimpl_->cache[orig_from];
                        if (format_cache.from_format.empty())
                                format_cache.from_format =
@@ -417,11 +417,11 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
 
        // FIXME: Should not hardcode this (see bug 3819 for details)
        if (to_format == "pstex") {
-               FileName const dest_eps(support::changeExtension(dest.absFilename(), "eps"));
+               FileName const dest_eps(changeExtension(dest.absFilename(), "eps"));
                if (!copy(orig_from, "eps", dest_eps))
                        return false;
        } else if (to_format == "pdftex") {
-               FileName const dest_pdf(support::changeExtension(dest.absFilename(), "pdf"));
+               FileName const dest_pdf(changeExtension(dest.absFilename(), "pdf"));
                if (!copy(orig_from, "pdf", dest_pdf))
                        return false;
        }
@@ -430,7 +430,7 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
        BOOST_ASSERT(item);
        Mover const & mover = getMover(to_format);
        return mover.copy(item->cache_name, dest,
-                         support::onlyFilename(dest.absFilename()));
+                         onlyFilename(dest.absFilename()));
 }
 
 } // namespace lyx
index 37e85ccf766c714fd55d66975ca8288a593b10be..248bdae6bcf97bcd8e7d3829036ca8444cb3e881 100644 (file)
@@ -485,7 +485,7 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
                info.force = false;
                while (!flags.empty()) {
                        string flag;
-                       flags = support::split(flags, flag, ',');
+                       flags = split(flags, flag, ',');
                        if (flag == "combining")
                                info.combining = true;
                        else if (flag == "force")
index 2ece9f874205208533e91f9f29d56cf480e22a40..edfdf4135ba1e03ea2d295081b6db20bedf44ba8 100644 (file)
@@ -129,7 +129,7 @@ string Formats::getFormatFromFile(FileName const & filename) const
                return format;
 
        // try to find a format from the file extension.
-       string const ext = support::getExtension(filename.absFilename());
+       string const ext = getExtension(filename.absFilename());
        if (!ext.empty()) {
                // this is ambigous if two formats have the same extension,
                // but better than nothing
index 8a80758874d9ba98c7a24ade44a492126e6bfabb..ad6f860c6f16dbf1cf0ae95491da8bbcea14e63a 100644 (file)
@@ -63,7 +63,7 @@ public:
        ///
        void popTable();
        ///
-       bool setFile(support::FileName const & filename);
+       bool setFile(FileName const & filename);
        ///
        void setStream(istream & i);
        ///
@@ -669,7 +669,7 @@ void Lexer::printError(string const & message) const
 }
 
 
-bool Lexer::setFile(support::FileName const & filename)
+bool Lexer::setFile(FileName const & filename)
 {
        return pimpl_->setFile(filename);
 }
index 1d13df399b104bf3def3b34cacb9f0868b01c21a..a5c5093cde701486742d7e8eb5eb49351b6e48dc 100644 (file)
@@ -110,7 +110,7 @@ void reconfigureUserLyXDir()
        string const configure_command = package().configure_command();
 
        lyxerr << to_utf8(_("LyX: reconfiguring user directory")) << endl;
-       support::PathChanger p(package().user_support());
+       PathChanger p(package().user_support());
        Systemcall one;
        one.startscript(Systemcall::Wait, configure_command);
        lyxerr << "LyX: " << to_utf8(_("Done!")) << endl;
@@ -351,14 +351,14 @@ int LyX::exec(int & argc, char * argv[])
        easyParse(argc, argv);
 
        try {
-               support::init_package(to_utf8(from_local8bit(argv[0])),
+               init_package(to_utf8(from_local8bit(argv[0])),
                              cl_system_support, cl_user_support,
-                             support::top_build_dir_is_one_level_up);
-       } catch (support::ExceptionMessage const & message) {
-               if (message.type_ == support::ErrorException) {
+                             top_build_dir_is_one_level_up);
+       } catch (ExceptionMessage const & message) {
+               if (message.type_ == ErrorException) {
                        Alert::error(message.title_, message.details_);
                        exit(1);
-               } else if (message.type_ == support::WarningException) {
+               } else if (message.type_ == WarningException) {
                        Alert::warning(message.title_, message.details_);
                }
        }
@@ -510,7 +510,7 @@ int LyX::init(int & argc, char * argv[])
                // the filename if necessary
                pimpl_->files_to_load_.push_back(fileSearch(string(),
                        os::internal_path(to_utf8(from_local8bit(argv[argi]))),
-                       "lyx", support::allow_unreadable));
+                       "lyx", allow_unreadable));
        }
 
        if (first_start)
index 66d295e970eec6e907db2ff3f6a37019dd039654..4e1f808c7401c2e67dc558d97cef70253e327f04 100644 (file)
@@ -185,7 +185,7 @@ void reconfigure(LyXView & lv, string const & option)
        lv.message(_("Running configure..."));
 
        // Run configure in user lyx directory
-       support::PathChanger p(package().user_support());
+       PathChanger p(package().user_support());
        string configure_command = package().configure_command();
        configure_command += option;
        Systemcall one;
@@ -193,7 +193,7 @@ void reconfigure(LyXView & lv, string const & option)
        p.pop();
        // emit message signal.
        lv.message(_("Reloading configuration..."));
-       lyxrc.read(support::libFileSearch(string(), "lyxrc.defaults"));
+       lyxrc.read(libFileSearch(string(), "lyxrc.defaults"));
        // Re-read packages.lst
        LaTeXFeatures::getAvailable();
 
@@ -1011,7 +1011,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        string const path = buffer->temppath();
                        // Prevent the compiler from optimizing away p
                        FileName pp(path);
-                       support::PathChanger p(pp);
+                       PathChanger p(pp);
 
                        // there are three cases here:
                        // 1. we print to a file
@@ -2170,7 +2170,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
                if (lyxrc_orig.document_path != lyxrc_new.document_path) {
                        FileName path(lyxrc_new.document_path);
                        if (path.exists() && path.isDirectory())
-                               support::package().document_dir() = FileName(lyxrc.document_path);
+                               package().document_dir() = FileName(lyxrc.document_path);
                }
        case LyXRC::RC_ESC_CHARS:
        case LyXRC::RC_EXAMPLEPATH:
@@ -2195,7 +2195,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_NUMLASTFILES:
        case LyXRC::RC_PATH_PREFIX:
                if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
-                       support::prependEnvPath("PATH", lyxrc.path_prefix);
+                       prependEnvPath("PATH", lyxrc.path_prefix);
                }
        case LyXRC::RC_PERS_DICT:
        case LyXRC::RC_PREVIEW:
@@ -2240,7 +2240,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_TEX_ALLOWS_SPACES:
        case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
                if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
-                       support::os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
+                       os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
                }
        case LyXRC::RC_UIFILE:
        case LyXRC::RC_USER_EMAIL:
index db89b3b2164465369499db56f2a4f1b46eed2f7f..0cf9f6dd1867934e6fce273c13ccd95b1a9f2cfb 100644 (file)
@@ -1061,7 +1061,7 @@ int LyXRC::read(Lexer & lexrc)
                        int flgs = Format::none;
                        while (!flags.empty()) {
                                string flag;
-                               flags = support::split(flags, flag, ',');
+                               flags = split(flags, flag, ',');
                                if (flag == "document")
                                        flgs |= Format::document;
                                else if (flag == "vector")
@@ -2220,7 +2220,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                                        flags.push_back("document");
                                if (cit->vectorFormat())
                                        flags.push_back("vector");
-                               os << support::getStringFromVector(flags);
+                               os << getStringFromVector(flags);
                                os << "\"\n";
                        }
                }
index b1100929d054debaa71d900eff5040e7556041b5..99d8b7e3941d126aa7789b0b218d553db9f01123 100644 (file)
@@ -46,7 +46,7 @@ public:
 //Much of this is borrowed from TextClassList::read()
 bool ModuleList::load()
 {
-       support::FileName const real_file = libFileSearch("", "lyxmodules.lst");
+       FileName const real_file = libFileSearch("", "lyxmodules.lst");
        LYXERR(Debug::TCLASS, "Reading modules from `" << real_file << '\'');
 
        if (real_file.empty()) {
@@ -102,7 +102,7 @@ bool ModuleList::load()
                        vector<string> pkgs;
                        while (!packages.empty()) {
                                string p;
-                               packages = support::split(packages, p, ',');
+                               packages = split(packages, p, ',');
                                pkgs.push_back(p);
                        }
                        // This code is run when we have
index 8a54b7a8c821638944ebe909c15ca13fe4f0f06d..17cb7ba57a43fcdba7b74bce13d97c829c9572b4 100644 (file)
@@ -26,35 +26,35 @@ using namespace lyx::support;
 namespace lyx {
 
 
-bool Mover::copy(support::FileName const & from, support::FileName const & to,
+bool Mover::copy(FileName const & from, FileName const & to,
                 unsigned long int mode) const
 {
        return do_copy(from, to, to.absFilename(), mode);
 }
 
 
-bool Mover::do_copy(support::FileName const & from, support::FileName const & to,
+bool Mover::do_copy(FileName const & from, FileName const & to,
                    string const &, unsigned long int mode) const
 {
-       return support::copy(from, to, mode);
+       return copy(from, to, mode);
 }
 
 
-bool Mover::rename(support::FileName const & from,
-                  support::FileName const & to) const
+bool Mover::rename(FileName const & from,
+                  FileName const & to) const
 {
        return do_rename(from, to, to.absFilename());
 }
 
 
-bool Mover::do_rename(support::FileName const & from, support::FileName const & to,
+bool Mover::do_rename(FileName const & from, FileName const & to,
                      string const &) const
 {
-       return support::rename(from, to);
+       return rename(from, to);
 }
 
 
-bool SpecialisedMover::do_copy(support::FileName const & from, support::FileName const & to,
+bool SpecialisedMover::do_copy(FileName const & from, FileName const & to,
                               string const & latex, unsigned long int mode) const
 {
        if (command_.empty())
@@ -65,21 +65,21 @@ bool SpecialisedMover::do_copy(support::FileName const & from, support::FileName
                if (!ofs)
                        return false;
                ofs.close();
-               if (!support::chmod(to, mode))
+               if (!chmod(to, mode))
                        return false;
        }
 
-       string command = support::libScriptSearch(command_);
-       command = support::subst(command, "$$i", quoteName(from.toFilesystemEncoding()));
-       command = support::subst(command, "$$o", quoteName(to.toFilesystemEncoding()));
-       command = support::subst(command, "$$l", quoteName(latex));
+       string command = libScriptSearch(command_);
+       command = subst(command, "$$i", quoteName(from.toFilesystemEncoding()));
+       command = subst(command, "$$o", quoteName(to.toFilesystemEncoding()));
+       command = subst(command, "$$l", quoteName(latex));
 
-       support::Systemcall one;
-       return one.startscript(support::Systemcall::Wait, command) == 0;
+       Systemcall one;
+       return one.startscript(Systemcall::Wait, command) == 0;
 }
 
 
-bool SpecialisedMover::do_rename(support::FileName const & from, support::FileName const & to,
+bool SpecialisedMover::do_rename(FileName const & from, FileName const & to,
                                 string const & latex) const
 {
        if (command_.empty())
index 78b58c51a75980b61003c3b9f310b471c8fbc2c9..6b6287d9f8b80d97d92ef0ad07208e788b0a5e31 100644 (file)
@@ -1519,7 +1519,7 @@ void Paragraph::setLabelWidthString(docstring const & s)
 docstring const Paragraph::translateIfPossible(docstring const & s,
                BufferParams const & bparams) const
 {
-       if (!support::isAscii(s) || s.empty()) {
+       if (!isAscii(s) || s.empty()) {
                // This must be a user defined layout. We cannot translate
                // this, since gettext accepts only ascii keys.
                return s;
index 4534ba4c5e3a74541a5342acc567ce6c642c3cff..d0d4b261278f61fa21450865f68a4b600eacaf79 100644 (file)
@@ -229,7 +229,7 @@ void ParagraphParameters::read(Lexer & lex, bool merge)
                        }
                } else if (token == "\\align") {
                        lex.next();
-                       int tmpret = support::findToken(string_align, lex.getString());
+                       int tmpret = findToken(string_align, lex.getString());
                        if (tmpret == -1)
                                ++tmpret;
                        align(LyXAlignment(1 << tmpret));
index 063f3471c1afeca6595ee811d6d853032d1f768c..3b9061fd163febf742244798817e0399e8b398a0 100644 (file)
 # include <io.h>
 #endif
 
-using boost::shared_ptr;
-
 using namespace std;
+using namespace lyx::support;
+
+using boost::shared_ptr;
 
 namespace lyx {
 
 // Address is the unix address for the socket.
 // MAX_CLIENTS is the maximum number of clients
 // that can connect at the same time.
-ServerSocket::ServerSocket(LyXFunc * f, support::FileName const & addr)
+ServerSocket::ServerSocket(LyXFunc * f, FileName const & addr)
        : func(f),
-         fd_(support::socktools::listen(addr, 3)),
+         fd_(socktools::listen(addr, 3)),
          address_(addr)
 {
        if (fd_ == -1) {
@@ -58,9 +59,9 @@ ServerSocket::ServerSocket(LyXFunc * f, support::FileName const & addr)
 
        // These env vars are used by DVI inverse search
        // Needed by xdvi
-       support::setEnv("XEDITOR", "lyxclient -g %f %l");
+       setEnv("XEDITOR", "lyxclient -g %f %l");
        // Needed by lyxclient
-       support::setEnv("LYXSOCKET", address_.absFilename());
+       setEnv("LYXSOCKET", address_.absFilename());
 
        theApp()->registerSocketCallback(
                fd_,
@@ -97,7 +98,7 @@ string const ServerSocket::address() const
 // is OK and if the number of clients does not exceed MAX_CLIENTS
 void ServerSocket::serverCallback()
 {
-       int const client_fd = support::socktools::accept(fd_);
+       int const client_fd = socktools::accept(fd_);
 
        if (fd_ == -1) {
                LYXERR(Debug::LYXSERVER, "lyx: Failed to accept new client");
index 7fec7336d8a5332b4bc7ad64cfd775a61bcfe128..05f02230ebe40a179ef31a0dbd85e9a5a893f91f 100644 (file)
@@ -22,6 +22,7 @@
 #include <iterator>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace {
 
@@ -37,10 +38,6 @@ string const sec_toolbars = "[toolbars]";
 
 namespace lyx {
 
-using support::absolutePath;
-using support::addName;
-using support::FileName;
-using support::package;
 
 LastFilesSection::LastFilesSection(unsigned int num) :
        default_num_last_files(4),
index c80886e9b7f914df9bb8eb1485784c3963cd5c87..1a09aba007efe76f00f38ea34c801b507f3bbb94 100644 (file)
@@ -191,7 +191,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
 
        cur.recordUndo();
        if (cmd.action == LFUN_INDEX_INSERT) {
-               docstring ds = support::subst(text->getStringToIndex(cur), '\n', ' ');
+               docstring ds = subst(text->getStringToIndex(cur), '\n', ' ');
                text->insertInset(cur, inset);
                if (edit)
                        inset->edit(cur, true);
@@ -1028,8 +1028,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                if (cmd.argument().empty())
                        break;
                docstring hexstring = cmd.argument();
-               if (lyx::support::isHex(hexstring)) {
-                       char_type c = lyx::support::hexToInt(hexstring);
+               if (isHex(hexstring)) {
+                       char_type c = hexToInt(hexstring);
                        if (c >= 32 && c < 0x10ffff) {
                                lyxerr << "Inserting c: " << c << endl;
                                docstring s = docstring(1, c);
index 4f97b89a110637e26d0a59be43f59f4e53f1bb26..a61c52f05ae5a838112244fcba1cd107d2afbe09 100644 (file)
@@ -69,15 +69,15 @@ bool layout2layout(FileName const & filename, FileName const & tempfile)
        }
 
        ostringstream command;
-       command << support::os::python() << ' ' << quoteName(script.toFilesystemEncoding())
+       command << os::python() << ' ' << quoteName(script.toFilesystemEncoding())
                << ' ' << quoteName(filename.toFilesystemEncoding())
                << ' ' << quoteName(tempfile.toFilesystemEncoding());
        string const command_str = command.str();
 
        LYXERR(Debug::TCLASS, "Running `" << command_str << '\'');
 
-       support::cmd_ret const ret =
-               support::runCommand(command_str);
+       cmd_ret const ret =
+               runCommand(command_str);
        if (ret.first != 0) {
                lyxerr << "Could not run layout conversion "
                          "script layout2layout.py." << endl;
@@ -433,7 +433,7 @@ bool TextClass::read(FileName const & filename, ReadType rt)
        if (format != FORMAT) {
                LYXERR(Debug::TCLASS, "Converting layout file from format "
                                      << format << " to " << FORMAT);
-               FileName const tempfile(support::tempName());
+               FileName const tempfile(tempName());
                error = !layout2layout(filename, tempfile);
                if (!error)
                        error = read(tempfile, rt);
index ea0bfbc447fa187b70a5652e8ffbc5d362f199e7..42d294ff58d06ecfc73ea7425ce1f1b62e96997e 100644 (file)
@@ -84,7 +84,7 @@ public:
 bool TextClassList::read()
 {
        Lexer lex(0, 0);
-       support::FileName const real_file = libFileSearch("", "textclass.lst");
+       FileName const real_file = libFileSearch("", "textclass.lst");
        LYXERR(Debug::TCLASS, "Reading textclasses from `" << real_file << '\'');
 
        if (real_file.empty()) {
index 4ba78080e7f850dcbe2cb5a7a0c889114cfdef88..d6f7ca1d675c3586c225efb72235ee4bb388ef24 100644 (file)
@@ -386,7 +386,7 @@ docstring const Trans::process(char_type c, TransManager & k)
 
 int Trans::load(string const & language)
 {
-       support::FileName const filename = libFileSearch("kbd", language, "kmap");
+       FileName const filename = libFileSearch("kbd", language, "kmap");
        if (filename.empty())
                return -1;
 
index 441e48c4fe990be18bd736233e9b9e1f0b9798e2..e65e7ae731c9fc61468e8f99b35a225f43b32f5b 100644 (file)
@@ -248,7 +248,7 @@ private:
 
 LyXDataSocket::LyXDataSocket(FileName const & address)
 {
-       if ((fd_ = support::socktools::connect(address)) == -1) {
+       if ((fd_ = socktools::connect(address)) == -1) {
                connected_ = false;
        } else {
                connected_ = true;
@@ -421,7 +421,7 @@ int h(vector<docstring> const &)
 
 
 docstring clientName =
-       from_ascii(support::itoa(::getppid()) + ">" + support::itoa(::getpid()));
+       from_ascii(itoa(::getppid()) + ">" + itoa(::getpid()));
 
 int n(vector<docstring> const & arg)
 {
@@ -553,7 +553,7 @@ int main(int argc, char * argv[])
        } else {
                // We have to look for an address.
                // serverPid can be empty.
-               vector<fs::path> addrs = support::lyxSockets(to_filesystem8bit(cmdline::mainTmp), cmdline::serverPid);
+               vector<fs::path> addrs = lyxSockets(to_filesystem8bit(cmdline::mainTmp), cmdline::serverPid);
                vector<fs::path>::const_iterator addr = addrs.begin();
                vector<fs::path>::const_iterator end = addrs.end();
                for (; addr != end; ++addr) {
index cf6f5f3ad958dc83845c89fdd81d3ee2f2420f22..a024a206eea4bba5833892cdbf4c5be23cf4aa8a 100644 (file)
@@ -146,7 +146,7 @@ LyXErr & operator<<(LyXErr & l, string const & t)
 { l.stream() << t; return l; }
 LyXErr & operator<<(LyXErr & l, docstring const & t)
 { l.stream() << to_utf8(t); return l; }
-LyXErr & operator<<(LyXErr & l, support::FileName const & t)
+LyXErr & operator<<(LyXErr & l, FileName const & t)
 { l.stream() << t; return l; }
 LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
 { l.stream() << t; return l; }
index 7eeaa238043bc26300331896390785d24662b5aa..d5c1ddd1f676f8a29447418410054d6919f2b8a3 100644 (file)
@@ -68,6 +68,7 @@
 #include <sstream>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -358,12 +359,12 @@ Inset * createInset(Buffer & buf, FuncRequest const & cmd)
                        break;
                }
 
-       } catch (support::ExceptionMessage const & message) {
-               if (message.type_ == support::ErrorException) {
+       } catch (ExceptionMessage const & message) {
+               if (message.type_ == ErrorException) {
                        Alert::error(message.title_, message.details_);
                        LyX::cref().emergencyCleanup();
                        abort();
-               } else if (message.type_ == support::WarningException) {
+               } else if (message.type_ == WarningException) {
                        Alert::warning(message.title_, message.details_);
                        return 0;
                }
index 10aeaa62a1e0a07a50949bd9fceb44e3bd6842c5..0a9d9e2e868ae1578068e1318102d4b9deb55070 100644 (file)
@@ -72,6 +72,7 @@
 #include <exception>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -127,8 +128,6 @@ public:
 ///////////////////////////////////////////////////////////////
 
 
-using support::FileName;
-
 GuiApplication * guiApp;
 
 
@@ -434,12 +433,12 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
        try {
                return QApplication::notify(receiver, event);
        }
-       catch (support::ExceptionMessage const & e) {
-               if (e.type_ == support::ErrorException) {
+       catch (ExceptionMessage const & e) {
+               if (e.type_ == ErrorException) {
                        Alert::error(e.title_, e.details_);
                        LyX::cref().emergencyCleanup();
                        QApplication::exit(1);
-               } else if (e.type_ == support::WarningException) {
+               } else if (e.type_ == WarningException) {
                        Alert::warning(e.title_, e.details_);
                        return false;
                }
@@ -483,7 +482,7 @@ bool GuiApplication::getRgbColor(ColorCode col, RGBColor & rgbcol)
 
 string const GuiApplication::hexName(ColorCode col)
 {
-       return support::ltrim(fromqstr(color_cache_.get(col).name()), "#");
+       return ltrim(fromqstr(color_cache_.get(col).name()), "#");
 }
 
 
index f0fbc7ccf4f64a46e0c2466cd3703294967564b3..fa5099d33f93a67300a7eadfcecaa6fba1a349c6 100644 (file)
@@ -41,6 +41,7 @@
 #include <vector>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 namespace frontend {
@@ -682,7 +683,7 @@ vector<docstring> GuiCitation::searchKeys(
 {
        vector<docstring> foundKeys;
 
-       docstring expr = support::trim(search_expression);
+       docstring expr = trim(search_expression);
        if (expr.empty())
                return foundKeys;
 
index 8a36a89ed96663533d9a78ec46076861bba0b6c5..d884e9b9f6bee74dfd9f7c522ffa5ff36b8ca946 100644 (file)
@@ -56,6 +56,7 @@
 #include <sstream>
 
 using namespace std;
+using namespace lyx::support;
 
 ///
 template<class Pair>
@@ -133,11 +134,6 @@ vector<pair<string, lyx::docstring> > pagestyles;
 namespace lyx {
 namespace frontend {
 
-using support::token;
-using support::bformat;
-using support::findToken;
-using support::getVectorFromString;
-
 /////////////////////////////////////////////////////////////////////
 //
 // PreambleModule
index 5c8f162066e4286af11032aa3f9061df9e48f538..3d53007248432ebd47fd00c68a519c94d05b1d26 100644 (file)
@@ -28,6 +28,7 @@
 #include <QFontDatabase>
 
 using namespace std;
+using namespace lyx::support;
 
 QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
        "eufm10", "msam10", "msbm10", "wasy10", "esint10"};
@@ -36,11 +37,6 @@ int const num_math_fonts = sizeof(math_fonts) / sizeof(*math_fonts);
 
 namespace lyx {
 
-using support::contains;
-using support::package;
-using support::addPath;
-using support::addName;
-
 extern docstring const stateText(FontInfo const & f);
 
 namespace frontend {
index 2c22d651070fc166e2f9a5758190441a11618d7c..75c78a6ee8335b71db7728e7935a009e57a27dec 100644 (file)
@@ -125,7 +125,7 @@ unsigned int GuiImage::height() const
 }
 
 
-void GuiImage::load(support::FileName const & filename)
+void GuiImage::load(FileName const & filename)
 {
        if (!original_.isNull()) {
                LYXERR(Debug::GRAPHICS, "Image is loaded already!");
index 7227064ab35a900219df051f3325545d606f0172..56b22d3a72a86119691cae41fd3c3f2107e24e5e 100644 (file)
@@ -167,7 +167,7 @@ void GuiPrint::applyView()
 
        params_ = PrinterParams(t,
                fromqstr(printerED->text()),
-               support::os::internal_path(fromqstr(fileED->text())),
+               os::internal_path(fromqstr(fileED->text())),
                allRB->isChecked(),
                fromED->text().toUInt(),
                toED->text().toUInt(),
@@ -183,7 +183,7 @@ void GuiPrint::applyView()
 bool GuiPrint::initialiseParams(string const &)
 {
        /// get global printer parameters
-       string const name = support::changeExtension(buffer().absFileName(),
+       string const name = changeExtension(buffer().absFileName(),
                                        lyxrc.print_file_extension);
        params_ = PrinterParams(PrinterParams::PRINTER, lyxrc.printer, name);
 
index c7c4c373191b9c5760ee2aaaad0432a6ddbf21bf..ac4e514fd7e3b23cc652832355990c00b551b487 100644 (file)
 #include <QCloseEvent>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 namespace frontend {
 
-using support::FileName;
-using support::onlyFilename;
 
 GuiShowFile::GuiShowFile(GuiView & lv)
        : GuiDialog(lv, "file")
index b9e37777ef129ea589b6e824b3916016f69e84f1..dfa5b8356bc7c145ca0bb42b3b08e98bdd3a46c5 100644 (file)
@@ -176,7 +176,7 @@ void GuiTexInfo::updateStyles(TexFileType type)
        vector<string>::iterator it1  = data.begin();
        vector<string>::iterator end1 = data.end();
        for (; it1 != end1; ++it1)
-               *it1 = support::onlyFilename(*it1);
+               *it1 = onlyFilename(*it1);
 
        // sort on filename only (no path)
        sort(data.begin(), data.end());
index 9aa758dcbfa58f5ea8fea7c96cfbdab1d698b6e1..ecba34a10d223bec8ba6f07ed085fbb63be15eb4 100644 (file)
@@ -51,6 +51,7 @@
 #include <boost/assert.hpp>
 
 using namespace std;
+using namespace lyx::support;
 
 static void initializeResources()
 {
@@ -65,11 +66,6 @@ static void initializeResources()
 namespace lyx {
 namespace frontend {
 
-using support::libFileSearch;
-using support::subst;
-using support::compare;
-
-
 namespace {
 
 struct PngMap {
index 21a323efb608c8e30f1a8ddbe6a981e39fecf2b8..af555a69bdb735fc6b0be25696a7a2d033e218c2 100644 (file)
@@ -451,7 +451,7 @@ void GuiView::dropEvent(QDropEvent* event)
 
        LYXERR(Debug::GUI, "GuiView::dropEvent: got URLs!");
        for (int i = 0; i != files.size(); ++i) {
-               string const file = support::os::internal_path(fromqstr(
+               string const file = os::internal_path(fromqstr(
                        files.at(i).toLocalFile()));
                if (!file.empty())
                        lyx::dispatch(FuncRequest(LFUN_FILE_OPEN, file));
@@ -1176,10 +1176,10 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
                dlg.setButton1(_("Documents|#o#O"), from_utf8(lyxrc.document_path));
                dlg.setButton2(_("Templates|#T#t"), from_utf8(lyxrc.template_path));
 
-               if (!support::isLyXFilename(fname.absFilename()))
+               if (!isLyXFilename(fname.absFilename()))
                        fname.changeExtension(".lyx");
 
-               support::FileFilterList const filter(_("LyX Documents (*.lyx)"));
+               FileFilterList const filter(_("LyX Documents (*.lyx)"));
 
                FileDialog::Result result =
                        dlg.save(from_utf8(fname.onlyPath().absFilename()),
@@ -1194,7 +1194,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
                if (fname.empty())
                        return false;
 
-               if (!support::isLyXFilename(fname.absFilename()))
+               if (!isLyXFilename(fname.absFilename()))
                        fname.changeExtension(".lyx");
        }
 
index 933a86b485ad5cf2f511e13321e4340c1e4a14f0..77aaa9bf2732e9e5a87918795e211f6b279248ce 100644 (file)
@@ -452,7 +452,7 @@ void GuiWorkArea::toggleCursor()
        // Use this opportunity to deal with any child processes that
        // have finished but are waiting to communicate this fact
        // to the rest of LyX.
-       support::ForkedCallsController::handleCompletedProcesses();
+       ForkedCallsController::handleCompletedProcesses();
 }
 
 
index df7cdd1895c12853e875b60624de2f5ed1fa3336..3b09d9a941b6a3b25fde97c44535f23d9ad5a632 100644 (file)
@@ -306,11 +306,11 @@ docstring browseDir(docstring const & pathname, docstring const & title,
 void rescanTexStyles()
 {
        // Run rescan in user lyx directory
-       support::PathChanger p(package().user_support());
+       PathChanger p(package().user_support());
        FileName const command = libFileSearch("scripts", "TeXFiles.py");
        Systemcall one;
        int const status = one.startscript(Systemcall::Wait,
-                       support::os::python() + ' ' +
+                       os::python() + ' ' +
                        quoteName(command.toFilesystemEncoding()));
        if (status == 0)
                return;
index 817768e489f21d5686ae0578f018a985dbabca50..1f00028ce7a9b2561cb98187083c70c73cc45409 100644 (file)
@@ -159,7 +159,7 @@ Converter::Impl::Impl(FileName const & from_file, string const & to_file_base,
        // We create a dummy command for ease of understanding of the
        // list of forked processes.
        // Note: 'python ' is absolutely essential, or execvp will fail.
-       script_command_ = support::os::python() + ' ' +
+       script_command_ = os::python() + ' ' +
                quoteName(script_file_.toFilesystemEncoding()) + ' ' +
                quoteName(onlyFilename(from_file.toFilesystemEncoding())) + ' ' +
                quoteName(to_format);
@@ -176,7 +176,7 @@ void Converter::Impl::startConversion()
        }
 
        ForkedCall::SignalTypePtr ptr =
-               support::ForkedCallQueue::add(script_command_);
+               ForkedCallQueue::add(script_command_);
        ptr->connect(boost::bind(&Impl::converted, this, _1, _2));
 }
 
@@ -325,7 +325,7 @@ static void build_script(FileName const & from_file,
                       << quoteName(to_file, quote_python) << ")\n";
 
                ostringstream os;
-               os << support::os::python() << ' '
+               os << os::python() << ' '
                   << libScriptSearch("$$s/scripts/convertDefault.py",
                                      quote_python) << ' ';
                if (!from_format.empty())
index 4c668120ebcf57fe69e769c3906fa202559b8cc7..32bbed0a7129ae83a1f06742df5aaaaeaafbd22c 100644 (file)
@@ -63,7 +63,7 @@ string const unique_filename(string const & bufferpath)
 {
        static int theCounter = 0;
        string const filename = lyx::convert<string>(theCounter++) + "lyxpreview";
-       return lyx::support::addName(bufferpath, filename);
+       return addName(bufferpath, filename);
 }
 
 
@@ -369,7 +369,7 @@ InProgress::InProgress(string const & filename_base,
 void InProgress::stop() const
 {
        if (pid)
-               lyx::support::ForkedCallsController::kill(pid, 0);
+               ForkedCallsController::kill(pid, 0);
 
        if (!metrics_file.empty())
                metrics_file.removeFile();
@@ -469,7 +469,7 @@ void PreviewLoader::Impl::add(string const & latex_snippet)
        if (!pconverter_ || status(latex_snippet) != NotFound)
                return;
 
-       string const snippet = support::trim(latex_snippet);
+       string const snippet = trim(latex_snippet);
        if (snippet.empty())
                return;
 
@@ -584,19 +584,19 @@ void PreviewLoader::Impl::startLoading()
        // The conversion command.
        ostringstream cs;
        cs << pconverter_->command << ' ' << pconverter_->to << ' '
-          << support::quoteName(latexfile.toFilesystemEncoding()) << ' '
+          << quoteName(latexfile.toFilesystemEncoding()) << ' '
           << int(font_scaling_factor_) << ' '
           << theApp()->hexName(Color_preview) << ' '
           << theApp()->hexName(Color_background);
 
-       string const command = support::libScriptSearch(cs.str());
+       string const command = libScriptSearch(cs.str());
 
        // Initiate the conversion from LaTeX to bitmap images files.
-       support::ForkedCall::SignalTypePtr
-               convert_ptr(new support::ForkedCall::SignalType);
+       ForkedCall::SignalTypePtr
+               convert_ptr(new ForkedCall::SignalType);
        convert_ptr->connect(bind(&Impl::finishedGenerating, this, _1, _2));
 
-       support::ForkedCall call;
+       ForkedCall call;
        int ret = call.startScript(command, convert_ptr);
 
        if (ret != 0) {
index 7831f76bc44e60a7f77fe2da2d7f0d063e58cadc..075313667e8ed1c1d12604d8b1950b981a4801ad 100644 (file)
@@ -62,8 +62,8 @@ string const subst_path(string const & input,
                        string const & placeholder,
                        string const & path,
                        bool use_latex_path,
-                       support::latex_path_extension ext = support::PROTECT_EXTENSION,
-                       support::latex_path_dots dots = support::LEAVE_DOTS)
+                       latex_path_extension ext = PROTECT_EXTENSION,
+                       latex_path_dots dots = LEAVE_DOTS)
 {
        if (input.find(placeholder) == string::npos)
                return input;
@@ -71,8 +71,8 @@ string const subst_path(string const & input,
        // path will be compared with another one in internal style later
        // in Converters::move.
        string const path2 = use_latex_path ?
-               support::latex_path(path, ext, dots) : path;
-       return support::subst(input, placeholder, path2);
+               latex_path(path, ext, dots) : path;
+       return subst(input, placeholder, path2);
 }
 
 } // namespace anon
@@ -91,64 +91,64 @@ string const doSubstitution(InsetExternalParams const & params,
        string const filename = external_in_tmpdir ?
                params.filename.mangledFilename() :
                params.filename.outputFilename(parentpath);
-       string const basename = support::changeExtension(
-                       support::onlyFilename(filename), string());
-       string const absname = support::makeAbsPath(filename, parentpath).absFilename();
+       string const basename = changeExtension(
+                       onlyFilename(filename), string());
+       string const absname = makeAbsPath(filename, parentpath).absFilename();
 
        string result = s;
        if (what != ALL_BUT_PATHS) {
-               string const filepath = support::onlyPath(filename);
-               string const abspath = support::onlyPath(absname);
+               string const filepath = onlyPath(filename);
+               string const abspath = onlyPath(absname);
                string const masterpath = external_in_tmpdir ?
                        masterBuffer->temppath() :
                        masterBuffer->filePath();
                // FIXME UNICODE
-               string relToMasterPath = support::onlyPath(
-                               to_utf8(support::makeRelPath(from_utf8(absname),
+               string relToMasterPath = onlyPath(
+                               to_utf8(makeRelPath(from_utf8(absname),
                                                             from_utf8(masterpath))));
                if (relToMasterPath == "./")
                        relToMasterPath.clear();
                // FIXME UNICODE
-               string relToParentPath = support::onlyPath(
-                               to_utf8(support::makeRelPath(from_utf8(absname),
+               string relToParentPath = onlyPath(
+                               to_utf8(makeRelPath(from_utf8(absname),
                                                             from_utf8(parentpath))));
                if (relToParentPath == "./")
                        relToParentPath.clear();
 
                result = subst_path(result, "$$FPath", filepath,
                                    use_latex_path,
-                                   support::PROTECT_EXTENSION,
-                                   support::ESCAPE_DOTS);
+                                   PROTECT_EXTENSION,
+                                   ESCAPE_DOTS);
                result = subst_path(result, "$$AbsPath", abspath,
                                    use_latex_path,
-                                   support::PROTECT_EXTENSION,
-                                   support::ESCAPE_DOTS);
+                                   PROTECT_EXTENSION,
+                                   ESCAPE_DOTS);
                result = subst_path(result, "$$RelPathMaster",
                                    relToMasterPath, use_latex_path,
-                                   support::PROTECT_EXTENSION,
-                                   support::ESCAPE_DOTS);
+                                   PROTECT_EXTENSION,
+                                   ESCAPE_DOTS);
                result = subst_path(result, "$$RelPathParent",
                                    relToParentPath, use_latex_path,
-                                   support::PROTECT_EXTENSION,
-                                   support::ESCAPE_DOTS);
-               if (support::absolutePath(filename)) {
+                                   PROTECT_EXTENSION,
+                                   ESCAPE_DOTS);
+               if (absolutePath(filename)) {
                        result = subst_path(result, "$$AbsOrRelPathMaster",
                                            abspath, use_latex_path,
-                                           support::PROTECT_EXTENSION,
-                                           support::ESCAPE_DOTS);
+                                           PROTECT_EXTENSION,
+                                           ESCAPE_DOTS);
                        result = subst_path(result, "$$AbsOrRelPathParent",
                                            abspath, use_latex_path,
-                                           support::PROTECT_EXTENSION,
-                                           support::ESCAPE_DOTS);
+                                           PROTECT_EXTENSION,
+                                           ESCAPE_DOTS);
                } else {
                        result = subst_path(result, "$$AbsOrRelPathMaster",
                                            relToMasterPath, use_latex_path,
-                                           support::PROTECT_EXTENSION,
-                                           support::ESCAPE_DOTS);
+                                           PROTECT_EXTENSION,
+                                           ESCAPE_DOTS);
                        result = subst_path(result, "$$AbsOrRelPathParent",
                                            relToParentPath, use_latex_path,
-                                           support::PROTECT_EXTENSION,
-                                           support::ESCAPE_DOTS);
+                                           PROTECT_EXTENSION,
+                                           ESCAPE_DOTS);
                }
        }
 
@@ -156,17 +156,17 @@ string const doSubstitution(InsetExternalParams const & params,
                return result;
 
        result = subst_path(result, "$$FName", filename, use_latex_path,
-                           support::EXCLUDE_EXTENSION);
+                           EXCLUDE_EXTENSION);
        result = subst_path(result, "$$Basename", basename, use_latex_path,
-                           support::PROTECT_EXTENSION, support::ESCAPE_DOTS);
+                           PROTECT_EXTENSION, ESCAPE_DOTS);
        result = subst_path(result, "$$Extension",
-                       '.' + support::getExtension(filename), use_latex_path);
+                       '.' + getExtension(filename), use_latex_path);
        result = subst_path(result, "$$Tempname", params.tempname().absFilename(), use_latex_path);
        result = subst_path(result, "$$Sysdir",
-                               support::package().system_support().absFilename(), use_latex_path);
+                               package().system_support().absFilename(), use_latex_path);
 
        // Handle the $$Contents(filename) syntax
-       if (support::contains(result, "$$Contents(\"")) {
+       if (contains(result, "$$Contents(\"")) {
                // Since use_latex_path may be true we must extract the file
                // name from s instead of result and do the substitutions
                // again, this time with use_latex_path false.
@@ -179,7 +179,7 @@ string const doSubstitution(InsetExternalParams const & params,
                string contents;
 
                FileName const absfile(
-                       support::makeAbsPath(file, masterBuffer->temppath()));
+                       makeAbsPath(file, masterBuffer->temppath()));
                if (absfile.isReadableFile())
                        // FIXME UNICODE
                        contents = to_utf8(absfile.fileContents("UTF-8"));
@@ -247,7 +247,7 @@ void updateExternal(InsetExternalParams const & params,
        // We copy the source file to the temp dir and do the conversion
        // there if necessary
        FileName const temp_file(
-               support::makeAbsPath(params.filename.mangledFilename(),
+               makeAbsPath(params.filename.mangledFilename(),
                                     masterBuffer->temppath()));
        if (!params.filename.empty() && !params.filename.isDirectory()) {
                unsigned long const from_checksum = params.filename.checksum();
@@ -268,7 +268,7 @@ void updateExternal(InsetExternalParams const & params,
                                              outputFormat.updateResult,
                                              false, true);
        FileName const abs_to_file(
-               support::makeAbsPath(to_file, masterBuffer->temppath()));
+               makeAbsPath(to_file, masterBuffer->temppath()));
 
        if (!dryrun) {
                // Record the referenced files for the exporter.
@@ -280,7 +280,7 @@ void updateExternal(InsetExternalParams const & params,
                        vector<string>::const_iterator fit  = rit->second.begin();
                        vector<string>::const_iterator fend = rit->second.end();
                        for (; fit != fend; ++fit) {
-                               FileName const source(support::makeAbsPath(
+                               FileName const source(makeAbsPath(
                                                doSubstitution(params, buffer, *fit,
                                                               false, true),
                                                masterBuffer->temppath()));
@@ -288,7 +288,7 @@ void updateExternal(InsetExternalParams const & params,
                                // temp path, but the filename may be the mangled
                                // or the real name. Therefore we substitute the
                                // paths and names separately.
-                               string file = support::subst(*fit, "$$FName",
+                               string file = subst(*fit, "$$FName",
                                                "$$FPath$$Basename$$Extension");
                                file = doSubstitution(params, buffer, file, false, false,
                                                      PATHS);
@@ -304,7 +304,7 @@ void updateExternal(InsetExternalParams const & params,
 
        // Do we need to perform the conversion?
        // Yes if to_file does not exist or if from_file is newer than to_file
-       if (support::compare_timestamps(temp_file, abs_to_file) < 0)
+       if (compare_timestamps(temp_file, abs_to_file) < 0)
                return; // SUCCESS
 
        // FIXME (Abdel 12/08/06): Is there a need to show these errors?
@@ -351,7 +351,7 @@ int writeExternal(InsetExternalParams const & params,
                return 0;
        }
 
-       if (!dryrun || support::contains(cit->second.product, "$$Contents"))
+       if (!dryrun || contains(cit->second.product, "$$Contents"))
                updateExternal(params, format, buffer, exportdata,
                               external_in_tmpdir, dryrun);
 
@@ -359,7 +359,7 @@ int writeExternal(InsetExternalParams const & params,
        string str = doSubstitution(params, buffer, cit->second.product,
                                    use_latex_path, external_in_tmpdir);
 
-       string const absname = support::makeAbsPath(
+       string const absname = makeAbsPath(
                params.filename.outputFilename(buffer.filePath()), buffer.filePath()).absFilename();
 
        if (!external_in_tmpdir && !isValidLaTeXFilename(absname)) {
@@ -411,8 +411,8 @@ string const substituteIt<TransformCommand>(string const & input,
                return input;
 
        string result =
-               support::subst(input, ptr->front_placeholder(), ptr->front());
-       return support::subst(result, ptr->back_placeholder(),  ptr->back());
+               subst(input, ptr->front_placeholder(), ptr->front());
+       return subst(result, ptr->back_placeholder(),  ptr->back());
 }
 
 
@@ -449,7 +449,7 @@ string const substituteIt<TransformOption>(string const & input,
        if (!ptr.get())
                return input;
 
-       return support::subst(input, ptr->placeholder(), ptr->option());
+       return subst(input, ptr->placeholder(), ptr->option());
 }
 
 
@@ -519,7 +519,7 @@ string const substituteOptions(InsetExternalParams const & params,
        for (; it != end; ++it) {
                string const opt = substituteOption(params, it->option, format);
                string const placeholder = "$$" + it->name;
-               output = support::subst(output, placeholder, opt);
+               output = subst(output, placeholder, opt);
        }
 
        return output;
index efc9b8c4f94a73fc812ad349383d86165f2c3e47..01600c07ba9e0fca9c67badaa216d670663553e8 100644 (file)
@@ -24,6 +24,7 @@
 #include <ostream>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 namespace external {
@@ -59,7 +60,7 @@ Template::Format::Format()
 
 TemplateManager::TemplateManager()
 {
-       readTemplates(support::package().user_support());
+       readTemplates(package().user_support());
        if (lyxerr.debugging(Debug::EXTERNAL)) {
                dumpPreambleDefs(lyxerr);
                lyxerr << '\n';
@@ -219,7 +220,7 @@ TemplateManager::getTemplateByName(string const & name) const
 string const
 TemplateManager::getPreambleDefByName(string const & name) const
 {
-       string const trimmed_name = support::trim(name);
+       string const trimmed_name = trim(name);
        if (trimmed_name.empty())
                return string();
 
@@ -231,9 +232,9 @@ TemplateManager::getPreambleDefByName(string const & name) const
 }
 
 
-void TemplateManager::readTemplates(support::FileName const & path)
+void TemplateManager::readTemplates(FileName const & path)
 {
-       support::PathChanger p(path);
+       PathChanger p(path);
 
        enum TemplateTags {
                TM_PREAMBLEDEF = 1,
@@ -251,7 +252,7 @@ void TemplateManager::readTemplates(support::FileName const & path)
 
        Lexer lex(templatetags, TM_TEMPLATE_END);
 
-       support::FileName const filename = support::libFileSearch("", "external_templates");
+       FileName const filename = libFileSearch("", "external_templates");
        if (filename.empty() || !lex.setFile(filename)) {
                lex.printError("external::TemplateManager::readTemplates: "
                               "No template file");
index 2ca1fceda3c50be6365d50e83a0d88a863358639..ca1c5c5443ca66c5bdfe0d334db36fa83c940f0b 100644 (file)
@@ -317,7 +317,7 @@ string const sanitizeLatexOption(string const & input)
        output = what.str(1);
 
        // Remove any surrounding whitespace
-       output = support::trim(output);
+       output = trim(output);
 
        // If the thing is empty, leave it so, else wrap it in square brackets.
        return output.empty() ? output : "[" + output + "]";
index c8b11cd3b4ec77fa115d6b58bddc3d7780a57b9c..db5bc53e4ec9ec8d454f9db54390529e92d56a0e 100644 (file)
@@ -32,6 +32,7 @@
 #include <ostream>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -95,7 +96,7 @@ void InsetBibitem::read(Buffer const & buf, Lexer & lex)
 {
        InsetCommand::read(buf, lex);
 
-       if (support::prefixIs(getParam("key"), key_prefix)) {
+       if (prefixIs(getParam("key"), key_prefix)) {
                int const key = convert<int>(getParam("key").substr(key_prefix.length()));
                key_counter = max(key_counter, key);
        }
index 434bb0b0a4168146c8eef399699436dd21045ba1..0c6ee63bb11ae04866aafee390cc7c603b184f0e 100644 (file)
@@ -81,8 +81,8 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
                                cur.noUpdate();
                                break;
                        }
-               } catch (support::ExceptionMessage const & message) {
-                       if (message.type_ == support::WarningException) {
+               } catch (ExceptionMessage const & message) {
+                       if (message.type_ == WarningException) {
                                Alert::warning(message.title_, message.details_);
                                cur.noUpdate();
                        } else 
@@ -309,7 +309,7 @@ int InsetBibtex::latex(Buffer const & buffer, odocstream & os,
 FileNameList const InsetBibtex::getFiles(Buffer const & buffer) const
 {
        FileName path(buffer.filePath());
-       support::PathChanger p(path);
+       PathChanger p(path);
 
        FileNameList vec;
 
index b50d89356bbd7b4c067a2832616ab4747e287050..f741289801e583f9a413af9aa51dfc119e7949b1 100644 (file)
@@ -42,6 +42,7 @@
 #include <sstream>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -101,7 +102,7 @@ void InsetCaption::cursorPos(BufferView const & bv,
 
 void InsetCaption::setCustomLabel(docstring const & label)
 {
-       if (!support::isAscii(label) || label.empty())
+       if (!isAscii(label) || label.empty())
                // This must be a user defined layout. We cannot translate
                // this, since gettext accepts only ascii keys.
                custom_label_ = label;
@@ -270,7 +271,6 @@ int InsetCaption::getOptArg(Buffer const & buf, odocstream & os,
 
 void InsetCaption::updateLabels(Buffer const & buf, ParIterator const & it)
 {
-       using support::bformat;
        TextClass const & tclass = buf.params().getTextClass();
        Counters & cnts = tclass.counters();
        string const & type = cnts.current_float();
index 8a87042fa1b5878fb02263f136183eda937b6fab..b7faae15e23b385f93399500fedcd144e69c2248 100644 (file)
@@ -333,8 +333,6 @@ docstring const getNatbibLabel(Buffer const & buffer,
 
 docstring const getBasicLabel(docstring const & keyList, docstring const & after)
 {
-       using support::contains;
-
        docstring keys = keyList;
        docstring label;
 
index ff4e19c9906643a6dc151d7be05d66e2146b0ddd..8fb3ba80b799b0fdc09f316be2e3687a0e94da94 100644 (file)
@@ -65,11 +65,11 @@ namespace external {
 
 TempName::TempName()
 {
-       support::FileName const tempname(support::tempName(support::FileName(), "lyxext"));
+       FileName const tempname(tempName(FileName(), "lyxext"));
        // FIXME: This is unsafe
        tempname.removeFile();
        // must have an extension for the converter code to work correctly.
-       tempname_ = support::FileName(tempname.absFilename() + ".tmp");
+       tempname_ = FileName(tempname.absFilename() + ".tmp");
 }
 
 
@@ -224,7 +224,6 @@ void InsetExternalParams::write(Buffer const & buffer, ostream & os) const
        }
 
        if (!resizedata.no_resize()) {
-               using support::float_equal;
                double const scl = convert<double>(resizedata.scale);
                if (!float_equal(scl, 0.0, 0.05)) {
                        if (!float_equal(scl, 100.0, 0.05))
@@ -587,7 +586,7 @@ docstring const getScreenLabel(InsetExternalParams const & params,
                external::getTemplatePtr(params);
        if (!ptr)
                // FIXME UNICODE
-               return support::bformat((_("External template %1$s is not installed")),
+               return bformat((_("External template %1$s is not installed")),
                                        from_utf8(params.templatename()));
        // FIXME UNICODE
        docstring gui = _(ptr->guiName);
index 7e98a60109642c139270289c7f005cb7ab249e1e..3b33d9957f5d3a0cfa62b1c9eb6a2166dd08790e 100644 (file)
@@ -484,7 +484,7 @@ copyFileIfNeeded(FileName const & file_in, FileName const & file_out)
        if (!success) {
                // FIXME UNICODE
                LYXERR(Debug::GRAPHICS,
-                       to_utf8(support::bformat(_("Could not copy the file\n%1$s\n"
+                       to_utf8(bformat(_("Could not copy the file\n%1$s\n"
                                                           "into the temporary directory."),
                                                from_utf8(file_in.absFilename()))));
        }
@@ -497,11 +497,9 @@ copyFileIfNeeded(FileName const & file_in, FileName const & file_out)
 pair<GraphicsCopyStatus, FileName> const
 copyToDirIfNeeded(DocFileName const & file, string const & dir)
 {
-       using support::rtrim;
-
        string const file_in = file.absFilename();
-       string const only_path = support::onlyPath(file_in);
-       if (rtrim(support::onlyPath(file_in) , "/") == rtrim(dir, "/"))
+       string const only_path = onlyPath(file_in);
+       if (rtrim(onlyPath(file_in) , "/") == rtrim(dir, "/"))
                return make_pair(IDENTICAL_PATHS, file_in);
 
        string mangled = file.mangledFilename();
@@ -516,7 +514,7 @@ copyToDirIfNeeded(DocFileName const & file, string const & dir)
                string::size_type const ext_len = file_in.length() - base.length();
                mangled[mangled.length() - ext_len] = '.';
        }
-       FileName const file_out(support::makeAbsPath(mangled, dir));
+       FileName const file_out(makeAbsPath(mangled, dir));
 
        return copyFileIfNeeded(file, file_out);
 }
@@ -535,13 +533,10 @@ string const stripExtensionIfPossible(string const & file, bool nice)
        // dots with a macro whose definition is just a dot ;-)
        // The automatic format selection does not work if the file
        // name is escaped.
-       string const latex_name = latex_path(file,
-                                            support::EXCLUDE_EXTENSION);
+       string const latex_name = latex_path(file, EXCLUDE_EXTENSION);
        if (!nice || contains(latex_name, '"'))
                return latex_name;
-       return latex_path(removeExtension(file),
-                         support::PROTECT_EXTENSION,
-                         support::ESCAPE_DOTS);
+       return latex_path(removeExtension(file), PROTECT_EXTENSION, ESCAPE_DOTS);
 }
 
 
@@ -556,7 +551,7 @@ string const stripExtensionIfPossible(string const & file, string const & to, bo
            (to_format == "eps" && file_format ==  "ps") ||
            (to_format ==  "ps" && file_format == "eps"))
                return stripExtensionIfPossible(file, nice);
-       return latex_path(file, support::EXCLUDE_EXTENSION);
+       return latex_path(file, EXCLUDE_EXTENSION);
 }
 
 } // namespace anon
@@ -654,8 +649,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
                                        source_file, output_file);
                        // We can't strip the extension, because we don't know
                        // the unzipped file format
-                       return latex_path(output_file,
-                                         support::EXCLUDE_EXTENSION);
+                       return latex_path(output_file, EXCLUDE_EXTENSION);
                }
 
                FileName const unzipped_temp_file =
@@ -694,7 +688,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
                        // the file format from the extension, so we must
                        // change it.
                        FileName const new_file = FileName(changeExtension(temp_file.absFilename(), ext));
-                       if (support::rename(temp_file, new_file)) {
+                       if (rename(temp_file, new_file)) {
                                temp_file = new_file;
                                output_file = changeExtension(output_file, ext);
                                source_file = FileName(changeExtension(source_file.absFilename(), ext));
index 07488dfa6a5c5a9f74a9fecbfd08bf46930daba6..b0cf6dfcf55e00d05c2c85f55666c8d897b606f5 100644 (file)
@@ -23,6 +23,7 @@
 #include "support/lyxalgo.h"
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -88,7 +89,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
 int InsetLabel::latex(Buffer const &, odocstream & os,
                      OutputParams const &) const
 {
-       os << support::escape(getCommand());
+       os << escape(getCommand());
        return 0;
 }
 
index e83eaeb9a7f75e499a69092740c1b64304836d8f..cc542399c23aa01d5f53f57f12aa5bf72bdcfa57 100644 (file)
 #include <sstream>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
-using support::bformat;
-
 namespace {
 
 docstring verboseHLine(int n)
@@ -1419,7 +1418,7 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
                        status.enable(false);
                        break;
                }
-               if (!support::contains("tcb", cmd.argument()[0])) {
+               if (!contains("tcb", cmd.argument()[0])) {
                        status.enable(false);
                        break;
                }
index 5a15104f83f7e2ad6e0802ba3c1bd05ff2425cdb..d099a762d73d4eda8d1fb751c074f4d47be154d5 100644 (file)
@@ -1105,7 +1105,7 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd)
                        docstring str = p["name"];
                        cur.recordUndoInset();
                        row_type const r = (type_ == hullMultline) ? nrows() - 1 : cur.row();
-                       str = support::trim(str);
+                       str = trim(str);
                        if (!str.empty())
                                numbered(r, true);
                        docstring old = label(r);
index c1f9c7032c206f869b447cede95ca8c79ce23ccf..0844b4d8a9ad8c3bc6c9794925c651653fbc64b5 100644 (file)
@@ -60,6 +60,7 @@
 #include <sstream>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -922,7 +923,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_MATH_DELIM: {
                docstring ls;
-               docstring rs = support::split(cmd.argument(), ls, ' ');
+               docstring rs = split(cmd.argument(), ls, ' ');
                // Reasonable default values
                if (ls.empty())
                        ls = '(';
index 94e5c330a3a165b7e3f6f2ce7ed91662ac5d173a..19275c6925d454a05dc3764edc0a404383247fc1 100644 (file)
@@ -1427,7 +1427,7 @@ MathData pipeThroughExtern(string const & lang, docstring const & extra,
        string data = to_utf8(os.str());
 
        // search external script
-       support::FileName const file = libFileSearch("mathed", "extern_" + lang);
+       FileName const file = libFileSearch("mathed", "extern_" + lang);
        if (file.empty()) {
                lyxerr << "converter to '" << lang << "' not found" << endl;
                return MathData();
index 2025bd46c8d4feb1b26398f21bf93f87d753bf71..a3a77d1123d141ea9a7679d1df977f3fa2463ae5 100644 (file)
@@ -96,7 +96,7 @@ bool math_font_available(docstring & name)
 
 void initSymbols()
 {
-       support::FileName const filename = libFileSearch(string(), "symbols");
+       FileName const filename = libFileSearch(string(), "symbols");
        LYXERR(Debug::MATHED, "read symbols from " << filename);
        if (filename.empty()) {
                lyxerr << "Could not find symbols file" << endl;
index ddf90ccebde42b69de573caf488d7a5f0a498b95..21f2dea3a085720fa481c2aba7fd5f3d00d56df5 100644 (file)
@@ -172,7 +172,7 @@ LyXErr & operator<<(LyXErr & l, string const & t)
 { if (l.enabled()) l.stream() << t; return l; }
 LyXErr & operator<<(LyXErr & l, docstring const & t)
 { if (l.enabled()) l.stream() << to_utf8(t); return l; }
-LyXErr & operator<<(LyXErr & l, support::FileName const & t)
+LyXErr & operator<<(LyXErr & l, FileName const & t)
 { if (l.enabled()) l.stream() << t; return l; }
 LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
 { if (l.enabled()) l.stream() << t; return l; }
index 4d39b22efe60816db0bfa59e808ad6acf15e9f7b..8a59d40d4f78e7957ee6275b59f6b327ef646e0f 100644 (file)
@@ -596,8 +596,8 @@ protected:
                        for (; iit != eit; ++iit) {
                                s += *iit;
                                ++n;
-                               bool true_ok = lyx::support::prefixIs(truename, s);
-                               bool false_ok = lyx::support::prefixIs(falsename, s);
+                               bool true_ok = prefixIs(truename, s);
+                               bool false_ok = prefixIs(falsename, s);
                                if (!true_ok && !false_ok) {
                                        ++iit;
                                        ok = false;
index ff3c85d114a7b1892311b3cc6a59db2caa22c6d4..e2cc1b5e704e771a303428bb7679ef62e0dec8bd 100644 (file)
@@ -18,6 +18,7 @@
 #include <iostream>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -206,7 +207,7 @@ void Context::new_paragraph(ostream & os)
 
 void Context::add_extra_stuff(string const & stuff)
 {
-       if (!lyx::support::contains(extra_stuff, stuff))
+       if (!contains(extra_stuff, stuff))
                extra_stuff += stuff;
 }
 
index 86a57087b27b1114d7d1bd39b8619c7671c0b4cc..8a884713d528b4ce7a1bd93a9e870689c650e240 100644 (file)
@@ -649,7 +649,7 @@ TextClass const parse_preamble(Parser & p, ostream & os, string const & forcecla
        // Force textclass if the user wanted it
        if (!forceclass.empty())
                h_textclass = forceclass;
-       if (noweb_mode && !lyx::support::prefixIs(h_textclass, "literate-"))
+       if (noweb_mode && !prefixIs(h_textclass, "literate-"))
                h_textclass.insert(0, "literate-");
        FileName layoutfilename = libFileSearch("layouts", h_textclass, "layout");
        if (layoutfilename.empty()) {
index 2f26838adff01d67086170b1851927a128d2abe6..f873845aa768c63a04ec3adc34a6ee99d8477304 100644 (file)
@@ -486,15 +486,15 @@ int main(int argc, char * argv[])
                return 2;
        }
 
-       lyx::support::os::init(argc, argv);
+       os::init(argc, argv);
 
-       try { support::init_package(internal_path(to_utf8(from_local8bit(argv[0]))),
+       try { init_package(internal_path(to_utf8(from_local8bit(argv[0]))),
                cl_system_support, cl_user_support,
-               support::top_build_dir_is_two_levels_up);
-       } catch (support::ExceptionMessage const & message) {
+               top_build_dir_is_two_levels_up);
+       } catch (ExceptionMessage const & message) {
                cerr << to_utf8(message.title_) << ":\n"
                        << to_utf8(message.details_) << endl;
-               if (message.type_ == support::ErrorException)
+               if (message.type_ == ErrorException)
                        exit(1);
        }
        
@@ -511,7 +511,7 @@ int main(int argc, char * argv[])
        } else
                outfilename = changeExtension(infilename, ".lyx");
 
-       FileName const system_syntaxfile = lyx::support::libFileSearch("", "syntax.default");
+       FileName const system_syntaxfile = libFileSearch("", "syntax.default");
        if (system_syntaxfile.empty()) {
                cerr << "Error: Could not find syntax file \"syntax.default\"." << endl;
                exit(1);
index e1559f031df5c4552d09dac2a1f7b3a0f3d7f7cb..dd7cd54f7c221f5eb0e4c08ec360fdd7bf99b3f0 100644 (file)
@@ -248,7 +248,7 @@ bool splitLatexLength(string const & len, string & value, string & unit)
        if (contains(len, '\\'))
                unit = trim(string(len, i));
        else
-               unit = support::ascii_lowercase(trim(string(len, i)));
+               unit = ascii_lowercase(trim(string(len, i)));
        return true;
 }
 
@@ -1029,7 +1029,7 @@ string const normalize_filename(string const & name)
 /// convention (relative to .lyx file) if it is relative
 void fix_relative_filename(string & name)
 {
-       if (lyx::support::absolutePath(name))
+       if (absolutePath(name))
                return;
        // FIXME UNICODE encoding of name may be wrong (makeAbsPath expects
        // utf8)