]> git.lyx.org Git - lyx.git/blobdiff - src/support/Messages.cpp
zipunzip.cpp: Replace makedir etc with versions in support::FileName, fix a bug in...
[lyx.git] / src / support / Messages.cpp
index 1af0503e861fec9538a7fc780846afaa5de5119d..5d2a554d83917cc0ae1b8a226e28d98e9acc2fc2 100644 (file)
 #include "support/unicode.h"
 
 #include <boost/assert.hpp>
-#include <boost/current_function.hpp>
 
 #include <cerrno>
 
-using std::map;
-using std::string;
+using namespace std;
 
 namespace {
 
@@ -62,25 +60,21 @@ void cleanTranslation(docstring & trans)
 #  if HAVE_GETTEXT
 #    include <libintl.h>      // use the header already in the system *EK*
 #  else
-#    include "../../intl/libintl.h"
+#    include "../intl/libintl.h"
 #  endif
 
-namespace lyx {
-
-using support::package;
-using support::getEnv;
-using support::setEnv;
+using namespace lyx::support;
 
+namespace lyx {
 
 // This version use the traditional gettext.
 Messages::Messages(string const & l)
        : lang_(l), warned_(false)
 {
        // strip off any encoding suffix, i.e., assume 8-bit po files
-       string::size_type i = lang_.find(".");
+       size_t i = lang_.find(".");
        lang_ = lang_.substr(0, i);
-       LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
-               << ": language(" << lang_ << ")");
+       LYXERR(Debug::DEBUG, "language(" << lang_ << ")");
 }
 
 
@@ -91,16 +85,14 @@ void Messages::init()
        char const * c = bindtextdomain(PACKAGE, locale_dir.c_str());
        int e = errno;
        if (e) {
-               LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
-                       << "Error code: " << errno << '\n'
+               LYXERR(Debug::DEBUG, "Error code: " << errno << '\n'
                        << "Directory : " << package().locale_dir().absFilename() << '\n'
                        << "Rtn value : " << c);
        }
 
        if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
-               LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
-                       << "Error code: " << errno << '\n'
-                       << "Codeset   : " << ucs4_codeset << '\n');
+               LYXERR(Debug::DEBUG, "Error code: " << errno << '\n'
+                       << "Codeset   : " << ucs4_codeset);
        }
 
        textdomain(PACKAGE);
@@ -163,8 +155,8 @@ docstring const Messages::get(string const & m) const
 #endif
        }
 
-       std::pair<TranslationCache::iterator, bool> result =
-               cache_.insert(std::make_pair(m, trans));
+       pair<TranslationCache::iterator, bool> result =
+               cache_.insert(make_pair(m, trans));
 
        BOOST_ASSERT(result.second);
 
@@ -206,12 +198,12 @@ namespace lyx {
 // libstdc++ that is distributed with GNU G++.
 class Messages::Pimpl {
 public:
-       typedef std::messages<char>::catalog catalog;
+       typedef messages<char>::catalog catalog;
 
        Pimpl(string const & l)
                : lang_(l),
                  loc_gl(lang_.c_str()),
-                 mssg_gl(std::use_facet<std::messages<char> >(loc_gl))
+                 mssg_gl(use_facet<messages<char> >(loc_gl))
        {
                //LYXERR("Messages: language(" << l << ") in dir(" << dir << ")");
 
@@ -233,9 +225,9 @@ private:
        ///
        string lang_;
        ///
-       std::locale loc_gl;
+       locale loc_gl;
        ///
-       std::messages<char> const & mssg_gl;
+       messages<char> const & mssg_gl;
        ///
        catalog cat_gl;
 };