void BufferView::setBuffer(Buffer * b)
{
- lyxerr[Debug::INFO] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::INFO) << BOOST_CURRENT_FUNCTION
<< "[ b = " << b << "]" << endl;
if (buffer_) {
// If we are closing current buffer, switch to the first in
// buffer list.
if (!b) {
- lyxerr[Debug::INFO] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::INFO) << BOOST_CURRENT_FUNCTION
<< " No Buffer!" << endl;
// We are closing the buffer, use the first buffer as current
buffer_ = theBufferList().first();
offset_ref_ = 0;
if (buffer_) {
- lyxerr[Debug::INFO] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::INFO) << BOOST_CURRENT_FUNCTION
<< "Buffer addr: " << buffer_ << endl;
cursor_.push(buffer_->inset());
cursor_.resetAnchor();
if (!buffer_)
return;
- lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION << endl;
+ LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION << endl;
updateMetrics(false);
switchKeyMap();
last_inset_ = 0;
// This is close to a hot-path.
if (lyxerr.debugging(Debug::DEBUG)) {
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< "[fitcursor = " << (flags & Update::FitCursor)
<< ", forceupdate = " << (flags & Update::Force)
return false;
if (lyxerr.debugging(Debug::WORKAREA)) {
- lyxerr[Debug::WORKAREA] << "BufferView::update" << std::endl;
+ LYXERR(Debug::WORKAREA) << "BufferView::update" << std::endl;
}
// Update macro store
void BufferView::updateScrollbar()
{
if (!buffer_) {
- lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION
<< " no text in updateScrollbar" << endl;
scrollbarParameters_.reset();
return;
}
if (lyxerr.debugging(Debug::GUI)) {
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< BOOST_CURRENT_FUNCTION
<< " Updating scrollbar: height: " << t.paragraphs().size()
<< " curr par: " << cursor_.bottom().pit()
void BufferView::scrollDocView(int value)
{
- lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
<< "[ value = " << value << "]" << endl;
if (!buffer_)
// << [ cmd = " << cmd << "]" << endl;
// Make sure that the cached BufferView is correct.
- lyxerr[Debug::ACTION] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::ACTION) << BOOST_CURRENT_FUNCTION
<< " action[" << cmd.action << ']'
<< " arg[" << to_utf8(cmd.argument()) << ']'
<< " x[" << cmd.x << ']'
for (Buffer * b = buffer_; i == 0 || b != buffer_; b = theBufferList().next(b)) {
ParIterator par = b->getParFromID(id);
if (par == b->par_iterator_end()) {
- lyxerr[Debug::INFO]
+ LYXERR(Debug::INFO)
<< "No matching paragraph found! ["
<< id << "]." << endl;
} else {
- lyxerr[Debug::INFO]
+ LYXERR(Debug::INFO)
<< "Paragraph " << par->id()
<< " found in buffer `"
<< b->fileName() << "'." << endl;
BOOST_ASSERT(pit != -1);
Paragraph const & par = text.getPar(pit);
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": x: " << x
<< " y: " << y
}
}
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": Hit inset: " << inset << endl;
return inset;
}
}
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": No inset hit. " << endl;
return 0;
pit2 = cursor_.bottom().pit();
}
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< " y1: " << y1
<< " y2: " << y2
singlepar? SingleParUpdate: FullScreenUpdate, size);
if (lyxerr.debugging(Debug::WORKAREA)) {
- lyxerr[Debug::WORKAREA] << "BufferView::updateMetrics" << endl;
+ LYXERR(Debug::WORKAREA) << "BufferView::updateMetrics" << endl;
coord_cache_.dump();
}
}
os << std::setw(10) << std::setfill('0') << do_crc(orig_from.absFilename())
<< '-' << to_format;
cache_name = FileName(addName(cache_dir.absFilename(), os.str()));
- lyxerr[Debug::FILES] << "Add file cache item " << orig_from
+ LYXERR(Debug::FILES) << "Add file cache item " << orig_from
<< ' ' << to_format << ' ' << cache_name
<< ' ' << timestamp << ' ' << checksum
<< '.' << std::endl;
// Don't cache files that do not exist anymore
if (!fs::exists(orig_from_name.toFilesystemEncoding())) {
- lyxerr[Debug::FILES] << "Not caching file `"
+ LYXERR(Debug::FILES) << "Not caching file `"
<< orig_from << "' (does not exist anymore)."
<< std::endl;
support::unlink(item.cache_name);
// Delete the cached file if it is too old
if (difftime(now, fs::last_write_time(item.cache_name.toFilesystemEncoding())) >
lyxrc.converter_cache_maxage) {
- lyxerr[Debug::FILES] << "Not caching file `"
+ LYXERR(Debug::FILES) << "Not caching file `"
<< orig_from << "' (too old)." << std::endl;
support::unlink(item.cache_name);
continue;
if (!lyxrc.use_converter_cache || orig_from.empty() ||
converted_file.empty())
return;
- lyxerr[Debug::FILES] << BOOST_CURRENT_FUNCTION << ' ' << orig_from
+ LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
<< ' ' << to_format << ' ' << converted_file
<< std::endl;
time_t const timestamp = fs::last_write_time(orig_from.toFilesystemEncoding());
Mover const & mover = getMover(to_format);
if (item) {
- lyxerr[Debug::FILES] << "ConverterCache::add(" << orig_from << "):\n"
+ LYXERR(Debug::FILES) << "ConverterCache::add(" << orig_from << "):\n"
"The file is already in the cache."
<< std::endl;
// First test for timestamp
if (timestamp == item->timestamp) {
- lyxerr[Debug::FILES] << "Same timestamp."
+ LYXERR(Debug::FILES) << "Same timestamp."
<< std::endl;
return;
} else {
item->timestamp = timestamp;
unsigned long const checksum = support::sum(orig_from);
if (checksum == item->checksum) {
- lyxerr[Debug::FILES] << "Same checksum."
+ LYXERR(Debug::FILES) << "Same checksum."
<< std::endl;
return;
}
item->checksum = checksum;
}
if (!mover.copy(converted_file, item->cache_name, 0600))
- lyxerr[Debug::FILES] << "ConverterCache::add("
+ LYXERR(Debug::FILES) << "ConverterCache::add("
<< orig_from << "):\n"
"Could not copy file."
<< std::endl;
if (mover.copy(converted_file, new_item.cache_name, 0600))
pimpl_->cache[orig_from][to_format] = new_item;
else
- lyxerr[Debug::FILES] << "ConverterCache::add("
+ LYXERR(Debug::FILES) << "ConverterCache::add("
<< orig_from << "):\n"
"Could not copy file."
<< std::endl;
{
if (!lyxrc.use_converter_cache || orig_from.empty())
return;
- lyxerr[Debug::FILES] << BOOST_CURRENT_FUNCTION << ' ' << orig_from
+ LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
<< ' ' << to_format << std::endl;
CacheType::iterator const it1 = pimpl_->cache.find(orig_from);
{
if (!lyxrc.use_converter_cache || orig_from.empty())
return false;
- lyxerr[Debug::FILES] << BOOST_CURRENT_FUNCTION << ' ' << orig_from
+ LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
<< ' ' << to_format << std::endl;
CacheItem * const item = pimpl_->find(orig_from, to_format);
if (!item) {
- lyxerr[Debug::FILES] << "not in cache." << std::endl;
+ LYXERR(Debug::FILES) << "not in cache." << std::endl;
return false;
}
time_t const timestamp = fs::last_write_time(orig_from.toFilesystemEncoding());
if (item->timestamp == timestamp) {
- lyxerr[Debug::FILES] << "identical timestamp." << std::endl;
+ LYXERR(Debug::FILES) << "identical timestamp." << std::endl;
return true;
}
if (item->checksum == support::sum(orig_from)) {
item->timestamp = timestamp;
- lyxerr[Debug::FILES] << "identical checksum." << std::endl;
+ LYXERR(Debug::FILES) << "identical checksum." << std::endl;
return true;
}
- lyxerr[Debug::FILES] << "in cache, but too old." << std::endl;
+ LYXERR(Debug::FILES) << "in cache, but too old." << std::endl;
return false;
}
FileName const & ConverterCache::cacheName(FileName const & orig_from,
string const & to_format) const
{
- lyxerr[Debug::FILES] << BOOST_CURRENT_FUNCTION << ' ' << orig_from
+ LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
<< ' ' << to_format << std::endl;
CacheItem * const item = pimpl_->find(orig_from, to_format);
{
if (!lyxrc.use_converter_cache || orig_from.empty() || dest.empty())
return false;
- lyxerr[Debug::FILES] << BOOST_CURRENT_FUNCTION << ' ' << orig_from
+ LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
<< ' ' << to_format << ' ' << dest << std::endl;
CacheItem * const item = pimpl_->find(orig_from, to_format);
dep_info di;
di.crc_prev = 0;
if (upd) {
- lyxerr[Debug::DEPEND] << " CRC..." << flush;
+ LYXERR(Debug::DEPEND) << " CRC..." << flush;
di.crc_cur = sum(f);
- lyxerr[Debug::DEPEND] << "done." << endl;
+ LYXERR(Debug::DEPEND) << "done." << endl;
struct stat f_info;
stat(f.toFilesystemEncoding().c_str(), &f_info);
di.mtime_cur = f_info.st_mtime;
}
deplist[f] = di;
} else {
- lyxerr[Debug::DEPEND] << " Already in DepTable" << endl;
+ LYXERR(Debug::DEPEND) << " Already in DepTable" << endl;
}
}
void DepTable::update()
{
- lyxerr[Debug::DEPEND] << "Updating DepTable..." << endl;
+ LYXERR(Debug::DEPEND) << "Updating DepTable..." << endl;
time_type const start_time = current_time();
DepList::iterator itr = deplist.begin();
if (stat(itr->first.toFilesystemEncoding().c_str(), &f_info) == 0) {
if (di.mtime_cur == f_info.st_mtime) {
di.crc_prev = di.crc_cur;
- lyxerr[Debug::DEPEND] << itr->first << " same mtime" << endl;
+ LYXERR(Debug::DEPEND) << itr->first << " same mtime" << endl;
} else {
di.crc_prev = di.crc_cur;
- lyxerr[Debug::DEPEND] << itr->first << " CRC... " << flush;
+ LYXERR(Debug::DEPEND) << itr->first << " CRC... " << flush;
di.crc_cur = sum(itr->first);
- lyxerr[Debug::DEPEND] << "done" << endl;
+ LYXERR(Debug::DEPEND) << "done" << endl;
}
} else {
// file doesn't exist
// remove stale files - if it's re-created, it
// will be re-inserted by deplog.
- lyxerr[Debug::DEPEND] << itr->first
+ LYXERR(Debug::DEPEND) << itr->first
<< " doesn't exist. removing from DepTable." << endl;
DepList::iterator doomed = itr++;
deplist.erase(doomed);
++itr;
}
time_type const time_sec = current_time() - start_time;
- lyxerr[Debug::DEPEND] << "Finished updating DepTable ("
+ LYXERR(Debug::DEPEND) << "Finished updating DepTable ("
<< time_sec << " sec)." << endl;
}
{
string const lcname = ascii_lowercase(lyxname);
if (pimpl_->lyxcolors.find(lcname) == pimpl_->lyxcolors.end()) {
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "LColor::setColor: Unknown color \""
<< lyxname << '"' << endl;
addColor(static_cast<color>(pimpl_->infotab.size()), lcname);
FileName const aux_file(changeExtension(file.absFilename(), "aux"));
if (had_depfile) {
- lyxerr[Debug::DEPEND] << "Dependency file exists" << endl;
+ LYXERR(Debug::DEPEND) << "Dependency file exists" << endl;
// Read the dep file:
had_depfile = head.read(depfile);
}
// to re-run latex and collect the error messages
// (even if they are the same).
if (!fs::exists(output_file.toFilesystemEncoding())) {
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "re-running LaTeX because output file doesn't exist."
<< endl;
} else if (!head.sumchange()) {
- lyxerr[Debug::DEPEND] << "return no_change" << endl;
+ LYXERR(Debug::DEPEND) << "return no_change" << endl;
return NO_CHANGE;
} else {
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "Dependency file has changed" << endl;
}
if (head.extchanged(".bib") || head.extchanged(".bst"))
run_bibtex = true;
} else
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "Dependency file does not exist, or has wrong format"
<< endl;
bibtex_info_old = scanAuxFiles(aux_file);
++count;
- lyxerr[Debug::LATEX] << "Run #" << count << endl;
+ LYXERR(Debug::LATEX) << "Run #" << count << endl;
message(runMessage(count));
startscript();
scanres = scanLogFile(terr);
if (scanres & ERROR_RERUN) {
- lyxerr[Debug::LATEX] << "Rerunning LaTeX" << endl;
+ LYXERR(Debug::LATEX) << "Rerunning LaTeX" << endl;
startscript();
scanres = scanLogFile(terr);
}
// run makeindex
if (head.haschanged(idxfile)) {
// no checks for now
- lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
+ LYXERR(Debug::LATEX) << "Running MakeIndex." << endl;
message(_("Running MakeIndex."));
// onlyFilename() is needed for cygwin
rerun |= runMakeIndex(onlyFilename(idxfile.absFilename()),
runparams);
}
if (head.haschanged(FileName(changeExtension(file.absFilename(), ".nlo")))) {
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "Running MakeIndex for nomencl."
<< endl;
message(_("Running MakeIndex for nomencl."));
// "\bibdata" and/or "\bibstyle". If one of those
// tags is found -> run bibtex and set rerun = true;
// no checks for now
- lyxerr[Debug::LATEX] << "Running BibTeX." << endl;
+ LYXERR(Debug::LATEX) << "Running BibTeX." << endl;
message(_("Running BibTeX."));
updateBibtexDependencies(head, bibtex_info);
rerun |= runBibTeX(bibtex_info);
if (rerun || head.sumchange()) {
rerun = false;
++count;
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "Dep. file has changed or rerun requested"
<< endl;
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "Run #" << count << endl;
message(runMessage(count));
startscript();
deplog(head); // reads the latex log
head.update();
} else {
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "Dep. file has NOT changed"
<< endl;
}
// run makeindex if the <file>.idx has changed or was generated.
if (head.haschanged(FileName(changeExtension(file.absFilename(), ".idx")))) {
// no checks for now
- lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
+ LYXERR(Debug::LATEX) << "Running MakeIndex." << endl;
message(_("Running MakeIndex."));
// onlyFilename() is needed for cygwin
rerun = runMakeIndex(onlyFilename(changeExtension(
// I am not pretty sure if need this twice.
if (head.haschanged(FileName(changeExtension(file.absFilename(), ".nlo")))) {
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "Running MakeIndex for nomencl."
<< endl;
message(_("Running MakeIndex for nomencl."));
// MAX_RUNS are reached.
rerun = false;
++count;
- lyxerr[Debug::LATEX] << "Run #" << count << endl;
+ LYXERR(Debug::LATEX) << "Run #" << count << endl;
message(runMessage(count));
startscript();
scanres = scanLogFile(terr);
// Write the dependencies to file.
head.write(depfile);
- lyxerr[Debug::LATEX] << "Done." << endl;
+ LYXERR(Debug::LATEX) << "Done." << endl;
return scanres;
}
bool LaTeX::runMakeIndex(string const & f, OutputParams const & runparams,
string const & params)
{
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "idx file has been made, running makeindex on file "
<< f << endl;
string tmp = lyxrc.index_command + ' ';
void LaTeX::scanAuxFile(FileName const & file, Aux_Info & aux_info)
{
- lyxerr[Debug::LATEX] << "Scanning aux file: " << file << endl;
+ LYXERR(Debug::LATEX) << "Scanning aux file: " << file << endl;
ifstream ifs(file.toFilesystemEncoding().c_str());
string token;
while (!data.empty()) {
string citation;
data = split(data, citation, ',');
- lyxerr[Debug::LATEX] << "Citation: "
+ LYXERR(Debug::LATEX) << "Citation: "
<< citation << endl;
aux_info.citations.insert(citation);
}
string database;
data = split(data, database, ',');
database = changeExtension(database, "bib");
- lyxerr[Debug::LATEX] << "BibTeX database: `"
+ LYXERR(Debug::LATEX) << "BibTeX database: `"
<< database << '\'' << endl;
aux_info.databases.insert(database);
}
// token is now the style file
// pass it to the helper
style = changeExtension(style, "bst");
- lyxerr[Debug::LATEX] << "BibTeX style: `"
+ LYXERR(Debug::LATEX) << "BibTeX style: `"
<< style << '\'' << endl;
aux_info.styles.insert(style);
} else if (regex_match(token, sub, reg4)) {
int retval = NO_ERRORS;
string tmp =
onlyFilename(changeExtension(file.absFilename(), ".log"));
- lyxerr[Debug::LATEX] << "Log file: " << tmp << endl;
+ LYXERR(Debug::LATEX) << "Log file: " << tmp << endl;
FileName const fn = FileName(makeAbsPath(tmp));
ifstream ifs(fn.toFilesystemEncoding().c_str());
token = subst(token, '\0', '\r');
token = subst(token, "\r", "");
- lyxerr[Debug::LATEX] << "Log line: " << token << endl;
+ LYXERR(Debug::LATEX) << "Log line: " << token << endl;
if (token.empty())
continue;
// Here shall we handle different
// types of warnings
retval |= LATEX_WARNING;
- lyxerr[Debug::LATEX] << "LaTeX Warning." << endl;
+ LYXERR(Debug::LATEX) << "LaTeX Warning." << endl;
if (contains(token, "Rerun to get cross-references")) {
retval |= RERUN;
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "We should rerun." << endl;
} else if (contains(token, "Citation")
&& contains(token, "on page")
contains(token, "Rerun to get")) {
// at least longtable.sty and bibtopic.sty
// might use this.
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "We should rerun." << endl;
retval |= RERUN;
}
if (contains(token, "Rerun LaTeX") ||
contains(token, "Rerun to get")) {
// Used by natbib
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "We should rerun." << endl;
retval |= RERUN;
}
errstr += "\n";
getline(ifs, tmp);
}
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "line: " << line << '\n'
<< "Desc: " << desc << '\n'
<< "Text: " << errstr << endl;
}
}
}
- lyxerr[Debug::LATEX] << "Log line: " << token << endl;
+ LYXERR(Debug::LATEX) << "Log line: " << token << endl;
return retval;
}
return fs::exists(possible_name.toFilesystemEncoding());
}
catch (fs::filesystem_error const & fe) {
- lyxerr[Debug::DEPEND] << "Got error `" << fe.what()
+ LYXERR(Debug::DEPEND) << "Got error `" << fe.what()
<< "' while checking whether file `" << possible_name
<< "' exists." << endl;
return false;
// convert from native os path to unix path
string foundfile = os::internal_path(trim(ff));
- lyxerr[Debug::DEPEND] << "Found file: " << foundfile << endl;
+ LYXERR(Debug::DEPEND) << "Found file: " << foundfile << endl;
// Ok now we found a file.
// Now we should make sure that this is a file that we can
// absolute path and should
// be inserted.
if (absolutePath(foundfile)) {
- lyxerr[Debug::DEPEND] << "AbsolutePath file: "
+ LYXERR(Debug::DEPEND) << "AbsolutePath file: "
<< foundfile << endl;
// On initial insert we want to do the update at once
// since this file cannot be a file generated by
!fs::is_directory(absname.toFilesystemEncoding())) {
static regex unwanted("^.*\\.(aux|log|dvi|bbl|ind|glo)$");
if (regex_match(onlyfile, unwanted)) {
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "We don't want "
<< onlyfile
<< " in the dep file"
// This is a tex file generated by LyX
// and latex is not likely to change this
// during its runs.
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "Tmpdir TeX file: "
<< onlyfile
<< endl;
head.insert(absname, true);
} else {
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "In tmpdir file:"
<< onlyfile
<< endl;
}
return true;
} else {
- lyxerr[Debug::DEPEND]
+ LYXERR(Debug::DEPEND)
<< "Not a file or we are unable to find it."
<< endl;
return false;
if (bindings.size()) {
return bindings.begin()->print(forgui);
} else {
- lyxerr[Debug::KBMAP]
+ LYXERR(Debug::KBMAP)
<< "No binding for "
<< lyxaction.getActionName(func_.action)
<< '(' << to_utf8(func_.argument()) << ')' << endl;
docstring const tooltip = translateIfPossible(lex.getDocString());
lex.next(true);
string const func_arg = lex.getString();
- lyxerr[Debug::PARSER]
+ LYXERR(Debug::PARSER)
<< "ToolbarBackend::read TO_ADD func: `"
<< func_arg << '\'' << endl;
}
if (!fullname.empty()) {
- lyxerr[Debug::GUI] << "Full icon name is `"
+ LYXERR(Debug::GUI) << "Full icon name is `"
<< fullname << '\'' << endl;
return fullname;
}
- lyxerr[Debug::GUI] << "Cannot find icon for command \""
+ LYXERR(Debug::GUI) << "Cannot find icon for command \""
<< lyxaction.getActionName(f.action)
<< '(' << to_utf8(f.argument()) << ")\"" << endl;
return libFileSearch("images", "unknown", "xpm").absFilename();
Buffer::Buffer(string const & file, bool readonly)
: pimpl_(new Impl(*this, FileName(file), readonly))
{
- lyxerr[Debug::INFO] << "Buffer::Buffer()" << endl;
+ LYXERR(Debug::INFO) << "Buffer::Buffer()" << endl;
}
Buffer::~Buffer()
{
- lyxerr[Debug::INFO] << "Buffer::~Buffer()" << endl;
+ LYXERR(Debug::INFO) << "Buffer::~Buffer()" << endl;
// here the buffer should take care that it is
// saved properly, before it goes into the void.
if (fs::exists(bname.toFilesystemEncoding()) &&
(!fs::exists(fname.toFilesystemEncoding()) ||
fs::last_write_time(fname.toFilesystemEncoding()) < fs::last_write_time(bname.toFilesystemEncoding()))) {
- lyxerr[Debug::FILES] << "Log name calculated as: " << bname << endl;
+ LYXERR(Debug::FILES) << "Log name calculated as: " << bname << endl;
return make_pair(Buffer::buildlog, bname.absFilename());
}
- lyxerr[Debug::FILES] << "Log name calculated as: " << fname << endl;
+ LYXERR(Debug::FILES) << "Log name calculated as: " << fname << endl;
return make_pair(Buffer::latexlog, fname.absFilename());
}
continue;
}
- lyxerr[Debug::PARSER] << "Handling document header token: `"
+ LYXERR(Debug::PARSER) << "Handling document header token: `"
<< token << '\'' << endl;
string unknown = params().readToken(lex, token);
<< ' ' << quoteName(filename.toFilesystemEncoding());
string const command_str = command.str();
- lyxerr[Debug::INFO] << "Running '"
+ LYXERR(Debug::INFO) << "Running '"
<< command_str << '\''
<< endl;
bformat(_("Cannot create backup file %1$s.\n"
"Please check whether the directory exists and is writeable."),
from_utf8(backupName.absFilename())));
- lyxerr[Debug::DEBUG] << "Fs error: " << fe.what() << endl;
+ LYXERR(Debug::DEBUG) << "Fs error: " << fe.what() << endl;
}
}
bool output_preamble, bool output_body)
{
string const encoding = runparams.encoding->iconvName();
- lyxerr[Debug::LATEX] << "makeLaTeXFile encoding: "
+ LYXERR(Debug::LATEX) << "makeLaTeXFile encoding: "
<< encoding << "..." << endl;
odocfstream ofs(encoding);
OutputParams runparams = runparams_in;
// validate the buffer.
- lyxerr[Debug::LATEX] << " Validating buffer..." << endl;
+ LYXERR(Debug::LATEX) << " Validating buffer..." << endl;
LaTeXFeatures features(*this, params(), runparams);
validate(features);
- lyxerr[Debug::LATEX] << " Buffer validation done." << endl;
+ LYXERR(Debug::LATEX) << " Buffer validation done." << endl;
texrow().reset();
texrow().newline();
texrow().newline();
}
- lyxerr[Debug::INFO] << "lyx document header finished" << endl;
+ LYXERR(Debug::INFO) << "lyx document header finished" << endl;
// There are a few differences between nice LaTeX and usual files:
// usual is \batchmode and has a
// special input@path to allow the including of figures
os << "\\begin{document}\n";
texrow().newline();
} // output_preamble
- lyxerr[Debug::INFO] << "preamble finished, now the body." << endl;
+ LYXERR(Debug::INFO) << "preamble finished, now the body." << endl;
if (!lyxrc.language_auto_begin) {
// FIXME UNICODE
os << "\\end{document}\n";
texrow().newline();
- lyxerr[Debug::LATEX] << "makeLaTeXFile...done" << endl;
+ LYXERR(Debug::LATEX) << "makeLaTeXFile...done" << endl;
} else {
- lyxerr[Debug::LATEX] << "LaTeXFile for inclusion made."
+ LYXERR(Debug::LATEX) << "LaTeXFile for inclusion made."
<< endl;
}
runparams_in.encoding = runparams.encoding;
// Just to be sure. (Asger)
texrow().newline();
- lyxerr[Debug::INFO] << "Finished making LaTeX file." << endl;
- lyxerr[Debug::INFO] << "Row count was " << texrow().rows() - 1
+ LYXERR(Debug::INFO) << "Finished making LaTeX file." << endl;
+ LYXERR(Debug::INFO) << "Row count was " << texrow().rows() - 1
<< '.' << endl;
}
OutputParams const & runparams,
bool const body_only)
{
- lyxerr[Debug::LATEX] << "makeDocBookFile..." << endl;
+ LYXERR(Debug::LATEX) << "makeDocBookFile..." << endl;
//ofstream ofs;
odocfstream ofs;
{
auto_ptr<Buffer> tmpbuf(new Buffer(s, ronly));
tmpbuf->params().useClassDefaults();
- lyxerr[Debug::INFO] << "Assigning to buffer "
+ LYXERR(Debug::INFO) << "Assigning to buffer "
<< bstore.size() << endl;
bstore.push_back(tmpbuf.get());
return tmpbuf.release();
void Changes::set(Change const & change, pos_type const start, pos_type const end)
{
if (change.type != Change::UNCHANGED && lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << "setting change (type: " << change.type
+ LYXERR(Debug::CHANGES) << "setting change (type: " << change.type
<< ", author: " << change.author << ", time: " << change.changetime
<< ") in range (" << start << ", " << end << ")" << endl;
}
pos_type oldEnd = it->range.end;
it->range.end = start;
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << " cutting tail of type " << it->change.type
+ LYXERR(Debug::CHANGES) << " cutting tail of type " << it->change.type
<< " resulting in range (" << it->range.start << ", "
<< it->range.end << ")" << endl;
}
++it;
if (oldEnd >= end) {
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << " inserting tail in range ("
+ LYXERR(Debug::CHANGES) << " inserting tail in range ("
<< end << ", " << oldEnd << ")" << endl;
}
it = table_.insert(it, ChangeRange((it-1)->change, Range(end, oldEnd)));
if (change.type != Change::UNCHANGED) {
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << " inserting change" << endl;
+ LYXERR(Debug::CHANGES) << " inserting change" << endl;
}
it = table_.insert(it, ChangeRange(change, Range(start, end)));
++it;
// new change 'contains' existing change
if (newRange.contains(it->range)) {
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << " removing subrange ("
+ LYXERR(Debug::CHANGES) << " removing subrange ("
<< it->range.start << ", " << it->range.end << ")" << endl;
}
it = table_.erase(it);
// new change intersects with existing change
it->range.start = end;
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << " cutting head of type "
+ LYXERR(Debug::CHANGES) << " cutting head of type "
<< it->change.type << " resulting in range ("
<< end << ", " << it->range.end << ")" << endl;
}
void Changes::erase(pos_type const pos)
{
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << "Erasing change at position " << pos << endl;
+ LYXERR(Debug::CHANGES) << "Erasing change at position " << pos << endl;
}
ChangeTable::iterator it = table_.begin();
void Changes::insert(Change const & change, lyx::pos_type pos)
{
if (change.type != Change::UNCHANGED && lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << "Inserting change of type " << change.type
+ LYXERR(Debug::CHANGES) << "Inserting change of type " << change.type
<< " at position " << pos << endl;
}
for (; it != itend; ++it) {
if (it->range.intersects(Range(start, end))) {
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << "found intersection of range ("
+ LYXERR(Debug::CHANGES) << "found intersection of range ("
<< start << ", " << end << ") with ("
<< it->range.start << ", " << it->range.end
<< ") of type " << it->change.type << endl;
while (it != table_.end()) {
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << "found change of type " << it->change.type
+ LYXERR(Debug::CHANGES) << "found change of type " << it->change.type
<< " and range (" << it->range.start << ", " << it->range.end
<< ")" << endl;
}
if (it->range.start == it->range.end) {
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << "removing empty range for pos "
+ LYXERR(Debug::CHANGES) << "removing empty range for pos "
<< it->range.start << endl;
}
if (it->change.isSimilarTo((it + 1)->change) && it->range.end == (it + 1)->range.start) {
if (lyxerr.debugging(Debug::CHANGES)) {
- lyxerr[Debug::CHANGES] << "merging ranges (" << it->range.start << ", "
+ LYXERR(Debug::CHANGES) << "merging ranges (" << it->range.start << ", "
<< it->range.end << ") and (" << (it + 1)->range.start << ", "
<< (it + 1)->range.end << ")" << endl;
}
char const * c = bindtextdomain(PACKAGE, package().locale_dir().c_str());
int e = errno;
if (e) {
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION << '\n'
<< "Error code: " << errno << '\n'
<< "Lang, mess: " << lang_ << " " << m << '\n'
}
if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION << '\n'
<< "Error code: " << errno << '\n'
<< "Codeset : " << ucs4_codeset << '\n'
//lyxerr << "Same as entered returned" << endl;
translated = from_ascii(tmp);
} else {
- lyxerr[Debug::DEBUG] << "We got a translation" << endl;
+ LYXERR(Debug::DEBUG) << "We got a translation" << endl;
char_type const * ucs4 = reinterpret_cast<char_type const *>(msg);
translated = ucs4;
}
quoteName(from_ext + ':' + from_file.toFilesystemEncoding()) +
' ' +
quoteName(to_ext + ':' + to_file.toFilesystemEncoding());
- lyxerr[Debug::FILES]
+ LYXERR(Debug::FILES)
<< "No converter defined! "
"I use convertDefault.py:\n\t"
<< command << endl;
Converter const & conv = converterlist_[*cit];
bool dummy = conv.To->dummy() && conv.to != "program";
if (!dummy)
- lyxerr[Debug::FILES] << "Converting from "
+ LYXERR(Debug::FILES) << "Converting from "
<< conv.from << " to " << conv.to << endl;
infile = outfile;
outfile = FileName(conv.result_dir.empty()
if (conv.latex) {
run_latex = true;
string const command = subst(conv.command, token_from, "");
- lyxerr[Debug::FILES] << "Running " << command << endl;
+ LYXERR(Debug::FILES) << "Running " << command << endl;
if (!runLaTeX(*buffer, command, runparams, errorList))
return false;
} else {
if (conv.need_aux && !run_latex
&& !latex_command_.empty()) {
- lyxerr[Debug::FILES]
+ LYXERR(Debug::FILES)
<< "Running " << latex_command_
<< " to update aux file"<< endl;
runLaTeX(*buffer, latex_command_, runparams, errorList);
command = add_options(command,
dvipdfm_options(buffer->params()));
- lyxerr[Debug::FILES] << "Calling " << command << endl;
+ LYXERR(Debug::FILES) << "Calling " << command << endl;
if (buffer)
buffer->message(_("Executing command: ")
+ from_utf8(command));
if (!mover.rename(outfile, real_outfile))
res = -1;
else
- lyxerr[Debug::FILES]
+ LYXERR(Debug::FILES)
<< "renaming file " << outfile
<< " to " << real_outfile
<< endl;
string const to2 = changeExtension(
to_base + file2.substr(base.length()),
to_extension);
- lyxerr[Debug::FILES] << "moving " << from2
+ LYXERR(Debug::FILES) << "moving " << from2
<< " to " << to2 << endl;
Mover const & mover = getMover(fmt);
double d = (x - xo) * (x - xo) + (y - yo) * (y - yo);
// '<=' in order to take the last possible position
// this is important for clicking behind \sum in e.g. '\sum_i a'
- lyxerr[Debug::DEBUG] << "i: " << i << " d: " << d
+ LYXERR(Debug::DEBUG) << "i: " << i << " d: " << d
<< " best: " << best_dist << endl;
if (d <= best_dist) {
best_dist = d;
void LCursor::dispatch(FuncRequest const & cmd0)
{
- lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION
<< " cmd: " << cmd0 << '\n'
<< *this << endl;
if (empty())
LCursor safe = *this;
for (; depth(); pop()) {
- lyxerr[Debug::DEBUG] << "LCursor::dispatch: cmd: "
+ LYXERR(Debug::DEBUG) << "LCursor::dispatch: cmd: "
<< cmd0 << endl << *this << endl;
BOOST_ASSERT(pos() <= lastpos());
BOOST_ASSERT(idx() <= lastidx());
// it completely to get a 'bomb early' behaviour in case this
// object will be used again.
if (!disp_.dispatched()) {
- lyxerr[Debug::DEBUG] << "RESTORING OLD CURSOR!" << endl;
+ LYXERR(Debug::DEBUG) << "RESTORING OLD CURSOR!" << endl;
operator=(safe);
disp_.update(Update::None);
disp_.dispatched(false);
void LCursor::handleFont(string const & font)
{
- lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION << ": " << font << endl;
+ LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION << ": " << font << endl;
docstring safe;
if (selection()) {
macroModeClose();
}
-// std::ostream & operator<<(std::ostream & o, Debug::type t);
-
typedef basic_debugstream<lyx_debug_trait> LyXErr;
typedef LyXErr::debug Debug;
extern LyXErr lyxerr;
-
} // namespace lyx
+#define LYXERR(type) if (!lyx::lyxerr.debugging(type)) ; else lyx::lyxerr
+
+
#endif
if (!info.preamble.empty())
info.feature = info.preamble[0] != '\\';
- lyxerr[Debug::INFO]
+ LYXERR(Debug::INFO)
<< "Read unicode symbol " << symbol << " '"
<< to_utf8(info.command) << "' '" << info.preamble
<< "' " << info.combining << ' ' << info.feature
string const latexname = lex.getString();
lex.next();
string const iconvname = lex.getString();
- lyxerr[Debug::INFO] << "Reading encoding " << name << endl;
+ LYXERR(Debug::INFO) << "Reading encoding " << name << endl;
encodinglist[name] = Encoding(name, latexname, iconvname);
if (lex.lex() != et_end)
lex.printError("Encodings::read: "
static_cast<MathMacroTemplate*>(inset.get());
MacroTable::globalMacros().insert
(tmpl->name(), tmpl->asMacroData());
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": creating local macro " << to_utf8(tmpl->name())
<< endl;
find_if(formatlist.begin(), formatlist.end(),
FormatExtensionsEqual(ext));
if (cit != formats.end()) {
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\twill guess format from file extension: "
<< ext << " -> " << cit->name() << std::endl;
return cit->name();
command = subst(command, token_from_format, quoteName(filename.toFilesystemEncoding()));
command = subst(command, token_path_format, quoteName(onlyPath(filename.toFilesystemEncoding())));
command = subst(command, token_socket_format, quoteName(theLyXServerSocket().address()));
- lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
+ LYXERR(Debug::FILES) << "Executing command: " << command << std::endl;
// FIXME UNICODE utf8 can be wrong for files
buffer.message(_("Executing command: ") + from_utf8(command));
command = subst(command, token_from_format, quoteName(filename.toFilesystemEncoding()));
command = subst(command, token_path_format, quoteName(onlyPath(filename.toFilesystemEncoding())));
command = subst(command, token_socket_format, quoteName(theLyXServerSocket().address()));
- lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
+ LYXERR(Debug::FILES) << "Executing command: " << command << std::endl;
// FIXME UNICODE utf8 can be wrong for files
buffer.message(_("Executing command: ") + from_utf8(command));
void LyXView::autoSave()
{
- lyxerr[Debug::INFO] << "Running autoSave()" << endl;
+ LYXERR(Debug::INFO) << "Running autoSave()" << endl;
if (view()->buffer())
lyx::autoSave(view());
int last_posx = 0;
int last_posy = 0;
for (; tb != te; ++tb) {
- lyxerr[Debug::INIT] << "Adding " << tb->get<0>() << " at position " << tb->get<1>().posx << " " << tb->get<1>().posy << endl;
+ LYXERR(Debug::INIT) << "Adding " << tb->get<0>() << " at position " << tb->get<1>().posx << " " << tb->get<1>().posy << endl;
// add toolbar break if posx or posy changes
bool newline = tb->get<1>().location == last_loc && (
// if two toolbars at the same location, assume uninitialized and add toolbar break
}
}
- lyxerr[Debug::GUI] << "Toolbar::display: no toolbar named "
+ LYXERR(Debug::GUI) << "Toolbar::display: no toolbar named "
<< name << endl;
}
return cit->flags;
}
- lyxerr[Debug::GUI] << "Toolbar::display: no toolbar named "
+ LYXERR(Debug::GUI) << "Toolbar::display: no toolbar named "
<< name << endl;
// return dummy for msvc
return;
}
}
- lyxerr[Debug::GUI] << "Toolbar::display: no toolbar named "
+ LYXERR(Debug::GUI) << "Toolbar::display: no toolbar named "
<< name << endl;
}
#undef TurnOnFlag
greyed_out_ = false;
if (lyxerr.debugging(Debug::WORKAREA)) {
- lyxerr[Debug::WORKAREA] << "WorkArea::redraw screen" << endl;
+ LYXERR(Debug::WORKAREA) << "WorkArea::redraw screen" << endl;
}
int const ymin = std::max(vi.y1, 0);
int const ymax = vi.p2 < vi.size - 1 ? vi.y2 : height();
expose(0, ymin, width(), ymax - ymin);
- //lyxerr[Debug::WORKAREA]
+ //LYXERR(Debug::WORKAREA)
//<< " ymin = " << ymin << " width() = " << width()
// << " ymax-ymin = " << ymax-ymin << std::endl;
bool ButtonController::readOnly(bool ro) const
{
- lyxerr[Debug::GUI] << "Setting controller ro: " << ro << std::endl;
+ LYXERR(Debug::GUI) << "Setting controller ro: " << ro << std::endl;
if (ro) {
bp().input(ButtonPolicy::SMI_READ_ONLY);
ButtonPolicy::State tmp = s_m[state][in];
- lyxerr[Debug::GUI] << "Transition from state "
+ LYXERR(Debug::GUI) << "Transition from state "
<< printState(state) << " to state "
<< printState(tmp) << " after input "
<< printInput(in) << std::endl;
xpm_name = subst(xpm_name, "|", "bars");
}
- lyxerr[Debug::GUI] << "find_xpm(" << name << ")\n"
+ LYXERR(Debug::GUI) << "find_xpm(" << name << ")\n"
<< "Looking for math XPM called \""
<< xpm_name << '"' << std::endl;
bool ControlSpellchecker::initialiseParams(std::string const &)
{
- lyxerr[Debug::GUI] << "Spellchecker::initialiseParams" << endl;
+ LYXERR(Debug::GUI) << "Spellchecker::initialiseParams" << endl;
speller_.reset(getSpeller(kernel().buffer().params()));
if (!speller_.get())
void ControlSpellchecker::clearParams()
{
- lyxerr[Debug::GUI] << "Spellchecker::clearParams" << endl;
+ LYXERR(Debug::GUI) << "Spellchecker::clearParams" << endl;
speller_.reset(0);
}
void ControlSpellchecker::check()
{
- lyxerr[Debug::GUI] << "Check the spelling of a word" << endl;
+ LYXERR(Debug::GUI) << "Check the spelling of a word" << endl;
SpellBase::Result res = SpellBase::OK;
float progress = total ? float(start)/total : 1;
newvalue_ = int(100.0 * progress);
if (newvalue_!= oldval_) {
- lyxerr[Debug::GUI] << "Updating spell progress." << endl;
+ LYXERR(Debug::GUI) << "Updating spell progress." << endl;
oldval_ = newvalue_;
// set progress bar
dialog().view().partialUpdate(SPELL_PROGRESSED);
return;
}
- lyxerr[Debug::GUI] << "Found word \"" << to_utf8(getWord()) << "\"" << endl;
+ LYXERR(Debug::GUI) << "Found word \"" << to_utf8(getWord()) << "\"" << endl;
int const size = cur.selEnd().pos() - cur.selBegin().pos();
cur.pos() -= size;
// set suggestions
if (res != SpellBase::OK && res != SpellBase::IGNORED_WORD) {
- lyxerr[Debug::GUI] << "Found a word needing checking." << endl;
+ LYXERR(Debug::GUI) << "Found a word needing checking." << endl;
dialog().view().partialUpdate(SPELL_FOUND_WORD);
}
}
void ControlSpellchecker::replace(docstring const & replacement)
{
- lyxerr[Debug::GUI] << "ControlSpellchecker::replace("
+ LYXERR(Debug::GUI) << "ControlSpellchecker::replace("
<< to_utf8(replacement) << ")" << std::endl;
BufferView & bufferview = *kernel().bufferview();
cap::replaceSelectionWithString(bufferview.cursor(), replacement, true);
void Action::action()
{
-// lyxerr[Debug::ACTION] << "calling LyXFunc::dispatch: func_: " << func_ << endl;
+// LYXERR(Debug::ACTION) << "calling LyXFunc::dispatch: func_: " << func_ << endl;
lyxView_.dispatch(func_);
}
FileFilterList const & filters,
docstring const & suggested)
{
- lyxerr[Debug::GUI] << "Select with path \"" << to_utf8(path)
+ LYXERR(Debug::GUI) << "Select with path \"" << to_utf8(path)
<< "\", mask \"" << to_utf8(filters.as_string())
<< "\", suggested \"" << to_utf8(suggested) << '"' << endl;
FileDialog::Result result;
if (!suggested.empty())
dlg.selectFile(toqstr(suggested));
- lyxerr[Debug::GUI] << "Synchronous FileDialog: " << endl;
+ LYXERR(Debug::GUI) << "Synchronous FileDialog: " << endl;
int res = dlg.exec();
- lyxerr[Debug::GUI] << "result " << res << endl;
+ LYXERR(Debug::GUI) << "result " << res << endl;
if (res == QDialog::Accepted)
result.second = from_utf8(internal_path(
fromqstr(dlg.selectedFiles()[0])));
FileFilterList const & filters,
docstring const & suggested)
{
- lyxerr[Debug::GUI] << "Select with path \"" << to_utf8(path)
+ LYXERR(Debug::GUI) << "Select with path \"" << to_utf8(path)
<< "\", mask \"" << to_utf8(filters.as_string())
<< "\", suggested \"" << to_utf8(suggested) << '"' << endl;
FileDialog::Result result;
if (!suggested.empty())
dlg.selectFile(toqstr(suggested));
- lyxerr[Debug::GUI] << "Synchronous FileDialog: " << endl;
+ LYXERR(Debug::GUI) << "Synchronous FileDialog: " << endl;
int res = dlg.exec();
- lyxerr[Debug::GUI] << "result " << res << endl;
+ LYXERR(Debug::GUI) << "result " << res << endl;
if (res == QDialog::Accepted)
result.second = from_utf8(internal_path(
fromqstr(dlg.selectedFiles()[0])));
FileDialog::Result const FileDialog::opendir(docstring const & path,
docstring const & suggested)
{
- lyxerr[Debug::GUI] << "Select with path \"" << to_utf8(path)
+ LYXERR(Debug::GUI) << "Select with path \"" << to_utf8(path)
<< "\", suggested \"" << to_utf8(suggested) << '"' << endl;
FileDialog::Result result;
result.first = FileDialog::Chosen;
if (!suggested.empty())
dlg.selectFile(toqstr(suggested));
- lyxerr[Debug::GUI] << "Synchronous FileDialog: " << endl;
+ LYXERR(Debug::GUI) << "Synchronous FileDialog: " << endl;
int res = dlg.exec();
- lyxerr[Debug::GUI] << "result " << res << endl;
+ LYXERR(Debug::GUI) << "result " << res << endl;
if (res == QDialog::Accepted)
result.second = from_utf8(internal_path(
fromqstr(dlg.selectedFiles()[0])));
qApp->installTranslator(&qt_trans_);
// even if the language calls for RtL, don't do that
qApp->setLayoutDirection(Qt::LeftToRight);
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "Successfully installed Qt translations for locale "
<< fromqstr(language_name) << std::endl;
} else
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "Could not find Qt translations for locale "
<< fromqstr(language_name) << std::endl;
case SelectionRequest: {
if (xev->xselectionrequest.selection != XA_PRIMARY)
break;
- lyxerr[Debug::GUI] << "X requested selection." << endl;
+ LYXERR(Debug::GUI) << "X requested selection." << endl;
BufferView * bv = currentView()->view();
if (bv) {
docstring const sel = bv->requestSelection();
case SelectionClear: {
if (xev->xselectionclear.selection != XA_PRIMARY)
break;
- lyxerr[Debug::GUI] << "Lost selection." << endl;
+ LYXERR(Debug::GUI) << "Lost selection." << endl;
BufferView * bv = currentView()->view();
if (bv)
bv->clearSelection();
string const GuiClipboard::getAsLyX() const
{
- lyxerr[Debug::ACTION] << "GuiClipboard::getAsLyX(): `";
+ LYXERR(Debug::ACTION) << "GuiClipboard::getAsLyX(): `";
// We don't convert encodings here since the encoding of the
// clipboard contents is specified in the data itself
QMimeData const * source =
qApp->clipboard()->mimeData(QClipboard::Clipboard);
if (!source) {
- lyxerr[Debug::ACTION] << "' (no QMimeData)" << endl;
+ LYXERR(Debug::ACTION) << "' (no QMimeData)" << endl;
return string();
}
if (source->hasFormat(mime_type)) {
QByteArray const ar = source->data(mime_type);
string const s(ar.data(), ar.count());
if (lyxerr.debugging(Debug::ACTION))
- lyxerr[Debug::ACTION] << s << "'" << endl;
+ LYXERR(Debug::ACTION) << s << "'" << endl;
return s;
}
- lyxerr[Debug::ACTION] << "'" << endl;
+ LYXERR(Debug::ACTION) << "'" << endl;
return string();
}
// text data from other applications
QString const str = qApp->clipboard()->text(QClipboard::Clipboard);
if (lyxerr.debugging(Debug::ACTION))
- lyxerr[Debug::ACTION] << "GuiClipboard::getAsText(): `"
+ LYXERR(Debug::ACTION) << "GuiClipboard::getAsText(): `"
<< fromqstr(str) << "'" << endl;
if (str.isNull())
return docstring();
void GuiClipboard::put(string const & lyx, docstring const & text)
{
if (lyxerr.debugging(Debug::ACTION))
- lyxerr[Debug::ACTION] << "GuiClipboard::put(`" << lyx << "' `"
+ LYXERR(Debug::ACTION) << "GuiClipboard::put(`" << lyx << "' `"
<< to_utf8(text) << "')" << endl;
// We don't convert the encoding of lyx since the encoding of the
// clipboard contents is specified in the data itself
if (family == symbol_fonts[i].family)
return symbol_fonts[i].xlfd;
- lyxerr[Debug::FONT] << "BUG: family not found !" << endl;
+ LYXERR(Debug::FONT) << "BUG: family not found !" << endl;
return string();
}
// positions.
QFontInfo fi(font);
- lyxerr[Debug::FONT] << "got: " << fromqstr(fi.family()) << endl;
+ LYXERR(Debug::FONT) << "got: " << fromqstr(fi.family()) << endl;
if (contains(fromqstr(fi.family()), family)) {
- lyxerr[Debug::FONT] << " got it ";
+ LYXERR(Debug::FONT) << " got it ";
return true;
}
pair<QFont, bool> const getSymbolFont(string const & family)
{
- lyxerr[Debug::FONT] << "Looking for font family "
+ LYXERR(Debug::FONT) << "Looking for font family "
<< family << " ... ";
string upper = family;
upper[0] = toupper(family[0]);
font.setFamily(toqstr(family));
if (isChosenFont(font, family)) {
- lyxerr[Debug::FONT] << "normal!" << endl;
+ LYXERR(Debug::FONT) << "normal!" << endl;
return make_pair<QFont, bool>(font, true);
}
- lyxerr[Debug::FONT] << "Trying " << upper << " ... ";
+ LYXERR(Debug::FONT) << "Trying " << upper << " ... ";
font.setFamily(toqstr(upper));
if (isChosenFont(font, upper)) {
- lyxerr[Debug::FONT] << "upper!" << endl;
+ LYXERR(Debug::FONT) << "upper!" << endl;
return make_pair<QFont, bool>(font, true);
}
// A simple setFamily() fails on Qt 2
string const rawName = getRawName(family);
- lyxerr[Debug::FONT] << "Trying " << rawName << " ... ";
+ LYXERR(Debug::FONT) << "Trying " << rawName << " ... ";
font.setRawName(toqstr(rawName));
if (isChosenFont(font, family)) {
- lyxerr[Debug::FONT] << "raw version!" << endl;
+ LYXERR(Debug::FONT) << "raw version!" << endl;
return make_pair<QFont, bool>(font, true);
}
- lyxerr[Debug::FONT] << " FAILED :-(" << endl;
+ LYXERR(Debug::FONT) << " FAILED :-(" << endl;
return make_pair<QFont, bool>(font, false);
}
}
if (lyxerr.debugging(Debug::FONT)) {
- lyxerr[Debug::FONT] << "Font '" << to_utf8(f.stateText(0))
+ LYXERR(Debug::FONT) << "Font '" << to_utf8(f.stateText(0))
<< "' matched by\n" << fromqstr(font.family()) << endl;
}
// Is this an exact match?
if (font.exactMatch())
- lyxerr[Debug::FONT] << "This font is an exact match" << endl;
+ LYXERR(Debug::FONT) << "This font is an exact match" << endl;
else
- lyxerr[Debug::FONT] << "This font is NOT an exact match"
+ LYXERR(Debug::FONT) << "This font is NOT an exact match"
<< endl;
- lyxerr[Debug::FONT] << "XFLD: " << fromqstr(font.rawName()) << endl;
+ LYXERR(Debug::FONT) << "XFLD: " << fromqstr(font.rawName()) << endl;
font.setPointSizeF(convert<double>(lyxrc.font_sizes[f.size()])
* lyxrc.zoom / 100.0);
- lyxerr[Debug::FONT] << "The font has size: "
+ LYXERR(Debug::FONT) << "The font has size: "
<< font.pointSizeF() << endl;
if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
docstring const GuiSelection::get() const
{
QString const str = qApp->clipboard()->text(QClipboard::Selection);
- lyxerr[Debug::ACTION] << "GuiSelection::get: " << fromqstr(str)
+ LYXERR(Debug::ACTION) << "GuiSelection::get: " << fromqstr(str)
<< endl;
if (str.isNull())
return docstring();
void GuiSelection::put(docstring const & str)
{
- lyxerr[Debug::ACTION] << "GuiSelection::put: " << lyx::to_utf8(str) << endl;
+ LYXERR(Debug::ACTION) << "GuiSelection::put: " << lyx::to_utf8(str) << endl;
qApp->clipboard()->setText(toqstr(externalLineEnding(str)),
QClipboard::Selection);
// PageStep only depends on the viewport height.
verticalScrollBar()->setPageStep(viewport()->height());
- lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
<< "\n Area width\t" << width()
<< "\n Area height\t" << height()
<< "\n viewport width\t" << viewport()->width()
if (files.isEmpty())
return;
- lyxerr[Debug::GUI] << "GuiWorkArea::dropEvent: got URIs!" << endl;
+ LYXERR(Debug::GUI) << "GuiWorkArea::dropEvent: got URIs!" << endl;
for (int i = 0; i!=files.size(); ++i) {
string const file = os::internal_path(fromqstr(files.at(i).toLocalFile()));
if (!file.empty())
void GuiWorkArea::keyPressEvent(QKeyEvent * e)
{
- lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::KEY) << BOOST_CURRENT_FUNCTION
<< " count=" << e->count()
<< " text=" << fromqstr(e->text())
<< " isAutoRepeat=" << e->isAutoRepeat()
//if (!lyxrc.show_banner)
// return;
- lyxerr[Debug::GUI] << "show banner: " << lyxrc.show_banner << endl;
+ LYXERR(Debug::GUI) << "show banner: " << lyxrc.show_banner << endl;
/// The text to be written on top of the pixmap
QString const text = lyx_version ? QString(lyx_version) : qt_("unknown version");
FileName const file = support::libFileSearch("images", "banner", "ppm");
{
QRect const rc = ev->rect();
/*
- lyxerr[Debug::PAINTING] << "paintEvent begin: x: " << rc.x()
+ LYXERR(Debug::PAINTING) << "paintEvent begin: x: " << rc.x()
<< " y: " << rc.y()
<< " w: " << rc.width()
<< " h: " << rc.height() << endl;
QLPainter pain(&screen_);
if (greyed_out_) {
- lyxerr[Debug::GUI] << "splash screen requested" << endl;
+ LYXERR(Debug::GUI) << "splash screen requested" << endl;
verticalScrollBar()->hide();
doGreyOut(pain);
return;
if (!commit_string.isEmpty()) {
- lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::KEY) << BOOST_CURRENT_FUNCTION
<< " preeditString =" << fromqstr(e->preeditString())
<< " commitString =" << fromqstr(e->commitString())
<< endl;
// Reset last_searched_string in case of changed option.
if (last_case_sensitive != case_sensitive
|| last_reg_exp != reg_exp) {
- lyxerr[Debug::GUI] << "QCitation::findKey: optimisation disabled!" << std::endl;
+ LYXERR(Debug::GUI) << "QCitation::findKey: optimisation disabled!" << std::endl;
last_searched_string.clear();
}
// save option for next search.
void QGraphicsDialog::change_bb()
{
form_->controller().bbChanged = true;
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "[controller().bb_Changed set to true]\n";
form_->changed();
}
Formats::const_iterator end = formats.end();
-// lyxerr[Debug::GRAPHICS]
+// LYXERR(Debug::GRAPHICS)
// << "D:/msys/home/yns/src/lyx-devel/lib/images/banner.ppm is of format: "
// << fromqstr(Pic.pictureFormat("D:/msys/home/yns/src/lyx-devel/lib/images/banner.ppm"))
// << endl;
// if (Pic.pictureFormat("D:/msys/home/yns/src/lyx-devel/lib/images/banner.ppm"))
-// lyxerr[Debug::GRAPHICS]
+// LYXERR(Debug::GRAPHICS)
// << "pictureFormat not returned NULL\n" << endl;
// << "Supported formats are: " << Pic.inputFormats() << endl;
QList<QByteArray> qt_formats = QImageReader::supportedImageFormats ();
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\nThe image loader can load the following directly:\n";
if (qt_formats.empty())
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\nQt4 Problem: No Format available!" << endl;
for (QList<QByteArray>::const_iterator it =qt_formats.begin(); it != qt_formats.end(); ++it) {
- lyxerr[Debug::GRAPHICS] << (const char *) *it << ", ";
+ LYXERR(Debug::GRAPHICS) << (const char *) *it << ", ";
string ext = ascii_lowercase((const char *) *it);
}
if (lyxerr.debugging()) {
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\nOf these, LyX recognises the following formats:\n";
FormatList::const_iterator fbegin = fmts.begin();
FormatList::const_iterator fend = fmts.end();
for (FormatList::const_iterator fit = fbegin; fit != fend; ++fit) {
if (fit != fbegin)
- lyxerr[Debug::GRAPHICS] << ", ";
- lyxerr[Debug::GRAPHICS] << *fit;
+ LYXERR(Debug::GRAPHICS) << ", ";
+ LYXERR(Debug::GRAPHICS) << *fit;
}
- lyxerr[Debug::GRAPHICS] << '\n' << endl;
+ LYXERR(Debug::GRAPHICS) << '\n' << endl;
}
return fmts;
void QLImage::load_impl(support::FileName const & filename)
{
if (!original_.isNull()) {
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "Image is loaded already!" << endl;
finishedLoading(false);
return;
}
if (!original_.load(toqstr(filename.absFilename()))) {
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "Unable to open image" << endl;
finishedLoading(false);
return;
{
macxMenuBarInit();
- lyxerr[Debug::GUI] << "populating menu bar" << lyx::to_utf8(menubackend_.getMenubar().name()) << endl;
+ LYXERR(Debug::GUI) << "populating menu bar" << lyx::to_utf8(menubackend_.getMenubar().name()) << endl;
if (menubackend_.getMenubar().size() == 0) {
- lyxerr[Debug::GUI] << "\tERROR: empty menu bar" << lyx::to_utf8(menubackend_.getMenubar().name()) << endl;
+ LYXERR(Debug::GUI) << "\tERROR: empty menu bar" << lyx::to_utf8(menubackend_.getMenubar().name()) << endl;
return;
// continue;
}
else {
- lyxerr[Debug::GUI] << "menu bar entries " << menubackend_.getMenubar().size();
+ LYXERR(Debug::GUI) << "menu bar entries " << menubackend_.getMenubar().size();
}
// for (; m != end; ++m) {
for (; m != end; ++m) {
if (m->kind() != MenuItem::Submenu) {
- lyxerr[Debug::GUI] << "\tERROR: not a submenu " << lyx::to_utf8(m->label()) << endl;
+ LYXERR(Debug::GUI) << "\tERROR: not a submenu " << lyx::to_utf8(m->label()) << endl;
continue;
}
- lyxerr[Debug::GUI] << "menu bar item " << lyx::to_utf8(m->label()) << " is a submenu named " << lyx::to_utf8(m->submenuname()) << endl;
+ LYXERR(Debug::GUI) << "menu bar item " << lyx::to_utf8(m->label()) << " is a submenu named " << lyx::to_utf8(m->submenuname()) << endl;
docstring name = m->submenuname();
if (!menubackend_.hasMenu(name)) {
- lyxerr[Debug::GUI] << "\tERROR: " << lyx::to_utf8(name) << " submenu has no menu!" << endl;
+ LYXERR(Debug::GUI) << "\tERROR: " << lyx::to_utf8(name) << " submenu has no menu!" << endl;
continue;
}
pair<NameMap::iterator, bool> I = name_map_.insert(make_pair(name, qMenu));
if (!I.second) {
- lyxerr[Debug::GUI] << "\tERROR: " << lyx::to_utf8(name) << " submenu is already there!" << endl;
+ LYXERR(Debug::GUI) << "\tERROR: " << lyx::to_utf8(name) << " submenu is already there!" << endl;
}
/*
QObject::connect(qMenu, SIGNAL(aboutToShow()), this, SLOT(update()));
setLayoutDirection(Qt::LeftToRight);
if (isDrawingEnabled()) {
if (lyxerr.debugging(Debug::PAINTING)) {
- lyxerr[Debug::PAINTING] << "draw " << std::string(str.toUtf8())
+ LYXERR(Debug::PAINTING) << "draw " << std::string(str.toUtf8())
<< " at " << x << "," << y << std::endl;
}
// Qt4 does not display a glyph whose codepoint is the
void QLPopupMenu::update()
{
- lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION << endl;
- lyxerr[Debug::GUI] << "\tTriggered menu: " << lyx::to_utf8(name_) << endl;
+ LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION << endl;
+ LYXERR(Debug::GUI) << "\tTriggered menu: " << lyx::to_utf8(name_) << endl;
clear();
owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view()->buffer());
if (!owner_->backend().hasMenu(topLevelMenu_.name())) {
- lyxerr[Debug::GUI] << "\tWARNING: menu seems empty" << lyx::to_utf8(topLevelMenu_.name()) << endl;
+ LYXERR(Debug::GUI) << "\tWARNING: menu seems empty" << lyx::to_utf8(topLevelMenu_.name()) << endl;
}
populate(this, &topLevelMenu_);
}
void QLPopupMenu::populate(QMenu* qMenu, Menu * menu)
{
- lyxerr[Debug::GUI] << "populating menu " << lyx::to_utf8(menu->name()) ;
+ LYXERR(Debug::GUI) << "populating menu " << lyx::to_utf8(menu->name()) ;
if (menu->size() == 0) {
- lyxerr[Debug::GUI] << "\tERROR: empty menu " << lyx::to_utf8(menu->name()) << endl;
+ LYXERR(Debug::GUI) << "\tERROR: empty menu " << lyx::to_utf8(menu->name()) << endl;
return;
}
else {
- lyxerr[Debug::GUI] << " ***** menu entries " << menu->size() << endl;
+ LYXERR(Debug::GUI) << " ***** menu entries " << menu->size() << endl;
}
Menu::const_iterator m = menu->begin();
if (m->kind() == MenuItem::Separator) {
qMenu->addSeparator();
- lyxerr[Debug::GUI] << "adding Menubar Separator" << endl;
+ LYXERR(Debug::GUI) << "adding Menubar Separator" << endl;
} else if (m->kind() == MenuItem::Submenu) {
- lyxerr[Debug::GUI] << "** creating New Sub-Menu " << lyx::to_utf8(getLabel(*m)) << endl;
+ LYXERR(Debug::GUI) << "** creating New Sub-Menu " << lyx::to_utf8(getLabel(*m)) << endl;
QMenu * subMenu = qMenu->addMenu(toqstr(getLabel(*m)));
populate(subMenu, m->submenu());
} else { // we have a MenuItem::Command
- lyxerr[Debug::GUI] << "creating Menu Item " << lyx::to_utf8(m->label()) << endl;
+ LYXERR(Debug::GUI) << "creating Menu Item " << lyx::to_utf8(m->label()) << endl;
docstring label = getLabel(*m);
addBinding(label, *m);
EncodingMap::const_iterator cit = encoding_map.find(encoding);
if (cit == encoding_map.end()) {
- lyxerr[Debug::KEY] << "Unrecognised encoding '" << encoding
+ LYXERR(Debug::KEY) << "Unrecognised encoding '" << encoding
<< "'." << endl;
codec = encoding_map.find("")->second;
} else {
}
if (!codec) {
- lyxerr[Debug::KEY] << "No codec for encoding '" << encoding
+ LYXERR(Debug::KEY) << "No codec for encoding '" << encoding
<< "' found." << endl;
return 0;
}
- lyxerr[Debug::KEY] << "Using codec " << fromqstr(codec->name()) << endl;
+ LYXERR(Debug::KEY) << "Using codec " << fromqstr(codec->name()) << endl;
if (!codec->canEncode(str)) {
- lyxerr[Debug::KEY] << "Oof. Can't encode the text !" << endl;
+ LYXERR(Debug::KEY) << "Oof. Can't encode the text !" << endl;
return 0;
}
key_ = ev->key();
if (ev->text().isNull()) {
if (lyxerr.debugging())
- lyxerr[Debug::KEY] << "keyevent has isNull() text !" << endl;
+ LYXERR(Debug::KEY) << "keyevent has isNull() text !" << endl;
text_ = "";
return;
}
text_ = ev->text();
if (lyxerr.debugging())
- lyxerr[Debug::KEY] << "Setting key to " << key_ << ", " << fromqstr(text_) << endl;
+ LYXERR(Debug::KEY) << "Setting key to " << key_ << ", " << fromqstr(text_) << endl;
}
key_ = string_to_qkey(symbolname);
text_ = toqstr(symbolname);
if (lyxerr.debugging())
- lyxerr[Debug::KEY] << "Init key to " << key_ << ", " << fromqstr(text_) << endl;
+ LYXERR(Debug::KEY) << "Init key to " << key_ << ", " << fromqstr(text_) << endl;
}
{
bool const ok(!(text_.isEmpty() && key_ == Qt::Key_unknown));
if (lyxerr.debugging())
- lyxerr[Debug::KEY] << "isOK is " << ok << endl;
+ LYXERR(Debug::KEY) << "isOK is " << ok << endl;
return ok;
}
{
bool const mod(q_is_modifier(key_));
if (lyxerr.debugging())
- lyxerr[Debug::KEY] << "isMod is " << mod << endl;
+ LYXERR(Debug::KEY) << "isMod is " << mod << endl;
return mod;
}
if (lyxerr.debugging() && text_.size() > 1) {
// We don't know yet how well support the full ucs4 range.
- lyxerr[Debug::KEY] << "QLyXKeySym::getUCSEncoded()" << endl;
+ LYXERR(Debug::KEY) << "QLyXKeySym::getUCSEncoded()" << endl;
for (int i = 0; i < text_.size(); ++i) {
- lyxerr[Debug::KEY] << "char " << i << ": "
+ LYXERR(Debug::KEY) << "char " << i << ": "
<< text_[i].unicode() << endl;
}
}
{
if (text_.isEmpty()) {
if (lyxerr.debugging())
- lyxerr[Debug::KEY] << "text_ empty, isText() == false" << endl;
+ LYXERR(Debug::KEY) << "text_ empty, isText() == false" << endl;
return false;
}
return 0;
if (toc_models_.empty()) {
- lyxerr[Debug::GUI] << "QToc::tocModel(): no types available " << endl;
+ LYXERR(Debug::GUI) << "QToc::tocModel(): no types available " << endl;
return 0;
}
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "QToc: type_ " << type
<< " toc_models_.size() " << toc_models_.size()
<< endl;
{
if (type < 0 || !index.isValid()
|| index.model() != toc_models_[type]) {
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "QToc::goTo(): QModelIndex is invalid!"
<< endl;
return;
TocIterator const it = toc_models_[type]->tocIterator(index);
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "QToc::goTo " << lyx::to_utf8(it->str())
<< endl;
toc_map_.insert( TocPair(top_level_item, iter) );
model_map_[iter] = top_level_item;
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "Toc: at depth " << iter->depth()
<< ", added item " << lyx::to_utf8(iter->str())
<< endl;
void TocWidget::selectionChanged(const QModelIndex & current,
const QModelIndex & /*previous*/)
{
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "selectionChanged index " << current.row()
<< ", " << current.column()
<< endl;
void TocWidget::select(QModelIndex const & index)
{
if (!index.isValid()) {
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "TocWidget::select(): QModelIndex is invalid!" << endl;
return;
}
void TocWidget::update()
{
- lyxerr[Debug::GUI] << "In TocWidget::update()" << endl;
+ LYXERR(Debug::GUI) << "In TocWidget::update()" << endl;
select(form_->getCurrentIndex(typeCO->currentIndex()));
QWidget::update();
}
depthSL->setMaximum(form_->getTocDepth(type));
depthSL->setValue(depth_);
- lyxerr[Debug::GUI] << "In TocWidget::updateGui()" << endl;
+ LYXERR(Debug::GUI) << "In TocWidget::updateGui()" << endl;
select(form_->getCurrentIndex(typeCO->currentIndex()));
if (toc_model) {
- lyxerr[Debug::GUI]
+ LYXERR(Debug::GUI)
<< "form_->tocModel()->rowCount "
<< toc_model->rowCount()
<< "\nform_->tocModel()->columnCount "
QString const name(toqstr(n));
- lyxerr[Debug::GUI] << "addCategory n= " << lyx::to_utf8(n) << " parent= " << endl;
+ LYXERR(Debug::GUI) << "addCategory n= " << lyx::to_utf8(n) << " parent= " << endl;
int depth = 1;
{
// Is the file in the cache already?
if (inCache(file)) {
- lyxerr[Debug::GRAPHICS] << "Cache::add(" << file << "):\n"
+ LYXERR(Debug::GRAPHICS) << "Cache::add(" << file << "):\n"
<< "The file is already in the cache."
<< std::endl;
return;
void CacheItem::Impl::imageConverted(bool success)
{
string const text = success ? "succeeded" : "failed";
- lyxerr[Debug::GRAPHICS] << "Image conversion " << text << '.' << endl;
+ LYXERR(Debug::GRAPHICS) << "Image conversion " << text << '.' << endl;
file_to_load_ = converter_.get() ?
FileName(converter_->convertedFile()) : FileName();
success = !file_to_load_.empty() && isFileReadable(file_to_load_);
if (!success) {
- lyxerr[Debug::GRAPHICS] << "Unable to find converted file!"
+ LYXERR(Debug::GRAPHICS) << "Unable to find converted file!"
<< endl;
setStatus(ErrorConverting);
void CacheItem::Impl::loadImage()
{
setStatus(Loading);
- lyxerr[Debug::GRAPHICS] << "Loading image." << endl;
+ LYXERR(Debug::GRAPHICS) << "Loading image." << endl;
image_ = Image::newImage();
void CacheItem::Impl::imageLoaded(bool success)
{
string const text = success ? "succeeded" : "failed";
- lyxerr[Debug::GRAPHICS] << "Image loading " << text << '.' << endl;
+ LYXERR(Debug::GRAPHICS) << "Image loading " << text << '.' << endl;
// Clean up after loading.
if (zipped_)
if (lyx::graphics::Converter::isReachable(from, *it))
return *it;
else
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "Unable to convert from " << from
<< " to " << *it << std::endl;
}
if (!isFileReadable(filename_)) {
if (status_ != ErrorNoFile) {
setStatus(ErrorNoFile);
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tThe file is not readable" << endl;
}
return;
unzipped_filename_ = tempName(FileName(), filename_.toFilesystemEncoding());
if (unzipped_filename_.empty()) {
setStatus(ErrorConverting);
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tCould not create temporary file." << endl;
return;
}
filename = filename_;
docstring const displayed_filename = makeDisplayPath(filename_.absFilename());
- lyxerr[Debug::GRAPHICS] << "[graphics::CacheItem::Impl::convertToDisplayFormat]\n"
+ LYXERR(Debug::GRAPHICS) << "[graphics::CacheItem::Impl::convertToDisplayFormat]\n"
<< "\tAttempting to convert image file: " << filename
<< "\n\twith displayed filename: " << lyx::to_utf8(displayed_filename)
<< endl;
string const from = formats.getFormatFromFile(filename);
if (from.empty()) {
setStatus(ErrorConverting);
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tCould not determine file format." << endl;
}
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\n\tThe file contains " << from << " format data." << endl;
to_ = findTargetFormat(from);
if (from == to_) {
// No conversion needed!
- lyxerr[Debug::GRAPHICS] << "\tNo conversion needed (from == to)!" << endl;
+ LYXERR(Debug::GRAPHICS) << "\tNo conversion needed (from == to)!" << endl;
file_to_load_ = filename;
loadImage();
return;
}
if (ConverterCache::get().inCache(filename, to_)) {
- lyxerr[Debug::GRAPHICS] << "\tNo conversion needed (file in file cache)!"
+ LYXERR(Debug::GRAPHICS) << "\tNo conversion needed (file in file cache)!"
<< endl;
file_to_load_ = ConverterCache::get().cacheName(filename, to_);
loadImage();
return;
}
- lyxerr[Debug::GRAPHICS] << "\tConverting it to " << to_ << " format." << endl;
+ LYXERR(Debug::GRAPHICS) << "\tConverting it to " << to_ << " format." << endl;
// Add some stuff to create a uniquely named temporary file.
// This file is deleted in loadImage after it is loaded into memory.
string const & from_format, string const & to_format)
: valid_process_(false), finished_(false)
{
- lyxerr[Debug::GRAPHICS] << "Converter c-tor:\n"
+ LYXERR(Debug::GRAPHICS) << "Converter c-tor:\n"
<< "\tfrom_file: " << from_file
<< "\n\tto_file_base: " << to_file_base
<< "\n\tfrom_format: " << from_format
// The conversion commands are stored in a stringstream
ostringstream script;
build_script(from_file, to_file_base, from_format, to_format, script);
- lyxerr[Debug::GRAPHICS] << "\tConversion script:"
+ LYXERR(Debug::GRAPHICS) << "\tConversion script:"
<< "\n--------------------------------------\n"
<< script.str()
<< "\n--------------------------------------\n";
ostream & script)
{
BOOST_ASSERT(from_format != to_format);
- lyxerr[Debug::GRAPHICS] << "build_script ... ";
+ LYXERR(Debug::GRAPHICS) << "build_script ... ";
typedef Converters::EdgePath EdgePath;
script << "#!/usr/bin/env python\n"
<< to_format << ":' + '\"' + outfile + '\"' + '";
string const command = os.str();
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tNo converter defined! I use convertDefault.py\n\t"
<< command << endl;
// Move the final outfile to to_file
script << move_file("outfile", quoteName(to_file, quote_python));
- lyxerr[Debug::GRAPHICS] << "ready!" << endl;
+ LYXERR(Debug::GRAPHICS) << "ready!" << endl;
}
} // namespace graphics
height = getHeight();
}
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "graphics::Image::getScaledDimensions()"
<< "\n\tparams.scale : " << params.scale
<< "\n\twidth : " << width
void LoaderQueue::loadNext()
{
- lyxerr[Debug::GRAPHICS] << "LoaderQueue: "
+ LYXERR(Debug::GRAPHICS) << "LoaderQueue: "
<< cache_queue_.size()
<< " items in the queue" << endl;
int counter = s_numimages_;
{
s_numimages_ = numimages;
s_millisecs_ = millisecs;
- lyxerr[Debug::GRAPHICS] << "LoaderQueue: priority set to "
+ LYXERR(Debug::GRAPHICS) << "LoaderQueue: priority set to "
<< s_numimages_ << " images at a time, "
<< s_millisecs_ << " milliseconds between calls"
<< endl;
void LoaderQueue::startLoader()
{
- lyxerr[Debug::GRAPHICS] << "LoaderQueue: waking up" << endl;
+ LYXERR(Debug::GRAPHICS) << "LoaderQueue: waking up" << endl;
running_ = true ;
timer.setTimeout(s_millisecs_);
timer.start();
{
timer.stop();
running_ = false ;
- lyxerr[Debug::GRAPHICS] << "LoaderQueue: I'm going to sleep" << endl;
+ LYXERR(Debug::GRAPHICS) << "LoaderQueue: I'm going to sleep" << endl;
}
font_scaling_factor_ = 0.01 * lyxrc.dpi * lyxrc.zoom *
convert<double>(lyxrc.preview_scale_factor);
- lyxerr[Debug::GRAPHICS] << "The font scaling factor is "
+ LYXERR(Debug::GRAPHICS) << "The font scaling factor is "
<< font_scaling_factor_ << endl;
if (!pconverter_)
if (snippet.empty())
return;
- lyxerr[Debug::GRAPHICS] << "adding snippet:\n" << snippet << endl;
+ LYXERR(Debug::GRAPHICS) << "adding snippet:\n" << snippet << endl;
pending_.push_back(snippet);
}
if (!buffer_.fully_loaded())
return;
- lyxerr[Debug::GRAPHICS] << "PreviewLoader::startLoading()" << endl;
+ LYXERR(Debug::GRAPHICS) << "PreviewLoader::startLoading()" << endl;
// As used by the LaTeX file and by the resulting image files
string const directory = buffer_.temppath();
// command is missing.
odocfstream of(latexfile.toFilesystemEncoding().c_str());
if (!of) {
- lyxerr[Debug::GRAPHICS] << "PreviewLoader::startLoading()\n"
+ LYXERR(Debug::GRAPHICS) << "PreviewLoader::startLoading()\n"
<< "Unable to create LaTeX file\n"
<< latexfile << endl;
return;
int ret = call.startscript(command, convert_ptr);
if (ret != 0) {
- lyxerr[Debug::GRAPHICS] << "PreviewLoader::startLoading()\n"
+ LYXERR(Debug::GRAPHICS) << "PreviewLoader::startLoading()\n"
<< "Unable to start process\n"
<< command << endl;
return;
string const command = git->second.command;
string const status = retval > 0 ? "failed" : "succeeded";
- lyxerr[Debug::GRAPHICS] << "PreviewLoader::finishedInProgress("
+ LYXERR(Debug::GRAPHICS) << "PreviewLoader::finishedInProgress("
<< retval << "): processing " << status
<< " for " << command << endl;
if (retval > 0)
if (from_checksum != temp_checksum) {
Mover const & mover = getMover(from_format);
if (!mover.copy(params.filename, temp_file)) {
- lyxerr[Debug::EXTERNAL]
+ LYXERR(Debug::EXTERNAL)
<< "external::updateExternal. "
<< "Unable to copy "
<< params.filename << " to " << temp_file << endl;
Converters::try_default | Converters::try_cache);
if (!success)
- lyxerr[Debug::EXTERNAL]
+ LYXERR(Debug::EXTERNAL)
<< "external::updateExternal. "
<< "Unable to convert from "
<< from_format << " to " << to_format << endl;
Template::Formats::const_iterator cit = et.formats.find(format);
if (cit == et.formats.end()) {
- lyxerr[Debug::EXTERNAL]
+ LYXERR(Debug::EXTERNAL)
<< "External template format '" << format
<< "' not specified in template "
<< params.templatename() << endl;
void InsetBase::edit(LCursor &, bool)
{
- lyxerr[Debug::INSETS] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::INSETS) << BOOST_CURRENT_FUNCTION
<< ": edit left/right" << std::endl;
}
InsetBase * InsetBase::editXY(LCursor &, int x, int y)
{
- lyxerr[Debug::INSETS] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::INSETS) << BOOST_CURRENT_FUNCTION
<< ": x=" << x << " y= " << y
<< std::endl;
return this;
bibfiles = split(bibfiles, tmp, ',');
while (!tmp.empty()) {
FileName const file = findtexfile(changeExtension(tmp, "bib"), "bib");
- lyxerr[Debug::LATEX] << "Bibfile: " << file << endl;
+ LYXERR(Debug::LATEX) << "Bibfile: " << file << endl;
// If we didn't find a matching file name just fail silently
if (!file.empty())
changed = true;
lyxerr << "Couldn't find or read bibtex file "
<< f << endl;
- lyxerr[Debug::DEBUG] << "Fs error: "
+ LYXERR(Debug::DEBUG) << "Fs error: "
<< fserr.what() << endl;
}
}
if (lex.eatLine()) {
setParam("type", lex.getDocString());
- lyxerr[Debug::INSETS] << "FloatList::float_type: "
+ LYXERR(Debug::INSETS) << "FloatList::float_type: "
<< to_ascii(getParam("type")) << endl;
if (!floats.typeExist(to_ascii(getParam("type"))))
lex.printError("InsetFloatList: Unknown float type: `$$Token'");
{
// Are we using latex or pdflatex?
if (runparams.flavor == OutputParams::PDFLATEX) {
- lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode" << endl;
+ LYXERR(Debug::GRAPHICS) << "findTargetFormat: PDF mode" << endl;
Format const * const f = formats.getFormat(format);
// Convert vector graphics to pdf
if (f && f->vectorFormat())
return "png";
}
// If it's postscript, we always do eps.
- lyxerr[Debug::GRAPHICS] << "findTargetFormat: PostScript mode" << endl;
+ LYXERR(Debug::GRAPHICS) << "findTargetFormat: PostScript mode" << endl;
if (format != "ps")
// any other than ps is changed to eps
return "eps";
if (token == "Graphics")
readInsetGraphics(lex, buf.filePath());
else
- lyxerr[Debug::GRAPHICS] << "Not a Graphics inset!" << endl;
+ LYXERR(Debug::GRAPHICS) << "Not a Graphics inset!" << endl;
graphic_->update(params().as_grfxParams());
}
lex.next();
string const token = lex.getString();
- lyxerr[Debug::GRAPHICS] << "Token: '" << token << '\''
+ LYXERR(Debug::GRAPHICS) << "Token: '" << token << '\''
<< endl;
if (token.empty()) {
bool const success = mover.copy(file_in, file_out);
if (!success) {
// FIXME UNICODE
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< to_utf8(support::bformat(_("Could not copy the file\n%1$s\n"
"into the temporary directory."),
from_utf8(file_in.absFilename())))
// this file, but we can't check, because that would
// mean to unzip the file and thereby making the
// noUnzip parameter meaningless.
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tpass zipped file to LaTeX.\n";
FileName const bb_orig_file = FileName(changeExtension(orig_file, "bb"));
// temp_file has been unzipped already and
// orig_file has not changed in the meantime.
temp_file = unzipped_temp_file;
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\twas already unzipped to " << temp_file
<< endl;
} else {
// unzipped_temp_file does not exist or is too old
temp_file = unzipFile(temp_file);
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tunzipped to " << temp_file << endl;
}
}
string const from = formats.getFormatFromFile(temp_file);
if (from.empty()) {
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tCould not get file format." << endl;
}
string const to = findTargetFormat(from, runparams);
string const ext = formats.extension(to);
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\t we have: from " << from << " to " << to << '\n';
// We're going to be running the exported buffer through the LaTeX
// compiler, so must ensure that LaTeX can cope with the graphics
// file format.
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tthe orig file is: " << orig_file << endl;
if (from == to) {
output_file = changeExtension(output_file, ext);
source_file = FileName(changeExtension(source_file.absFilename(), ext));
} else
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "Could not rename file `"
<< temp_file << "' to `" << new_file
<< "'." << endl;
// Yes if to_file does not exist or if temp_file is newer than to_file
if (compare_timestamps(temp_file, to_file) < 0) {
// FIXME UNICODE
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< to_utf8(bformat(_("No conversion of %1$s is needed after all"),
from_utf8(rel_file)))
<< std::endl;
return stripExtensionIfPossible(output_to_file, runparams.nice);
}
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tThe original file is " << orig_file << "\n"
<< "\tA copy has been made and convert is to be called with:\n"
<< "\tfile to convert = " << temp_file << '\n'
{
// If there is no file specified or not existing,
// just output a message about it in the latex output.
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "insetgraphics::latex: Filename = "
<< params().filename.absFilename() << endl;
// "filename" found. In this case LaTeX
// draws only a rectangle with the above bb and the
// not found filename in it.
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tMessage = \"" << message << '\"' << endl;
// These variables collect all the latex code that should be before and
// Write the options if there are any.
string const opts = createLatexOptions();
- lyxerr[Debug::GRAPHICS] << "\tOpts = " << opts << endl;
+ LYXERR(Debug::GRAPHICS) << "\tOpts = " << opts << endl;
if (!opts.empty() && !message.empty())
before += ('[' + opts + ',' + message + ']');
else if (!opts.empty() || !message.empty())
before += ('[' + opts + message + ']');
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "\tBefore = " << before
<< "\n\tafter = " << after << endl;
// FIXME UNICODE
os << from_utf8(latex_str);
- lyxerr[Debug::GRAPHICS] << "InsetGraphics::latex outputting:\n"
+ LYXERR(Debug::GRAPHICS) << "InsetGraphics::latex outputting:\n"
<< latex_str << endl;
// Return how many newlines we issued.
return int(lyx::count(latex_str.begin(), latex_str.end(),'\n'));
// Get the original Bounding Box from the file
string const tmp = readBB_from_PSFile(filename);
- lyxerr[Debug::GRAPHICS] << "BB_from_File: " << tmp << std::endl;
+ LYXERR(Debug::GRAPHICS) << "BB_from_File: " << tmp << std::endl;
if (!tmp.empty()) {
#ifdef WITH_WARNINGS
# warning why not convert to unsigned int? (Lgb)
if (!runparams.nice)
incfile = mangled;
- lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
- lyxerr[Debug::LATEX] << "exportfile:" << exportfile << endl;
- lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
+ LYXERR(Debug::LATEX) << "incfile:" << incfile << endl;
+ LYXERR(Debug::LATEX) << "exportfile:" << exportfile << endl;
+ LYXERR(Debug::LATEX) << "writefile:" << writefile << endl;
if (runparams.inComment || runparams.dryrun)
// Don't try to load or copy the file
if (checksum_in != checksum_out) {
if (!copy(included_file, writefile)) {
// FIXME UNICODE
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< to_utf8(bformat(_("Could not copy the file\n%1$s\n"
"into the temporary directory."),
from_utf8(included_file.absFilename())))
if (!runparams.nice)
incfile = mangled;
- lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
- lyxerr[Debug::LATEX] << "exportfile:" << exportfile << endl;
- lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
+ LYXERR(Debug::LATEX) << "incfile:" << incfile << endl;
+ LYXERR(Debug::LATEX) << "exportfile:" << exportfile << endl;
+ LYXERR(Debug::LATEX) << "writefile:" << writefile << endl;
tmp->makeDocBookFile(writefile, runparams, true);
}
void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
{
- lyxerr[Debug::DEBUG] << "# InsetTabular::doDispatch: cmd: " << cmd
+ LYXERR(Debug::DEBUG) << "# InsetTabular::doDispatch: cmd: " << cmd
<< "\n cur:" << cur << endl;
CursorSlice sl = cur.top();
LCursor & bvcur = cur.bv().cursor();
void InsetText::doDispatch(LCursor & cur, FuncRequest & cmd)
{
- lyxerr[Debug::ACTION] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::ACTION) << BOOST_CURRENT_FUNCTION
<< " [ cmd.action = "
<< cmd.action << ']' << endl;
text_.dispatch(cur, cmd);
void Intl::initKeyMapper(bool on)
{
- lyxerr[Debug::INIT] << "Initializing key mappings..." << endl;
+ LYXERR(Debug::INIT) << "Initializing key mappings..." << endl;
if (trans.setPrimary(prim_lang) == -1)
prim_lang.erase();
ISpell::ISpell(BufferParams const & params, string const & lang)
: in(0), out(0), inerr(0), str(0)
{
- lyxerr[Debug::GUI] << "Created ispell" << endl;
+ LYXERR(Debug::GUI) << "Created ispell" << endl;
encoding = params.encoding().iconvName();
ISpell::~ISpell()
{
- lyxerr[Debug::GUI] << "Killing ispell" << endl;
+ LYXERR(Debug::GUI) << "Killing ispell" << endl;
if (in)
fclose(in);
if (res == string::npos) {
defkey(&k, func);
} else {
- lyxerr[Debug::KBMAP] << "Parse error at position " << res
+ LYXERR(Debug::KBMAP) << "Parse error at position " << res
<< " in key sequence '" << seq << "'."
<< endl;
}
return false;
}
- lyxerr[Debug::KBMAP] << "Reading bind file:" << tmp << endl;
+ LYXERR(Debug::KBMAP) << "Reading bind file:" << tmp << endl;
bool error = false;
while (lexrc.isOK()) {
&& mod2 == it->mod.second) {
// overwrite binding
if (r + 1 == seq->length()) {
- lyxerr[Debug::KBMAP]
+ LYXERR(Debug::KBMAP)
<< "Warning: New binding for '"
<< to_utf8(seq->print(false))
<< "' is overriding old binding..."
lang = lex.getString();
else
break;
- lyxerr[Debug::INFO] << "Reading language " << lang << endl;
+ LYXERR(Debug::INFO) << "Reading language " << lang << endl;
if (lex.next())
babel = lex.getString();
// Split argument by :
string name;
string tmpname = split(filename, name, ':');
- lyxerr[Debug::INFO] << "Arg is " << filename
+ LYXERR(Debug::INFO) << "Arg is " << filename
<< "\nName is " << name
<< "\nTemplate is " << tmpname << endl;
// do any other cleanup procedures now
if (package().temp_dir() != package().system_temp_dir()) {
- lyxerr[Debug::INFO] << "Deleting tmp dir "
+ LYXERR(Debug::INFO) << "Deleting tmp dir "
<< package().temp_dir() << endl;
if (!destroyDir(FileName(package().temp_dir()))) {
}
// Initialization of LyX (reads lyxrc and more)
- lyxerr[Debug::INIT] << "Initializing LyX::init..." << endl;
+ LYXERR(Debug::INIT) << "Initializing LyX::init..." << endl;
bool success = init();
- lyxerr[Debug::INIT] << "Initializing LyX::init...done" << endl;
+ LYXERR(Debug::INIT) << "Initializing LyX::init...done" << endl;
if (!success)
return EXIT_FAILURE;
if (batch_command.empty())
return;
- lyxerr[Debug::INIT] << "About to handle -x '"
+ LYXERR(Debug::INIT) << "About to handle -x '"
<< batch_command << '\'' << endl;
pimpl_->lyxfunc_.dispatch(lyxaction.lookupFunc(batch_command));
return false;
// Load the layouts
- lyxerr[Debug::INIT] << "Reading layouts..." << endl;
+ LYXERR(Debug::INIT) << "Reading layouts..." << endl;
if (!LyXSetStyle())
return false;
lyxerr << "LyX tmp dir: `" << package().temp_dir() << '\'' << endl;
}
- lyxerr[Debug::INIT] << "Reading session information '.lyx/session'..." << endl;
+ LYXERR(Debug::INIT) << "Reading session information '.lyx/session'..." << endl;
pimpl_->session_.reset(new Session(lyxrc.num_lastfiles));
// This must happen after package initialization and after lyxrc is
bool LyX::readRcFile(string const & name)
{
- lyxerr[Debug::INIT] << "About to read " << name << "... ";
+ LYXERR(Debug::INIT) << "About to read " << name << "... ";
FileName const lyxrc_path = libFileSearch(string(), name);
if (!lyxrc_path.empty()) {
- lyxerr[Debug::INIT] << "Found in " << lyxrc_path << endl;
+ LYXERR(Debug::INIT) << "Found in " << lyxrc_path << endl;
if (lyxrc.read(lyxrc_path) < 0) {
showFileError(name);
return false;
}
} else
- lyxerr[Debug::INIT] << "Not found." << lyxrc_path << endl;
+ LYXERR(Debug::INIT) << "Not found." << lyxrc_path << endl;
return true;
}
std::list<string>::const_iterator end = uifiles.end();
it = std::find(it, end, name);
if (it != end) {
- lyxerr[Debug::INIT] << "UI file '" << name
+ LYXERR(Debug::INIT) << "UI file '" << name
<< "' has been read already. "
<< "Is this an include loop?"
<< endl;
return false;
}
- lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
+ LYXERR(Debug::INIT) << "About to read " << name << "..." << endl;
FileName ui_path;
ui_path = libFileSearch("ui", name, "ui");
if (ui_path.empty()) {
- lyxerr[Debug::INIT] << "Could not find " << name << endl;
+ LYXERR(Debug::INIT) << "Could not find " << name << endl;
showFileError(name);
return false;
}
uifiles.push_back(name);
- lyxerr[Debug::INIT] << "Found " << name
+ LYXERR(Debug::INIT) << "Found " << name
<< " in " << ui_path << endl;
LyXLex lex(uitags, ui_last - 1);
lex.setFile(ui_path);
// Read the languages file `name'
bool LyX::readLanguagesFile(string const & name)
{
- lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
+ LYXERR(Debug::INIT) << "About to read " << name << "..." << endl;
FileName const lang_path = libFileSearch(string(), name);
if (lang_path.empty()) {
bool LyX::readEncodingsFile(string const & enc_name,
string const & symbols_name)
{
- lyxerr[Debug::INIT] << "About to read " << enc_name << " and "
+ LYXERR(Debug::INIT) << "About to read " << enc_name << " and "
<< symbols_name << "..." << endl;
FileName const symbols_path = libFileSearch(string(), symbols_name);
void LyXFunc::processKeySym(LyXKeySymPtr keysym, key_modifier::state state)
{
- lyxerr[Debug::KEY] << "KeySym is " << keysym->getSymbolName() << endl;
+ LYXERR(Debug::KEY) << "KeySym is " << keysym->getSymbolName() << endl;
// Do nothing if we have nothing (JMarc)
if (!keysym->isOK()) {
- lyxerr[Debug::KEY] << "Empty kbd action (probably composing)"
+ LYXERR(Debug::KEY) << "Empty kbd action (probably composing)"
<< endl;
return;
}
if (keysym->isModifier()) {
- lyxerr[Debug::KEY] << "isModifier true" << endl;
+ LYXERR(Debug::KEY) << "isModifier true" << endl;
return;
}
cancel_meta_seq->reset();
FuncRequest func = cancel_meta_seq->addkey(keysym, state);
- lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::KEY) << BOOST_CURRENT_FUNCTION
<< " action first set to [" << func.action << ']'
<< endl;
if ((func.action != LFUN_CANCEL) && (func.action != LFUN_META_PREFIX)) {
// remove Caps Lock and Mod2 as a modifiers
func = keyseq->addkey(keysym, (state | meta_fake_bit));
- lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::KEY) << BOOST_CURRENT_FUNCTION
<< "action now set to ["
<< func.action << ']' << endl;
}
// Let's see. But only if shift is the only modifier
if (func.action == LFUN_UNKNOWN_ACTION &&
state == key_modifier::shift) {
- lyxerr[Debug::KEY] << "Trying without shift" << endl;
+ LYXERR(Debug::KEY) << "Trying without shift" << endl;
func = keyseq->addkey(keysym, key_modifier::none);
- lyxerr[Debug::KEY] << "Action now " << func.action << endl;
+ LYXERR(Debug::KEY) << "Action now " << func.action << endl;
}
if (func.action == LFUN_UNKNOWN_ACTION) {
// if it's normal insertable text not already covered
// by a binding
if (keysym->isText() && keyseq->length() == 1) {
- lyxerr[Debug::KEY] << "isText() is true, inserting." << endl;
+ LYXERR(Debug::KEY) << "isText() is true, inserting." << endl;
func = FuncRequest(LFUN_SELF_INSERT,
FuncRequest::KEYBOARD);
} else {
- lyxerr[Debug::KEY] << "Unknown, !isText() - giving up" << endl;
+ LYXERR(Debug::KEY) << "Unknown, !isText() - giving up" << endl;
lyx_view_->message(_("Unknown function."));
return;
}
docstring const arg(1, encoded_last_key);
dispatch(FuncRequest(LFUN_SELF_INSERT, arg,
FuncRequest::KEYBOARD));
- lyxerr[Debug::KEY]
+ LYXERR(Debug::KEY)
<< "SelfInsert arg[`" << to_utf8(arg) << "']" << endl;
}
} else {
string const argument = to_utf8(cmd.argument());
kb_action const action = cmd.action;
- lyxerr[Debug::ACTION] << endl << "LyXFunc::dispatch: cmd: " << cmd << endl;
+ LYXERR(Debug::ACTION) << endl << "LyXFunc::dispatch: cmd: " << cmd << endl;
//lyxerr << "LyXFunc::dispatch: cmd: " << cmd << endl;
// we have not done anything wrong yet.
FuncStatus const flag = getStatus(cmd);
if (!flag.enabled()) {
// We cannot use this function here
- lyxerr[Debug::ACTION] << "LyXFunc::dispatch: "
+ LYXERR(Debug::ACTION) << "LyXFunc::dispatch: "
<< lyxaction.getActionName(action)
<< " [" << action << "] is disabled at this location"
<< endl;
case LFUN_SERVER_GET_NAME:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
setMessage(from_utf8(lyx_view_->buffer()->fileName()));
- lyxerr[Debug::INFO] << "FNAME["
+ LYXERR(Debug::INFO) << "FNAME["
<< lyx_view_->buffer()->fileName()
<< "] " << endl;
break;
|| cmd.origin == FuncRequest::COMMANDBUFFER);
if (cmd.action == LFUN_SELF_INSERT || !verbose) {
- lyxerr[Debug::ACTION] << "dispatch msg is " << to_utf8(msg) << endl;
+ LYXERR(Debug::ACTION) << "dispatch msg is " << to_utf8(msg) << endl;
if (!msg.empty())
lyx_view_->message(msg);
return;
dispatch_msg += '(' + rtrim(comname) + ')';
}
- lyxerr[Debug::ACTION] << "verbose dispatch msg "
+ LYXERR(Debug::ACTION) << "verbose dispatch msg "
<< to_utf8(dispatch_msg) << endl;
if (!dispatch_msg.empty())
lyx_view_->message(dispatch_msg);
string format;
string filename = split(argument, format, ' ');
- lyxerr[Debug::INFO] << "LyXFunc::doImport: " << format
+ LYXERR(Debug::INFO) << "LyXFunc::doImport: " << format
<< " file: " << filename << endl;
// need user interaction
string const token = trim(getString(), " \t");
- lyxerr[Debug::PARSER] << "LongString: `"
+ LYXERR(Debug::PARSER) << "LongString: `"
<< getString() << '\'' << endl;
// We do a case independent comparison, like search_kw does.
if (i != string::npos)
prefix = tmpstr.substr(0, i);
firstline = false;
- lyxerr[Debug::PARSER]
+ LYXERR(Debug::PARSER)
<< "Prefix = `" << prefix << "\'" << endl;
}
string const format = getFormatFromContents(filename);
if (format == "gzip" || format == "zip" || format == "compress") {
- lyxerr[Debug::LYXLEX] << "lyxlex: compressed" << endl;
+ LYXERR(Debug::LYXLEX) << "lyxlex: compressed" << endl;
// The check only outputs a debug message, because it triggers
// a bug in compaq cxx 6.2, where is_open() returns 'true' for
// a fresh new filebuf. (JMarc)
if (!gz_.empty() || istream::off_type(is.tellg()) > -1)
- lyxerr[Debug::LYXLEX] << "Error in LyXLex::setFile: "
+ LYXERR(Debug::LYXLEX) << "Error in LyXLex::setFile: "
"file or stream already set." << endl;
gz_.push(io::gzip_decompressor());
gz_.push(io::file_source(filename.toFilesystemEncoding()));
lineno = 0;
return gz_.component<io::file_source>(1)->is_open() && is.good();
} else {
- lyxerr[Debug::LYXLEX] << "lyxlex: UNcompressed" << endl;
+ LYXERR(Debug::LYXLEX) << "lyxlex: UNcompressed" << endl;
// The check only outputs a debug message, because it triggers
// a bug in compaq cxx 6.2, where is_open() returns 'true' for
// a fresh new filebuf. (JMarc)
if (fb_.is_open() || istream::off_type(is.tellg()) > 0)
- lyxerr[Debug::LYXLEX] << "Error in LyXLex::setFile: "
+ LYXERR(Debug::LYXLEX) << "Error in LyXLex::setFile: "
"file or stream already set." << endl;
fb_.open(filename.toFilesystemEncoding().c_str(), ios::in);
is.rdbuf(&fb_);
void LyXLex::Pimpl::setStream(istream & i)
{
if (fb_.is_open() || istream::off_type(is.tellg()) > 0)
- lyxerr[Debug::LYXLEX] << "Error in LyXLex::setStream: "
+ LYXERR(Debug::LYXLEX) << "Error in LyXLex::setStream: "
"file or stream already set." << endl;
is.rdbuf(i.rdbuf());
lineno = 0;
string dummy;
getline(is, dummy);
- lyxerr[Debug::LYXLEX] << "Comment read: `" << c
+ LYXERR(Debug::LYXLEX) << "Comment read: `" << c
<< dummy << '\'' << endl;
#else
// unfortunately ignore is buggy (Lgb)
string dummy;
getline(is, dummy);
- lyxerr[Debug::LYXLEX] << "Comment read: `" << c
+ LYXERR(Debug::LYXLEX) << "Comment read: `" << c
<< dummy << '\'' << endl;
#else
// but ignore is also still buggy (Lgb)
while (is && c != '\n') {
is.get(cc);
c = cc;
- //lyxerr[Debug::LYXLEX] << "LyXLex::EatLine read char: `"
+ //LYXERR(Debug::LYXLEX) << "LyXLex::EatLine read char: `"
// << c << '\'' << endl;
if (c != '\r')
buff.push_back(c);
lexrc.setFile(filename);
if (!lexrc.isOK()) return -2;
- lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
+ LYXERR(Debug::LYXRC) << "Reading '" << filename << "'..." << endl;
return read(lexrc);
}
lexrc.setStream(is);
if (!lexrc.isOK()) return -2;
- lyxerr[Debug::LYXRC] << "Reading istream..." << endl;
+ LYXERR(Debug::LYXRC) << "Reading istream..." << endl;
return read(lexrc);
}
void LyXComm::openConnection()
{
- lyxerr[Debug::LYXSERVER] << "LyXComm: Opening connection" << endl;
+ LYXERR(Debug::LYXSERVER) << "LyXComm: Opening connection" << endl;
// If we are up, that's an error
if (ready) {
ready = false;
if (pipename.empty()) {
- lyxerr[Debug::LYXSERVER]
+ LYXERR(Debug::LYXSERVER)
<< "LyXComm: server is disabled, nothing to do"
<< endl;
return;
// We made it!
ready = true;
- lyxerr[Debug::LYXSERVER] << "LyXComm: Connection established" << endl;
+ LYXERR(Debug::LYXSERVER) << "LyXComm: Connection established" << endl;
}
/// Close pipes
void LyXComm::closeConnection()
{
- lyxerr[Debug::LYXSERVER] << "LyXComm: Closing connection" << endl;
+ LYXERR(Debug::LYXSERVER) << "LyXComm: Closing connection" << endl;
if (pipename.empty()) {
- lyxerr[Debug::LYXSERVER]
+ LYXERR(Debug::LYXSERVER)
<< "LyXComm: server is disabled, nothing to do"
<< endl;
return;
// the delim /wasn't/ found. ?:-P
string cmd;
read_buffer_= split(read_buffer_, cmd,'\n');
- lyxerr[Debug::LYXSERVER]
+ LYXERR(Debug::LYXSERVER)
<< "LyXComm: status:" << status
<< ", read_buffer_:" << read_buffer_
<< ", cmd:" << cmd << endl;
void LyXServer::callback(LyXServer * serv, string const & msg)
{
- lyxerr[Debug::LYXSERVER] << "LyXServer: Received: '"
+ LYXERR(Debug::LYXSERVER) << "LyXServer: Received: '"
<< msg << '\'' << endl;
char const * p = msg.c_str();
if (*p) ++p;
}
- lyxerr[Debug::LYXSERVER]
+ LYXERR(Debug::LYXSERVER)
<< "LyXServer: Client: '" << client
<< "' Command: '" << cmd
<< "' Argument: '" << arg << '\'' << endl;
if (cmd == "hello") {
// One more client
if (serv->numclients == MAX_CLIENTS) { //paranoid check
- lyxerr[Debug::LYXSERVER]
+ LYXERR(Debug::LYXSERVER)
<< "LyXServer: too many clients..."
<< endl;
return;
serv->clients[i] = client;
serv->numclients++;
buf = "LYXSRV:" + client + ":hello\n";
- lyxerr[Debug::LYXSERVER]
+ LYXERR(Debug::LYXSERVER)
<< "LyXServer: Greeting "
<< client << endl;
serv->pipes.send(buf);
if (i < serv->numclients) {
serv->numclients--;
serv->clients[i].erase();
- lyxerr[Debug::LYXSERVER]
+ LYXERR(Debug::LYXSERVER)
<< "LyXServer: Client "
<< client << " said goodbye"
<< endl;
} else {
- lyxerr[Debug::LYXSERVER]
+ LYXERR(Debug::LYXSERVER)
<< "LyXServer: ignoring bye messge from unregistered client"
<< client << endl;
}
boost::bind(&LyXServerSocket::serverCallback, this)
);
- lyxerr[Debug::LYXSERVER] << "lyx: New server socket "
+ LYXERR(Debug::LYXSERVER) << "lyx: New server socket "
<< fd_ << ' ' << address_ << endl;
}
<< " IO error on closing: " << strerror(errno);
}
support::unlink(support::FileName(address_));
- lyxerr[Debug::LYXSERVER] << "lyx: Server socket quitting" << endl;
+ LYXERR(Debug::LYXSERVER) << "lyx: Server socket quitting" << endl;
}
int const client_fd = support::socktools::accept(fd_);
if (fd_ == -1) {
- lyxerr[Debug::LYXSERVER] << "lyx: Failed to accept new client"
+ LYXERR(Debug::LYXSERVER) << "lyx: Failed to accept new client"
<< endl;
return;
}
LyXDataSocket::LyXDataSocket(int fd)
: fd_(fd), connected_(true)
{
- lyxerr[Debug::LYXSERVER] << "lyx: New data socket " << fd_ << endl;
+ LYXERR(Debug::LYXSERVER) << "lyx: New data socket " << fd_ << endl;
}
<< " IO error on closing: " << strerror(errno);
theApp()->unregisterSocketCallback(fd_);
- lyxerr[Debug::LYXSERVER] << "lyx: Data socket " << fd_ << " quitting."
+ LYXERR(Debug::LYXSERVER) << "lyx: Data socket " << fd_ << " quitting."
<< endl;
}
// Error conditions. The buffer must still be
// processed for lines read
if (count == 0) { // EOF -- connection closed
- lyxerr[Debug::LYXSERVER] << "lyx: Data socket " << fd_
+ LYXERR(Debug::LYXSERVER) << "lyx: Data socket " << fd_
<< ": connection closed." << endl;
connected_ = false;
} else if ((count == -1) && (errno != EAGAIN)) { // IO error
// Cut a line from buffer
string::size_type pos = buffer_.find('\n');
if (pos == string::npos) {
- lyxerr[Debug::LYXSERVER] << "lyx: Data socket " << fd_
+ LYXERR(Debug::LYXSERVER) << "lyx: Data socket " << fd_
<< ": line not completed." << endl;
return false; // No complete line stored
}
<< ' ' << quoteName(tempfile.toFilesystemEncoding());
string const command_str = command.str();
- lyxerr[Debug::TCLASS] << "Running `" << command_str << '\'' << endl;
+ LYXERR(Debug::TCLASS) << "Running `" << command_str << '\'' << endl;
support::cmd_ret const ret =
support::runCommand(command_str);
bool LyXTextClass::do_readStyle(LyXLex & lexrc, LyXLayout & lay)
{
- lyxerr[Debug::TCLASS] << "Reading style " << lay.name() << endl;
+ LYXERR(Debug::TCLASS) << "Reading style " << lay.name() << endl;
if (!lay.read(lexrc, *this)) {
// Resolve fonts
lay.resfont = lay.font;
};
if (!merge)
- lyxerr[Debug::TCLASS] << "Reading textclass "
+ LYXERR(Debug::TCLASS) << "Reading textclass "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< endl;
else
- lyxerr[Debug::TCLASS] << "Reading input file "
+ LYXERR(Debug::TCLASS) << "Reading input file "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< endl;
}
if (format != FORMAT) {
- lyxerr[Debug::TCLASS] << "Converting layout file from format "
+ LYXERR(Debug::TCLASS) << "Converting layout file from format "
<< format << " to " << FORMAT << endl;
FileName const tempfile(support::tempName());
error = !layout2layout(filename, tempfile);
}
if (!merge) { // we are at top level here.
- lyxerr[Debug::TCLASS] << "Finished reading textclass "
+ LYXERR(Debug::TCLASS) << "Finished reading textclass "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< endl;
if (defaultlayout_.empty()) {
toclevel);
}
}
- lyxerr[Debug::TCLASS]
+ LYXERR(Debug::TCLASS)
<< "Minimum TocLevel is " << min_toclevel_
<< ", maximum is " << max_toclevel_ <<endl;
} else
- lyxerr[Debug::TCLASS] << "Finished reading input file "
+ LYXERR(Debug::TCLASS) << "Finished reading input file "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< endl;
{
LyXLex lex(0, 0);
support::FileName const real_file = libFileSearch("", "textclass.lst");
- lyxerr[Debug::TCLASS] << "Reading textclasses from `"
+ LYXERR(Debug::TCLASS) << "Reading textclasses from `"
<< real_file << '\'' << endl;
if (real_file.empty()) {
bool finished = false;
// Parse config-file
- lyxerr[Debug::TCLASS] << "Starting parsing of textclass.lst" << endl;
+ LYXERR(Debug::TCLASS) << "Starting parsing of textclass.lst" << endl;
while (lex.isOK() && !finished) {
- lyxerr[Debug::TCLASS] << "\tline by line" << endl;
+ LYXERR(Debug::TCLASS) << "\tline by line" << endl;
switch (lex.lex()) {
case LyXLex::LEX_FEOF:
finished = true;
break;
default:
string const fname = lex.getString();
- lyxerr[Debug::TCLASS] << "Fname: " << fname << endl;
+ LYXERR(Debug::TCLASS) << "Fname: " << fname << endl;
if (lex.next()) {
string const clname = lex.getString();
- lyxerr[Debug::TCLASS] << "Clname: " << clname << endl;
+ LYXERR(Debug::TCLASS) << "Clname: " << clname << endl;
if (lex.next()) {
string const desc = lex.getString();
- lyxerr[Debug::TCLASS] << "Desc: " << desc << endl;
+ LYXERR(Debug::TCLASS) << "Desc: " << desc << endl;
if (lex.next()) {
bool avail = lex.getBool();
- lyxerr[Debug::TCLASS] << "Avail: " << avail << endl;
+ LYXERR(Debug::TCLASS) << "Avail: " << avail << endl;
// This code is run when we have
// fname, clname, desc, and avail
LyXTextClass tmpl(fname, clname, desc, avail);
}
}
}
- lyxerr[Debug::TCLASS] << "End of parsing of textclass.lst" << endl;
+ LYXERR(Debug::TCLASS) << "End of parsing of textclass.lst" << endl;
if (classlist_.empty()) {
lyxerr << "LyXTextClassList::Read: no textclasses found!"
// NOTE: latex class name is defined in textclass.layout, which can be different from textclass
FileName const layout_file(addName(path, textclass + ".layout"));
if (fs::exists(layout_file.toFilesystemEncoding())) {
- lyxerr[Debug::TCLASS] << "Adding class " << textclass << " from directory " << path << endl;
+ 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,
// Reads the style files
bool LyXSetStyle()
{
- lyxerr[Debug::TCLASS] << "LyXSetStyle: parsing configuration..." << endl;
+ LYXERR(Debug::TCLASS) << "LyXSetStyle: parsing configuration..." << endl;
if (!textclasslist.read()) {
- lyxerr[Debug::TCLASS] << "LyXSetStyle: an error occured "
+ LYXERR(Debug::TCLASS) << "LyXSetStyle: an error occured "
"during parsing.\n Exiting." << endl;
return false;
}
- lyxerr[Debug::TCLASS] << "LyXSetStyle: configuration parsed." << endl;
+ LYXERR(Debug::TCLASS) << "LyXSetStyle: configuration parsed." << endl;
return true;
}
FileName const cvs_entries(makeAbsPath("CVS/Entries"));
if (isFileReadable(cvs_entries)) {
- lyxerr[Debug::LYXVC]
+ LYXERR(Debug::LYXVC)
<< "LyXVC: registering "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< " with CVS" << endl;
vcs.reset(new CVS(cvs_entries, filename));
} else {
- lyxerr[Debug::LYXVC]
+ LYXERR(Debug::LYXVC)
<< "LyXVC: registering "
<< to_utf8(makeDisplayPath(filename.absFilename()))
<< " with RCS" << endl;
vcs->owner(owner_);
}
- lyxerr[Debug::LYXVC] << "LyXVC: registrer" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: registrer" << endl;
pair<bool, docstring> tmp =
Alert::askForText(_("LyX VC: Initial description"),
_("(no initial description)"));
if (!tmp.first || tmp.second.empty()) {
// should we insist on checking tmp.second.empty()?
- lyxerr[Debug::LYXVC] << "LyXVC: user cancelled" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: user cancelled" << endl;
return;
}
void LyXVC::checkIn()
{
- lyxerr[Debug::LYXVC] << "LyXVC: checkIn" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: checkIn" << endl;
pair<bool, docstring> tmp = Alert::askForText(_("LyX VC: Log Message"));
if (tmp.first) {
if (tmp.second.empty()) {
}
vcs->checkIn(to_utf8(tmp.second));
} else {
- lyxerr[Debug::LYXVC] << "LyXVC: user cancelled" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: user cancelled" << endl;
}
}
void LyXVC::checkOut()
{
- lyxerr[Debug::LYXVC] << "LyXVC: checkOut" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: checkOut" << endl;
vcs->checkOut();
}
void LyXVC::revert()
{
- lyxerr[Debug::LYXVC] << "LyXVC: revert" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: revert" << endl;
docstring const file = makeDisplayPath(owner_->fileName(), 20);
docstring text = bformat(_("Reverting to the stored version of the "
{
switch (vcs->status()) {
case VCS::UNLOCKED:
- lyxerr[Debug::LYXVC] << "LyXVC: toggle to locked" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: toggle to locked" << endl;
checkOut();
break;
case VCS::LOCKED:
- lyxerr[Debug::LYXVC] << "LyXVC: toggle to unlocked" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: toggle to unlocked" << endl;
checkIn();
break;
}
FileName const tmpf(tempName(FileName(), "lyxvclog"));
if (tmpf.empty()) {
- lyxerr[Debug::LYXVC] << "Could not generate logfile "
+ LYXERR(Debug::LYXVC) << "Could not generate logfile "
<< tmpf << endl;
return string();
}
- lyxerr[Debug::LYXVC] << "Generating logfile " << tmpf << endl;
+ LYXERR(Debug::LYXVC) << "Generating logfile " << tmpf << endl;
vcs->getLog(tmpf);
return tmpf.absFilename();
}
//}
} else {
if (os.firstitem())
- lyxerr[Debug::MATHED] << "suppressing {} when writing"
+ LYXERR(Debug::MATHED) << "suppressing {} when writing"
<< endl;
else
os << "{}";
bool Correction::correct(MathAtom & at, char_type c) const
{
- //lyxerr[Debug::MATHED]
+ //LYXERR(Debug::MATHED)
// << "trying to correct ar: " << at << " from: '" << from1_ << '\'' << endl;
if (from2_ != c)
return false;
if (asString(at) != asString(from1_))
return false;
- lyxerr[Debug::MATHED]
+ LYXERR(Debug::MATHED)
<< "match found! subst in " << at
<< " from: '" << from1_ << "' to '" << to_ << '\'' << endl;
at = to_;
void initAutoCorrect()
{
- lyxerr[Debug::MATHED] << "reading autocorrect file" << endl;
+ LYXERR(Debug::MATHED) << "reading autocorrect file" << endl;
support::FileName const file = libFileSearch(string(), "autocorrect");
if (file.empty()) {
lyxerr << "Could not find autocorrect file" << endl;
ifstream is(file.toFilesystemEncoding().c_str());
while (getline(is, line)) {
if (line.size() == 0 || line[0] == '#') {
- //lyxerr[Debug::MATHED] << "ignoring line '" << line << '\'' << endl;
+ //LYXERR(Debug::MATHED) << "ignoring line '" << line << '\'' << endl;
continue;
}
idocstringstream il(from_utf8(line));
- //lyxerr[Debug::MATHED] << "line '" << line << '\'' << endl;
+ //LYXERR(Debug::MATHED) << "line '" << line << '\'' << endl;
Correction corr;
if (corr.read(il)) {
- //lyxerr[Debug::MATHED] << "parsed: '" << corr << '\'' << endl;
+ //LYXERR(Debug::MATHED) << "parsed: '" << corr << '\'' << endl;
theCorrections.insert(corr);
}
}
- lyxerr[Debug::MATHED] << "done reading autocorrections." << endl;
+ LYXERR(Debug::MATHED) << "done reading autocorrections." << endl;
}
return true;
}
- lyxerr[Debug::MATHED]
+ LYXERR(Debug::MATHED)
<< "font " << to_utf8(name) << " not available and I can't fake it"
<< endl;
return false;
void initSymbols()
{
support::FileName const filename = libFileSearch(string(), "symbols");
- lyxerr[Debug::MATHED] << "read symbols from " << filename << endl;
+ LYXERR(Debug::MATHED) << "read symbols from " << filename << endl;
if (filename.empty()) {
lyxerr << "Could not find symbols file" << endl;
return;
if (is)
is >> tmp.requires;
else {
- lyxerr[Debug::MATHED] << "skipping line '" << line << '\'' << endl;
- lyxerr[Debug::MATHED]
+ LYXERR(Debug::MATHED) << "skipping line '" << line << '\'' << endl;
+ LYXERR(Debug::MATHED)
<< to_utf8(tmp.name) << ' ' << to_utf8(tmp.inset) << ' ' << to_utf8(tmp.extra) << endl;
continue;
}
docstring symbol_font = from_ascii("lyxsymbol");
if (tmp.extra == "func" || tmp.extra == "funclim" || tmp.extra == "special") {
- lyxerr[Debug::MATHED] << "symbol abuse for " << to_utf8(tmp.name) << endl;
+ LYXERR(Debug::MATHED) << "symbol abuse for " << to_utf8(tmp.name) << endl;
tmp.draw = tmp.name;
} else if (math_font_available(tmp.inset)) {
- lyxerr[Debug::MATHED] << "symbol available for " << to_utf8(tmp.name) << endl;
+ LYXERR(Debug::MATHED) << "symbol available for " << to_utf8(tmp.name) << endl;
tmp.draw.push_back(char_type(charid));
} else if (fallbackid && math_font_available(symbol_font)) {
if (tmp.inset == "cmex")
tmp.inset = from_ascii("lyxsymbol");
else
tmp.inset = from_ascii("lyxboldsymbol");
- lyxerr[Debug::MATHED] << "symbol fallback for " << to_utf8(tmp.name) << endl;
+ LYXERR(Debug::MATHED) << "symbol fallback for " << to_utf8(tmp.name) << endl;
tmp.draw.push_back(char_type(fallbackid));
} else {
- lyxerr[Debug::MATHED] << "faking " << to_utf8(tmp.name) << endl;
+ LYXERR(Debug::MATHED) << "faking " << to_utf8(tmp.name) << endl;
tmp.draw = tmp.name;
tmp.inset = from_ascii("lyxtex");
}
} else {
// it's a proper inset
- lyxerr[Debug::MATHED] << "inset " << to_utf8(tmp.inset)
+ LYXERR(Debug::MATHED) << "inset " << to_utf8(tmp.inset)
<< " used for " << to_utf8(tmp.name)
<< endl;
}
if (theWordList.find(tmp.name) != theWordList.end())
- lyxerr[Debug::MATHED]
+ LYXERR(Debug::MATHED)
<< "readSymbols: inset " << to_utf8(tmp.name)
<< " already exists." << endl;
else
theWordList[tmp.name] = tmp;
- lyxerr[Debug::MATHED]
+ LYXERR(Debug::MATHED)
<< "read symbol '" << to_utf8(tmp.name)
<< " inset: " << to_utf8(tmp.inset)
<< " draw: " << int(tmp.draw.empty() ? 0 : tmp.draw[0])
// strip off any encoding suffix, i.e., assume 8-bit po files
string::size_type i = lang_.find(".");
lang_ = lang_.substr(0, i);
- lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION
+ LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION
<< ": language(" << lang_ << ")" << endl;
}
char const * c = bindtextdomain(PACKAGE, package().locale_dir().c_str());
int e = errno;
if (e) {
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION << '\n'
<< "Error code: " << errno << '\n'
<< "Lang, mess: " << lang_ << " " << m << '\n'
}
if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION << '\n'
<< "Error code: " << errno << '\n'
<< "Codeset : " << ucs4_codeset << '\n'
else
translated = from_ascii(tmp);
} else {
- lyxerr[Debug::DEBUG] << "We got a translation" << endl;
+ LYXERR(Debug::DEBUG) << "We got a translation" << endl;
char_type const * ucs4 = reinterpret_cast<char_type const *>(msg);
translated = ucs4;
}
odocstream & os, TexRow & texrow,
OutputParams const & runparams)
{
- lyxerr[Debug::LATEX] << "TeXDeeper... " << &*pit << endl;
+ LYXERR(Debug::LATEX) << "TeXDeeper... " << &*pit << endl;
ParagraphList::const_iterator par = pit;
while (par != paragraphs.end() &&
os, texrow, runparams);
}
}
- lyxerr[Debug::LATEX] << "TeXDeeper...done " << endl;
+ LYXERR(Debug::LATEX) << "TeXDeeper...done " << endl;
return par;
}
odocstream & os, TexRow & texrow,
OutputParams const & runparams)
{
- lyxerr[Debug::LATEX] << "TeXEnvironment... " << &*pit << endl;
+ LYXERR(Debug::LATEX) << "TeXEnvironment... " << &*pit << endl;
BufferParams const & bparams = buf.params();
OutputParams const & runparams_in,
string const & everypar)
{
- lyxerr[Debug::LATEX] << "TeXOnePar... " << &*pit << " '"
+ LYXERR(Debug::LATEX) << "TeXOnePar... " << &*pit << " '"
<< everypar << "'" << endl;
BufferParams const & bparams = buf.params();
LyXLayout_ptr style;
oldEnc.name() != newEnc.name() &&
oldEnc.name() != "ascii" && newEnc.name() != "ascii" &&
oldEnc.name() != "tis620-0" && newEnc.name() != "tis620-0") {
- lyxerr[Debug::LATEX] << "Changing LaTeX encoding from "
+ LYXERR(Debug::LATEX) << "Changing LaTeX encoding from "
<< oldEnc.name() << " to "
<< newEnc.name() << endl;
os << setEncoding(newEnc.iconvName());
break;
case '\0':
- lyxerr[Debug::INFO] <<
+ LYXERR(Debug::INFO) <<
"writePlaintextFile: NULL char in structure." << endl;
break;
odocstream & os, TexRow & texrow,
OutputParams const & runparams) const
{
- lyxerr[Debug::LATEX] << "SimpleTeXOnePar... " << this << endl;
+ LYXERR(Debug::LATEX) << "SimpleTeXOnePar... " << this << endl;
bool return_value = false;
runparams.moving_arg);
}
- lyxerr[Debug::LATEX] << "SimpleTeXOnePar...done " << this << endl;
+ LYXERR(Debug::LATEX) << "SimpleTeXOnePar...done " << this << endl;
return return_value;
}
// marked as unmodified. Otherwise, its change is adopted by the first
// character of the next paragraph.
if (par.lookupChange(par.size()).type != Change::UNCHANGED) {
- lyxerr[Debug::CHANGES] <<
+ LYXERR(Debug::CHANGES) <<
"merging par with inserted/deleted end-of-par character" << endl;
par.setChange(par.size(), Change(Change::UNCHANGED));
}
FontList::const_iterator fend = fontlist.end();
for (; fcit != fend; ++fcit) {
if (fcit->font().noun() == LyXFont::ON) {
- lyxerr[Debug::LATEX] << "font.noun: "
+ LYXERR(Debug::LATEX) << "font.noun: "
<< fcit->font().noun()
<< endl;
features.require("noun");
- lyxerr[Debug::LATEX] << "Noun enabled. Font: "
+ LYXERR(Debug::LATEX) << "Noun enabled. Font: "
<< to_utf8(fcit->font().stateText(0))
<< endl;
}
break;
default:
features.require("color");
- lyxerr[Debug::LATEX] << "Color enabled. Font: "
+ LYXERR(Debug::LATEX) << "Color enabled. Font: "
<< to_utf8(fcit->font().stateText(0))
<< endl;
}
language != latex_language)
{
features.useLanguage(language);
- lyxerr[Debug::LATEX] << "Found language "
+ LYXERR(Debug::LATEX) << "Found language "
<< language->babel() << endl;
}
}
: els(0), spell_error_object(0)
{
addManager(lang);
- lyxerr[Debug::GUI] << "created pspell" << endl;
+ LYXERR(Debug::GUI) << "created pspell" << endl;
}
PSpell::~PSpell()
{
- lyxerr[Debug::GUI] << "killed pspell" << endl;
+ LYXERR(Debug::GUI) << "killed pspell" << endl;
if (spell_error_object) {
delete_pspell_can_have_error(spell_error_object);
// 12 lines lower):
if (lyxerr.debugging(Debug::PAINTING)) {
if (text.isMainText(*pi.base.bv->buffer()))
- lyxerr[Debug::PAINTING] << "#";
+ LYXERR(Debug::PAINTING) << "#";
else
- lyxerr[Debug::PAINTING] << "[" <<
+ LYXERR(Debug::PAINTING) << "[" <<
repaintAll << row_has_changed <<
cursor_on_row << "]";
}
pi.pain.setDrawingEnabled(true);
if (lyxerr.debugging(Debug::PAINTING)) {
- lyxerr[Debug::PAINTING] << "." << endl;
+ LYXERR(Debug::PAINTING) << "." << endl;
}
}
lastfiles.size() < num_lastfiles)
lastfiles.push_back(file);
else
- lyxerr[Debug::INIT] << "LyX: Warning: Ignore last file: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: Ignore last file: " << tmp << endl;
} while (is.good());
}
if (0 < no && no <= absolute_max_last_files)
num_lastfiles = no;
else {
- lyxerr[Debug::INIT] << "LyX: session: too many last files\n"
+ LYXERR(Debug::INIT) << "LyX: session: too many last files\n"
<< "\tdefault (=" << default_num_last_files
<< ") used." << endl;
num_lastfiles = default_num_last_files;
!fs::is_directory(file.toFilesystemEncoding()))
lastopened.push_back(file);
else
- lyxerr[Debug::INIT] << "LyX: Warning: Ignore last opened file: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: Ignore last opened file: " << tmp << endl;
} while (is.good());
}
lastfilepos.size() < num_lastfilepos)
lastfilepos[file] = boost::tie(pit, pos);
else
- lyxerr[Debug::INIT] << "LyX: Warning: Ignore pos of last file: " << fname << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: Ignore pos of last file: " << fname << endl;
} catch (...) {
- lyxerr[Debug::INIT] << "LyX: Warning: unknown pos of last file: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: unknown pos of last file: " << tmp << endl;
}
} while (is.good());
}
idx <= max_bookmarks)
bookmarks[idx] = Bookmark(file, pit, 0, pos);
else
- lyxerr[Debug::INIT] << "LyX: Warning: Ignore bookmark of file: " << fname << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: Ignore bookmark of file: " << fname << endl;
} catch (...) {
- lyxerr[Debug::INIT] << "LyX: Warning: unknown Bookmark info: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: unknown Bookmark info: " << tmp << endl;
}
} while (is.good());
}
value >> posy;
toolbars.push_back(boost::make_tuple(key, ToolbarInfo(state, location, posx, posy)));
} else
- lyxerr[Debug::INIT] << "LyX: Warning: Ignore toolbar info: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: Ignore toolbar info: " << tmp << endl;
} catch (...) {
- lyxerr[Debug::INIT] << "LyX: Warning: unknown Toolbar info: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: unknown Toolbar info: " << tmp << endl;
}
} while (is.good());
// sort the toolbars by location, line and position
string value = tmp.substr(pos + 3);
sessioninfo[key] = value;
} else
- lyxerr[Debug::INIT] << "LyX: Warning: Ignore session info: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: Ignore session info: " << tmp << endl;
} catch (...) {
- lyxerr[Debug::INIT] << "LyX: Warning: unknown Session info: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: unknown Session info: " << tmp << endl;
}
} while (is.good());
}
else if (tmp == sec_session)
sessionInfo().read(is);
else
- lyxerr[Debug::INIT] << "LyX: Warning: unknown Session section: " << tmp << endl;
+ LYXERR(Debug::INIT) << "LyX: Warning: unknown Session section: " << tmp << endl;
}
}
toolbars().write(os);
sessionInfo().write(os);
} else
- lyxerr[Debug::INIT] << "LyX: Warning: unable to save Session: "
+ LYXERR(Debug::INIT) << "LyX: Warning: unable to save Session: "
<< session_file << endl;
}
// false: not writeable
bool isDirWriteable(FileName const & path)
{
- lyxerr[Debug::FILES] << "isDirWriteable: " << path << endl;
+ LYXERR(Debug::FILES) << "isDirWriteable: " << path << endl;
FileName const tmpfl(tempName(path, "lyxwritetest"));
string const encoded_dir = dir.toFilesystemEncoding();
if (!(fs::exists(encoded_dir) && fs::is_directory(encoded_dir))) {
- lyxerr[Debug::FILES]
+ LYXERR(Debug::FILES)
<< "Directory \"" << dir
<< "\" does not exist to DirList." << endl;
return dirlist;
FileName const createTmpDir(FileName const & tempdir, string const & mask)
{
- lyxerr[Debug::FILES]
+ LYXERR(Debug::FILES)
<< "createTmpDir: tempdir=`" << tempdir << "'\n"
<< "createTmpDir: mask=`" << mask << '\'' << endl;
bool firstLine = true;
while ((count++ < max_count) && format.empty()) {
if (ifs.eof()) {
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "filetools(getFormatFromContents)\n"
<< "\tFile type not recognised before EOF!"
<< endl;
}
if (!format.empty()) {
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "Recognised Fileformat: " << format << endl;
return format;
}
- lyxerr[Debug::GRAPHICS]
+ LYXERR(Debug::GRAPHICS)
<< "filetools(getFormatFromContents)\n"
<< "\tCouldn't find a known format!\n";
return string();
cmd_ret const c = runCommand(kpsecmd);
- lyxerr[Debug::LATEX] << "kpse status = " << c.first << '\n'
+ LYXERR(Debug::LATEX) << "kpse status = " << c.first << '\n'
<< "kpse result = `" << rtrim(c.second, "\n\r")
<< '\'' << endl;
if (c.first != -1)
void readBB_lyxerrMessage(FileName const & file, bool & zipped,
string const & message)
{
- lyxerr[Debug::GRAPHICS] << "[readBB_from_PSFile] "
+ LYXERR(Debug::GRAPHICS) << "[readBB_from_PSFile] "
<< message << std::endl;
#ifdef WITH_WARNINGS
#warning Why is this func deleting a file? (Lgb)
void ForkedCallQueue::startCaller()
{
- lyxerr[Debug::GRAPHICS] << "ForkedCallQueue: waking up" << endl;
+ LYXERR(Debug::GRAPHICS) << "ForkedCallQueue: waking up" << endl;
running_ = true ;
callNext();
}
void ForkedCallQueue::stopCaller()
{
running_ = false ;
- lyxerr[Debug::GRAPHICS] << "ForkedCallQueue: I'm going to sleep"
+ LYXERR(Debug::GRAPHICS) << "ForkedCallQueue: I'm going to sleep"
<< endl;
}
unsigned long sum(FileName const & file)
{
- lyxerr[Debug::FILES] << "lyx::sum() using mmap (lightning fast)"
+ LYXERR(Debug::FILES) << "lyx::sum() using mmap (lightning fast)"
<< endl;
int fd = open(file.toFilesystemEncoding().c_str(), O_RDONLY);
unsigned long sum(FileName const & file)
{
- lyxerr[Debug::FILES] << "lyx::sum() using istreambuf_iterator (fast)"
+ LYXERR(Debug::FILES) << "lyx::sum() using istreambuf_iterator (fast)"
<< endl;
ifstream ifs(file.toFilesystemEncoding().c_str());
unsigned long sum(FileName const & file)
{
- lyxerr[Debug::FILES]
+ LYXERR(Debug::FILES)
<< "lyx::sum() using istream_iterator (slow as a snail)"
<< endl;
if (windows_style_tex_paths_ && is_absolute_path(p)) {
string dos_path = convert_path(p, PathStyle(windows));
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "<Path correction for LaTeX> ["
<< p << "]->>["
<< dos_path << ']' << endl;
{
string const dos_path = subst(p, "/", "\\");
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "<Win32 path correction> ["
<< p << "]->>["
<< dos_path << ']' << endl;
string const drive = p.substr(0, 2);
string const cygprefix = cygdrive + "/" + drive.substr(0, 1);
string const cygpath = subst(subst(p, '\\', '/'), drive, cygprefix);
- lyxerr[Debug::LATEX]
+ LYXERR(Debug::LATEX)
<< "<Path correction for LaTeX> ["
<< p << "]->>["
<< cygpath << ']' << endl;
#else
# error No x() function.
#endif
- lyxerr[Debug::FILES] << "Temporary file `" << t
+ LYXERR(Debug::FILES) << "Temporary file `" << t
<< "' created." << endl;
return FileName(t);
} else {
- lyxerr[Debug::FILES]
+ LYXERR(Debug::FILES)
<< "LyX Error: Unable to create temporary file."
<< endl;
return FileName();
for (idx_type cell = 0, n = getNumberOfCells(); cell < n; ++cell)
if (getCellInset(cell).get() == inset) {
- lyxerr[Debug::INSETTEXT] << "LyXTabular::getCellFromInset: "
+ LYXERR(Debug::INSETTEXT) << "LyXTabular::getCellFromInset: "
<< "cell=" << cell << endl;
return cell;
}
break;
}
- lyxerr[Debug::PARSER] << "Handling paragraph token: `"
+ LYXERR(Debug::PARSER) << "Handling paragraph token: `"
<< token << '\'' << endl;
if (token == "\\begin_layout" || token == "\\end_document"
|| token == "\\end_inset" || token == "\\begin_deeper"
return;
if (lyxerr.debugging(Debug::DEBUG)) {
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< "draw selection at " << x
<< endl;
}
if (lyxerr.debugging(Debug::DEBUG)) {
- lyxerr[Debug::DEBUG] << " y1: " << y1 << " y2: " << y2
+ LYXERR(Debug::DEBUG) << " y1: " << y1 << " y2: " << y2
<< "X1:" << X1 << " x2: " << X2 << " wid: " << tm.width()
<< endl;
}
ParagraphMetrics const & pm = tm.parMetrics(pit);
int yy = cur.bv().coordCache().get(this, pit).y_ - pm.ascent();
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": x: " << x
<< " y: " << y
Row const & row = pm.rows()[r];
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": row " << r
<< " from pos: " << row.pos()
pos_type const pos = row.pos()
+ tm.getColumnNearX(pit, row, xx, bound);
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": setting cursor pit: " << pit
<< " pos: " << pos
Paragraph const & par = pars_[pit];
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": x: " << x
<< " y: " << y
for (; iit != iend; ++iit) {
InsetBase * inset = iit->inset;
#if 1
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": examining inset " << inset << endl;
if (bv.coordCache().getInsets().has(inset))
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": xo: " << inset->xo(bv) << "..."
<< inset->xo(bv) + inset->width()
<< inset->yo(bv) + inset->descent()
<< endl;
else
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": inset has no cached position" << endl;
#endif
if (inset->covers(bv, x, y)) {
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": Hit inset: " << inset << endl;
return inset;
}
}
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": No inset hit. " << endl;
return 0;
LyXLayout_ptr const & lyxlayout = params.getLyXTextClass()[layout];
if (lyxlayout->is_environment) {
// move everything in a new environment inset
- lyxerr[Debug::DEBUG] << "setting layout " << layout << endl;
+ LYXERR(Debug::DEBUG) << "setting layout " << layout << endl;
lyx::dispatch(FuncRequest(LFUN_LINE_BEGIN));
lyx::dispatch(FuncRequest(LFUN_LINE_END_SELECT));
lyx::dispatch(FuncRequest(LFUN_CUT));
BOOST_ASSERT(!paragraphs().empty());
BOOST_ASSERT(bv.coordCache().getParPos().find(this) != bv.coordCache().getParPos().end());
CoordCache::InnerParPosCache const & cc = bv.coordCache().getParPos().find(this)->second;
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": y: " << y << " cache size: " << cc.size()
<< endl;
}
for (; it != et; ++it) {
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< " examining: pit: " << it->first
<< " y: " << it->second.y_
}
}
- lyxerr[Debug::DEBUG]
+ LYXERR(Debug::DEBUG)
<< BOOST_CURRENT_FUNCTION
<< ": found best y: " << yy << " for pit: " << pit
<< endl;
bool LyXText::deleteEmptyParagraphMechanism(LCursor & cur,
LCursor & old, bool & need_anchor_change)
{
- //lyxerr[Debug::DEBUG] << "DEPM: cur:\n" << cur << "old:\n" << old << endl;
+ //LYXERR(Debug::DEBUG) << "DEPM: cur:\n" << cur << "old:\n" << old << endl;
Paragraph & oldpar = old.paragraph();
void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
{
- lyxerr[Debug::ACTION] << "LyXText::dispatch: cmd: " << cmd << endl;
+ LYXERR(Debug::ACTION) << "LyXText::dispatch: cmd: " << cmd << endl;
// FIXME: We use the update flag to indicates wether a singlePar or a
// full screen update is needed. We reset it here but shall we restore it
case LFUN_LAYOUT: {
string layout = to_ascii(cmd.argument());
- lyxerr[Debug::INFO] << "LFUN_LAYOUT: (arg) " << layout << endl;
+ LYXERR(Debug::INFO) << "LFUN_LAYOUT: (arg) " << layout << endl;
// Derive layout number from given argument (string)
// and current buffer's textclass (number)
}
case LFUN_FINISHED_LEFT:
- lyxerr[Debug::DEBUG] << "handle LFUN_FINISHED_LEFT:\n" << cur << endl;
+ LYXERR(Debug::DEBUG) << "handle LFUN_FINISHED_LEFT:\n" << cur << endl;
break;
case LFUN_FINISHED_RIGHT:
- lyxerr[Debug::DEBUG] << "handle LFUN_FINISHED_RIGHT:\n" << cur << endl;
+ LYXERR(Debug::DEBUG) << "handle LFUN_FINISHED_RIGHT:\n" << cur << endl;
++cur.pos();
break;
case LFUN_FINISHED_UP:
- lyxerr[Debug::DEBUG] << "handle LFUN_FINISHED_UP:\n" << cur << endl;
+ LYXERR(Debug::DEBUG) << "handle LFUN_FINISHED_UP:\n" << cur << endl;
cursorUp(cur);
break;
case LFUN_FINISHED_DOWN:
- lyxerr[Debug::DEBUG] << "handle LFUN_FINISHED_DOWN:\n" << cur << endl;
+ LYXERR(Debug::DEBUG) << "handle LFUN_FINISHED_DOWN:\n" << cur << endl;
cursorDown(cur);
break;
break;
default:
- lyxerr[Debug::ACTION]
+ LYXERR(Debug::ACTION)
<< BOOST_CURRENT_FUNCTION
<< ": Command " << cmd
<< " not DISPATCHED by LyXText" << endl;
case KCOMB: {
string str;
- lyxerr[Debug::KBMAP] << "KCOMB:" << endl;
+ LYXERR(Debug::KBMAP) << "KCOMB:" << endl;
if (lex.next(true)) {
str = lex.getString();
- lyxerr[Debug::KBMAP] << str << endl;
+ LYXERR(Debug::KBMAP) << str << endl;
} else
return -1;
if (lex.next(true)) {
str = lex.getString();
- lyxerr[Debug::KBMAP] << str << endl;
+ LYXERR(Debug::KBMAP) << str << endl;
} else
return -1;
docstring allowed;
if (lex.next()) {
allowed = lex.getDocString();
- lyxerr[Debug::KBMAP] << "allowed: "
+ LYXERR(Debug::KBMAP) << "allowed: "
<< to_utf8(allowed) << endl;
} else {
return -1;
break;
}
case LyXLex::LEX_FEOF:
- lyxerr[Debug::PARSER] << "End of parsing" << endl;
+ LYXERR(Debug::PARSER) << "End of parsing" << endl;
break;
default:
lex.printError("ParseKeymapFile: "
if (lyx_accent_table[i].name
&& contains(p, lyx_accent_table[i].name)) {
- lyxerr[Debug::KBMAP] << "Found it!" << endl;
+ LYXERR(Debug::KBMAP) << "Found it!" << endl;
return static_cast<tex_accent>(i);
}
}
if (t1_->isDefined())
active_ = t1_.get();
- lyxerr[Debug::KBMAP] << "Enabling primary keymap" << endl;
+ LYXERR(Debug::KBMAP) << "Enabling primary keymap" << endl;
}
{
if (t2_->isDefined())
active_ = t2_.get();
- lyxerr[Debug::KBMAP] << "Enabling secondary keymap" << endl;
+ LYXERR(Debug::KBMAP) << "Enabling secondary keymap" << endl;
}
void TransManager::disableKeymap()
{
active_ = &default_;
- lyxerr[Debug::KBMAP] << "Disabling keymap" << endl;
+ LYXERR(Debug::KBMAP) << "Disabling keymap" << endl;
}
int VCS::doVCCommand(string const & cmd, string const & path)
{
- lyxerr[Debug::LYXVC] << "doVCCommand: " << cmd << endl;
+ LYXERR(Debug::LYXVC) << "doVCCommand: " << cmd << endl;
Systemcall one;
support::Path p(path);
int const ret = one.startscript(Systemcall::Wait, cmd);
{
// Check if *,v exists.
FileName tmp(file.absFilename() + ",v");
- lyxerr[Debug::LYXVC] << "Checking if file is under rcs: "
+ LYXERR(Debug::LYXVC) << "Checking if file is under rcs: "
<< tmp << endl;
if (fs::is_readable(tmp.toFilesystemEncoding())) {
- lyxerr[Debug::LYXVC] << "Yes " << file
+ LYXERR(Debug::LYXVC) << "Yes " << file
<< " is under rcs." << endl;
return tmp;
} else {
// Check if RCS/*,v exists.
tmp = FileName(addName(addPath(onlyPath(file.absFilename()), "RCS"), file.absFilename()) + ",v");
- lyxerr[Debug::LYXVC] << "Checking if file is under rcs: "
+ LYXERR(Debug::LYXVC) << "Checking if file is under rcs: "
<< tmp << endl;
if (fs::is_readable(tmp.toFilesystemEncoding())) {
- lyxerr[Debug::LYXVC] << "Yes " << file
+ LYXERR(Debug::LYXVC) << "Yes " << file
<< " it is under rcs."<< endl;
return tmp;
}
void RCS::retrieve(FileName const & file)
{
- lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrieve.\n\t" << file << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC::RCS: retrieve.\n\t" << file << endl;
VCS::doVCCommand("co -q -r " + quoteName(file.toFilesystemEncoding()),
string());
}
void RCS::scanMaster()
{
- lyxerr[Debug::LYXVC] << "LyXVC::RCS: scanMaster." << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC::RCS: scanMaster." << endl;
ifstream ifs(master_.toFilesystemEncoding().c_str());
bool read_enough = false;
while (!read_enough && ifs >> token) {
- lyxerr[Debug::LYXVC]
+ LYXERR(Debug::LYXVC)
<< "LyXVC::scanMaster: current lex text: `"
<< token << '\'' << endl;
ifs >> tmv;
tmv = rtrim(tmv, ";");
version_ = tmv;
- lyxerr[Debug::LYXVC] << "LyXVC: version found to be "
+ LYXERR(Debug::LYXVC) << "LyXVC: version found to be "
<< tmv << endl;
} else if (contains(token, "access")
|| contains(token, "symbols")
read_enough = true;
} else {
// unexpected
- lyxerr[Debug::LYXVC]
+ LYXERR(Debug::LYXVC)
<< "LyXVC::scanMaster(): unexpected token"
<< endl;
}
void RCS::undoLast()
{
- lyxerr[Debug::LYXVC] << "LyXVC: undoLast" << endl;
+ LYXERR(Debug::LYXVC) << "LyXVC: undoLast" << endl;
doVCCommand("rcs -o" + version() + " "
+ quoteName(onlyFilename(owner_->fileName())),
owner_->filePath());
// where we have file.
FileName const dir(onlyPath(file.absFilename()) + "/CVS/Entries");
string const tmpf = '/' + onlyFilename(file.absFilename()) + '/';
- lyxerr[Debug::LYXVC] << "LyXVC: checking in `" << dir
+ LYXERR(Debug::LYXVC) << "LyXVC: checking in `" << dir
<< "' for `" << tmpf << '\'' << endl;
if (fs::is_readable(dir.toFilesystemEncoding())) {
// Ok we are at least in a CVS dir. Parse the CVS/Entries
ifstream ifs(dir.toFilesystemEncoding().c_str());
string line;
while (getline(ifs, line)) {
- lyxerr[Debug::LYXVC] << "\tEntries: " << line << endl;
+ LYXERR(Debug::LYXVC) << "\tEntries: " << line << endl;
if (contains(line, tmpf))
return dir;
}
void CVS::scanMaster()
{
- lyxerr[Debug::LYXVC] << "LyXVC::CVS: scanMaster. \n Checking: "
+ LYXERR(Debug::LYXVC) << "LyXVC::CVS: scanMaster. \n Checking: "
<< master_ << endl;
// Ok now we do the real scan...
ifstream ifs(master_.toFilesystemEncoding().c_str());
string tmpf = '/' + onlyFilename(file_.absFilename()) + '/';
- lyxerr[Debug::LYXVC] << "\tlooking for `" << tmpf << '\'' << endl;
+ LYXERR(Debug::LYXVC) << "\tlooking for `" << tmpf << '\'' << endl;
string line;
static regex const reg("/(.*)/(.*)/(.*)/(.*)/(.*)");
while (getline(ifs, line)) {
- lyxerr[Debug::LYXVC] << "\t line: " << line << endl;
+ LYXERR(Debug::LYXVC) << "\t line: " << line << endl;
if (contains(line, tmpf)) {
// Ok extract the fields.
smatch sm;
// FIXME: must double check file is stattable/existing
time_t mod = fs::last_write_time(file_.toFilesystemEncoding());
string mod_date = rtrim(asctime(gmtime(&mod)), "\n");
- lyxerr[Debug::LYXVC]
+ LYXERR(Debug::LYXVC)
<< "Date in Entries: `" << file_date
<< "'\nModification date of file: `"
<< mod_date << '\'' << endl;