mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
Sync with src/debug.C
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17703 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0159c9d6c7
commit
3387c00c9d
@ -23,9 +23,9 @@
|
||||
|
||||
namespace lyx {
|
||||
|
||||
using lyx::support::ascii_lowercase;
|
||||
using lyx::support::bformat;
|
||||
using lyx::support::isStrInt;
|
||||
using support::ascii_lowercase;
|
||||
using support::bformat;
|
||||
using support::isStrInt;
|
||||
|
||||
using std::setw;
|
||||
using std::string;
|
||||
@ -58,8 +58,8 @@ lyx_debug_trait::type lyx_debug_trait::value(string const & val)
|
||||
type l = Debug::NONE;
|
||||
string v(val);
|
||||
while (!v.empty()) {
|
||||
string::size_type st = v.find(',');
|
||||
string tmp(ascii_lowercase(v.substr(0, st)));
|
||||
string::size_type const st = v.find(',');
|
||||
string const tmp(ascii_lowercase(v.substr(0, st)));
|
||||
if (tmp.empty())
|
||||
break;
|
||||
// Is it a number?
|
||||
@ -86,12 +86,10 @@ void lyx_debug_trait::showLevel(ostream & os, lyx_debug_trait::type level)
|
||||
if (errorTags[i].level != Debug::ANY
|
||||
&& errorTags[i].level != Debug::NONE
|
||||
&& errorTags[i].level & level) {
|
||||
// avoid _(...) re-entrance problem
|
||||
// FIXME: should we use _() from gettext.h here?
|
||||
lyx::docstring const s = _(errorTags[i].desc);
|
||||
os << lyx::to_utf8(bformat(_("Debugging `%1$s' (%2$s)"),
|
||||
lyx::from_utf8(errorTags[i].name),
|
||||
s))
|
||||
// avoid to_utf8(_(...)) re-entrance problem
|
||||
docstring const s = _(errorTags[i].desc);
|
||||
os << to_utf8(bformat(_("Debugging `%1$s' (%2$s)"),
|
||||
from_utf8(errorTags[i].name), s))
|
||||
<< '\n';
|
||||
}
|
||||
}
|
||||
@ -102,12 +100,13 @@ void lyx_debug_trait::showLevel(ostream & os, lyx_debug_trait::type level)
|
||||
void lyx_debug_trait::showTags(ostream & os)
|
||||
{
|
||||
for (int i = 0; i < numErrorTags ; ++i)
|
||||
os << setw(7) << static_cast<unsigned int>(errorTags[i].level)
|
||||
<< setw(10) << errorTags[i].name
|
||||
<< " " << lyx::to_utf8(_(errorTags[i].desc)) << '\n';
|
||||
os << setw(10) << static_cast<unsigned int>(errorTags[i].level)
|
||||
<< setw(13) << errorTags[i].name
|
||||
<< " " << to_utf8(_(errorTags[i].desc)) << '\n';
|
||||
os.flush();
|
||||
}
|
||||
|
||||
|
||||
LyXErr lyxerr;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user