mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 22:06:15 +00:00
assimilate BOOST_CURRENT_FUNCTION
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21867 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
cc245f3d6d
commit
2506e0d643
@ -75,8 +75,6 @@
|
||||
#include "support/Package.h"
|
||||
#include "support/types.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
#include <cerrno>
|
||||
#include <fstream>
|
||||
#include <functional>
|
||||
@ -449,8 +447,8 @@ void BufferView::updateScrollbar()
|
||||
d->offset_ref_ = 0;
|
||||
}
|
||||
|
||||
LYXERR(Debug::GUI, BOOST_CURRENT_FUNCTION
|
||||
<< " Updating scrollbar: height: " << t.paragraphs().size()
|
||||
LYXERR(Debug::GUI, " Updating scrollbar: height: "
|
||||
<< t.paragraphs().size()
|
||||
<< " curr par: " << d->cursor_.bottom().pit()
|
||||
<< " default height " << defaultRowHeight());
|
||||
|
||||
@ -501,7 +499,7 @@ ScrollbarParameters const & BufferView::scrollbarParameters() const
|
||||
|
||||
void BufferView::scrollDocView(int value)
|
||||
{
|
||||
LYXERR(Debug::GUI, BOOST_CURRENT_FUNCTION << "[ value = " << value << "]");
|
||||
LYXERR(Debug::GUI, "[ value = " << value << "]");
|
||||
|
||||
Text & t = buffer_.text();
|
||||
TextMetrics & tm = d->text_metrics_[&t];
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/crc.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
@ -258,7 +257,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
|
||||
if (!lyxrc.use_converter_cache || orig_from.empty() ||
|
||||
converted_file.empty())
|
||||
return;
|
||||
LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
LYXERR(Debug::FILES, ' ' << orig_from
|
||||
<< ' ' << to_format << ' ' << converted_file);
|
||||
|
||||
// FIXME: Should not hardcode this (see bug 3819 for details)
|
||||
@ -318,8 +317,7 @@ void ConverterCache::remove(FileName const & orig_from,
|
||||
{
|
||||
if (!lyxrc.use_converter_cache || orig_from.empty())
|
||||
return;
|
||||
LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format);
|
||||
LYXERR(Debug::FILES, orig_from << ' ' << to_format);
|
||||
|
||||
CacheType::iterator const it1 = pimpl_->cache.find(orig_from);
|
||||
if (it1 == pimpl_->cache.end())
|
||||
@ -379,8 +377,7 @@ bool ConverterCache::inCache(FileName const & orig_from,
|
||||
{
|
||||
if (!lyxrc.use_converter_cache || orig_from.empty())
|
||||
return false;
|
||||
LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format);
|
||||
LYXERR(Debug::FILES, orig_from << ' ' << to_format);
|
||||
|
||||
CacheItem * const item = pimpl_->find(orig_from, to_format);
|
||||
if (!item) {
|
||||
@ -405,8 +402,7 @@ bool ConverterCache::inCache(FileName const & orig_from,
|
||||
FileName const & ConverterCache::cacheName(FileName const & orig_from,
|
||||
string const & to_format) const
|
||||
{
|
||||
LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format);
|
||||
LYXERR(Debug::FILES, orig_from << ' ' << to_format);
|
||||
|
||||
CacheItem * const item = pimpl_->find(orig_from, to_format);
|
||||
BOOST_ASSERT(item);
|
||||
@ -419,8 +415,7 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
|
||||
{
|
||||
if (!lyxrc.use_converter_cache || orig_from.empty() || dest.empty())
|
||||
return false;
|
||||
LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format << ' ' << dest);
|
||||
LYXERR(Debug::FILES, orig_from << ' ' << to_format << ' ' << dest);
|
||||
|
||||
// FIXME: Should not hardcode this (see bug 3819 for details)
|
||||
if (to_format == "pstex") {
|
||||
|
@ -48,7 +48,6 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <limits>
|
||||
@ -293,8 +292,7 @@ void Cursor::setCursor(DocIterator const & cur)
|
||||
|
||||
void Cursor::dispatch(FuncRequest const & cmd0)
|
||||
{
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< " cmd: " << cmd0 << '\n' << *this);
|
||||
LYXERR(Debug::DEBUG, "cmd: " << cmd0 << '\n' << *this);
|
||||
if (empty())
|
||||
return;
|
||||
|
||||
@ -1301,7 +1299,7 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
|
||||
|
||||
void Cursor::handleFont(string const & font)
|
||||
{
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << ": " << font);
|
||||
LYXERR(Debug::DEBUG, font);
|
||||
docstring safe;
|
||||
if (selection()) {
|
||||
macroModeClose();
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include "frontends/Clipboard.h"
|
||||
#include "frontends/Selection.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/next_prior.hpp>
|
||||
|
||||
@ -658,8 +657,9 @@ void copySelection(Cursor & cur, docstring const & plaintext)
|
||||
par.insert(0, plaintext, Font(), Change(Change::UNCHANGED));
|
||||
pars.push_back(par);
|
||||
theCuts.push(make_pair(pars, bp.getTextClassPtr()));
|
||||
} else
|
||||
} else {
|
||||
copySelectionToStack(cur, theCuts);
|
||||
}
|
||||
|
||||
// stuff the selection onto the X clipboard, from an explicit copy request
|
||||
putClipboard(theCuts[0].first, theCuts[0].second, plaintext);
|
||||
@ -674,8 +674,7 @@ void saveSelection(Cursor & cur)
|
||||
if (cur.selection()
|
||||
&& cur.selBegin() == cur.bv().cursor().selBegin()
|
||||
&& cur.selEnd() == cur.bv().cursor().selEnd()) {
|
||||
LYXERR(Debug::ACTION, BOOST_CURRENT_FUNCTION << ": `"
|
||||
<< to_utf8(cur.selectionAsString(true)) << "'.");
|
||||
LYXERR(Debug::ACTION, "'" << cur.selectionAsString(true) << "'");
|
||||
copySelectionToStack(cur, selectionBuffer);
|
||||
}
|
||||
}
|
||||
|
@ -93,8 +93,6 @@
|
||||
#include "support/convert.h"
|
||||
#include "support/os.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
using std::endl;
|
||||
@ -412,8 +410,7 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
||||
cancel_meta_seq.reset();
|
||||
|
||||
FuncRequest func = cancel_meta_seq.addkey(keysym, state);
|
||||
LYXERR(Debug::KEY, BOOST_CURRENT_FUNCTION
|
||||
<< " action first set to [" << func.action << ']');
|
||||
LYXERR(Debug::KEY, "action first set to [" << func.action << ']');
|
||||
|
||||
// When not cancel or meta-fake, do the normal lookup.
|
||||
// Note how the meta_fake Mod1 bit is OR-ed in and reset afterwards.
|
||||
@ -421,8 +418,7 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
||||
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
|
||||
<< "action now set to [" << func.action << ']');
|
||||
LYXERR(Debug::KEY, "action now set to [" << func.action << ']');
|
||||
}
|
||||
|
||||
// Dont remove this unless you know what you are doing.
|
||||
@ -432,9 +428,8 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
|
||||
if (func.action == LFUN_NOACTION)
|
||||
func = FuncRequest(LFUN_COMMAND_PREFIX);
|
||||
|
||||
LYXERR(Debug::KEY, BOOST_CURRENT_FUNCTION
|
||||
<< " Key [action=" << func.action << "]["
|
||||
<< to_utf8(keyseq.print(KeySequence::Portable)) << ']');
|
||||
LYXERR(Debug::KEY, " Key [action=" << func.action << "]["
|
||||
<< keyseq.print(KeySequence::Portable) << ']');
|
||||
|
||||
// already here we know if it any point in going further
|
||||
// why not return already here if action == -1 and
|
||||
|
37
src/Text.cpp
37
src/Text.cpp
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* \file src/text.cpp
|
||||
* \file src/Text.cpp
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -29,14 +29,12 @@
|
||||
#include "Cursor.h"
|
||||
#include "ParIterator.h"
|
||||
#include "CutAndPaste.h"
|
||||
#include "support/debug.h"
|
||||
#include "DispatchResult.h"
|
||||
#include "Encoding.h"
|
||||
#include "ErrorList.h"
|
||||
#include "FuncRequest.h"
|
||||
#include "factory.h"
|
||||
#include "FontIterator.h"
|
||||
#include "support/gettext.h"
|
||||
#include "Language.h"
|
||||
#include "Length.h"
|
||||
#include "Lexer.h"
|
||||
@ -64,22 +62,18 @@
|
||||
#include "insets/InsetSpecialChar.h"
|
||||
#include "insets/InsetTabular.h"
|
||||
|
||||
#include "support/convert.h"
|
||||
#include "support/debug.h"
|
||||
#include "support/docstream.h"
|
||||
#include "support/gettext.h"
|
||||
#include "support/lstrings.h"
|
||||
#include "support/textutils.h"
|
||||
#include "support/convert.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/next_prior.hpp>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
using std::auto_ptr;
|
||||
using std::advance;
|
||||
using std::distance;
|
||||
using std::max;
|
||||
using std::min;
|
||||
using std::endl;
|
||||
using std::string;
|
||||
|
||||
namespace lyx {
|
||||
@ -137,15 +131,11 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
|
||||
par.params().read(lex);
|
||||
|
||||
} else if (token == "\\end_layout") {
|
||||
lyxerr << BOOST_CURRENT_FUNCTION
|
||||
<< ": Solitary \\end_layout in line "
|
||||
<< lex.getLineNo() << "\n"
|
||||
<< "Missing \\begin_layout?.\n";
|
||||
LYXERR0("Solitary \\end_layout in line " << lex.getLineNo() << "\n"
|
||||
<< "Missing \\begin_layout ?");
|
||||
} else if (token == "\\end_inset") {
|
||||
lyxerr << BOOST_CURRENT_FUNCTION
|
||||
<< ": Solitary \\end_inset in line "
|
||||
<< lex.getLineNo() << "\n"
|
||||
<< "Missing \\begin_inset?.\n";
|
||||
LYXERR0("Solitary \\end_inset in line " << lex.getLineNo() << "\n"
|
||||
<< "Missing \\begin_inset ?");
|
||||
} else if (token == "\\begin_inset") {
|
||||
Inset * inset = readInset(lex, buf);
|
||||
if (inset)
|
||||
@ -1114,8 +1104,7 @@ void Text::getWord(CursorSlice & from, CursorSlice & to,
|
||||
--from.pos();
|
||||
break;
|
||||
case NEXT_WORD:
|
||||
lyxerr << "Text::getWord: NEXT_WORD not implemented yet"
|
||||
<< endl;
|
||||
LYXERR0("Text::getWord: NEXT_WORD not implemented yet");
|
||||
break;
|
||||
case PARTIAL_WORD:
|
||||
// no need to move the 'from' cursor
|
||||
@ -1180,14 +1169,12 @@ bool Text::read(Buffer const & buf, Lexer & lex, ErrorList & errorList)
|
||||
} else if (token == "\\begin_deeper") {
|
||||
++depth;
|
||||
} else if (token == "\\end_deeper") {
|
||||
if (!depth) {
|
||||
if (!depth)
|
||||
lex.printError("\\end_deeper: " "depth is already null");
|
||||
} else {
|
||||
else
|
||||
--depth;
|
||||
}
|
||||
} else {
|
||||
lyxerr << "Handling unknown body token: `"
|
||||
<< token << '\'' << endl;
|
||||
LYXERR0("Handling unknown body token: `" << token << '\'');
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -31,11 +31,9 @@
|
||||
#include "Changes.h"
|
||||
#include "Cursor.h"
|
||||
#include "CutAndPaste.h"
|
||||
#include "support/debug.h"
|
||||
#include "DispatchResult.h"
|
||||
#include "ErrorList.h"
|
||||
#include "FuncRequest.h"
|
||||
#include "support/gettext.h"
|
||||
#include "Language.h"
|
||||
#include "Layout.h"
|
||||
#include "Lexer.h"
|
||||
@ -57,9 +55,10 @@
|
||||
|
||||
#include "mathed/InsetMathHull.h"
|
||||
|
||||
#include "support/debug.h"
|
||||
#include "support/gettext.h"
|
||||
#include "support/textutils.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/next_prior.hpp>
|
||||
|
||||
#include <sstream>
|
||||
|
@ -69,7 +69,6 @@
|
||||
#include "mathed/InsetMathHull.h"
|
||||
#include "mathed/MathMacroTemplate.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/next_prior.hpp>
|
||||
|
||||
#include <clocale>
|
||||
@ -507,8 +506,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
|
||||
case LFUN_CHAR_FORWARD:
|
||||
case LFUN_CHAR_FORWARD_SELECT:
|
||||
//lyxerr << BOOST_CURRENT_FUNCTION
|
||||
// << " LFUN_CHAR_FORWARD[SEL]:\n" << cur << endl;
|
||||
//LYXERR0(" LFUN_CHAR_FORWARD[SEL]:\n" << cur);
|
||||
needsUpdate |= cur.selHandle(cmd.action == LFUN_CHAR_FORWARD_SELECT);
|
||||
needsUpdate |= cursorForward(cur);
|
||||
|
||||
@ -1739,8 +1737,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
break;
|
||||
|
||||
default:
|
||||
LYXERR(Debug::ACTION, BOOST_CURRENT_FUNCTION
|
||||
<< ": Command " << cmd << " not DISPATCHED by Text");
|
||||
LYXERR(Debug::ACTION, "Command " << cmd << " not DISPATCHED by Text");
|
||||
cur.undispatched();
|
||||
break;
|
||||
}
|
||||
|
@ -49,8 +49,6 @@
|
||||
#include "frontends/FontMetrics.h"
|
||||
#include "frontends/Painter.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
using std::make_pair;
|
||||
using std::max;
|
||||
using std::min;
|
||||
@ -1221,8 +1219,7 @@ void TextMetrics::newParMetricsUp()
|
||||
pit_type TextMetrics::getPitNearY(int y)
|
||||
{
|
||||
BOOST_ASSERT(!text_->paragraphs().empty());
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": y: " << y << " cache size: " << par_metrics_.size());
|
||||
LYXERR(Debug::DEBUG, "y: " << y << " cache size: " << par_metrics_.size());
|
||||
|
||||
// look for highest numbered paragraph with y coordinate less than given y
|
||||
pit_type pit = -1;
|
||||
@ -1262,8 +1259,7 @@ pit_type TextMetrics::getPitNearY(int y)
|
||||
}
|
||||
|
||||
for (; it != et; ++it) {
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< " examining: pit: " << it->first
|
||||
LYXERR(Debug::DEBUG, "examining: pit: " << it->first
|
||||
<< " y: " << it->second.position());
|
||||
|
||||
ParagraphMetrics const & pm = par_metrics_[it->first];
|
||||
@ -1274,8 +1270,7 @@ pit_type TextMetrics::getPitNearY(int y)
|
||||
}
|
||||
}
|
||||
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": found best y: " << yy << " for pit: " << pit);
|
||||
LYXERR(Debug::DEBUG, "found best y: " << yy << " for pit: " << pit);
|
||||
|
||||
return pit;
|
||||
}
|
||||
@ -1364,8 +1359,8 @@ void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const
|
||||
ParagraphMetrics const & pm = par_metrics_[pit];
|
||||
|
||||
int yy = pm.position() - pm.ascent();
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": x: " << x << " y: " << y << " pit: " << pit << " yy: " << yy);
|
||||
LYXERR(Debug::DEBUG, "x: " << x << " y: " << y <<
|
||||
" pit: " << pit << " yy: " << yy);
|
||||
|
||||
int r = 0;
|
||||
BOOST_ASSERT(pm.rows().size());
|
||||
@ -1378,15 +1373,13 @@ void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const
|
||||
|
||||
Row const & row = pm.rows()[r];
|
||||
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": row " << r << " from pos: " << row.pos());
|
||||
LYXERR(Debug::DEBUG, "row " << r << " from pos: " << row.pos());
|
||||
|
||||
bool bound = false;
|
||||
int xx = x;
|
||||
pos_type const pos = row.pos() + getColumnNearX(pit, row, xx, bound);
|
||||
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": setting cursor pit: " << pit << " pos: " << pos);
|
||||
LYXERR(Debug::DEBUG, "setting cursor pit: " << pit << " pos: " << pos);
|
||||
|
||||
text_->setCursor(cur, pit, pos, true, bound);
|
||||
// remember new position.
|
||||
@ -1403,41 +1396,36 @@ Inset * TextMetrics::checkInsetHit(int x, int y)
|
||||
Paragraph const & par = text_->paragraphs()[pit];
|
||||
ParagraphMetrics const & pm = par_metrics_[pit];
|
||||
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": x: " << x << " y: " << y << " pit: " << pit);
|
||||
LYXERR(Debug::DEBUG, "x: " << x << " y: " << y << " pit: " << pit);
|
||||
|
||||
InsetList::const_iterator iit = par.insetList().begin();
|
||||
InsetList::const_iterator iend = par.insetList().end();
|
||||
for (; iit != iend; ++iit) {
|
||||
Inset * inset = iit->inset;
|
||||
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": examining inset " << inset);
|
||||
LYXERR(Debug::DEBUG, "examining inset " << inset);
|
||||
|
||||
if (!bv_->coordCache().getInsets().has(inset)) {
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": inset has no cached position");
|
||||
LYXERR(Debug::DEBUG, "inset has no cached position");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Dimension const & dim = pm.insetDimension(inset);
|
||||
Point p = bv_->coordCache().getInsets().xy(inset);
|
||||
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": xo: " << p.x_ << "..." << p.x_ + dim.wid
|
||||
LYXERR(Debug::DEBUG, "xo: " << p.x_ << "..." << p.x_ + dim.wid
|
||||
<< " yo: " << p.y_ - dim.asc << "..." << p.y_ + dim.des);
|
||||
|
||||
if (x >= p.x_
|
||||
&& x <= p.x_ + dim.wid
|
||||
&& y >= p.y_ - dim.asc
|
||||
&& y <= p.y_ + dim.des) {
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": Hit inset: " << inset);
|
||||
LYXERR(Debug::DEBUG, "Hit inset: " << inset);
|
||||
return inset;
|
||||
}
|
||||
}
|
||||
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << ": No inset hit. ");
|
||||
LYXERR(Debug::DEBUG, "No inset hit. ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,6 @@
|
||||
#include "support/ExceptionMessage.h"
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
|
@ -19,11 +19,9 @@
|
||||
#include "BufferParams.h"
|
||||
#include "BufferView.h"
|
||||
#include "Cursor.h"
|
||||
#include "support/debug.h"
|
||||
//#include "DialogView.h"
|
||||
//#include "DockView.h"
|
||||
#include "FuncRequest.h"
|
||||
#include "support/gettext.h"
|
||||
#include "GuiView.h"
|
||||
#include "Lexer.h"
|
||||
#include "Paragraph.h"
|
||||
@ -31,13 +29,14 @@
|
||||
#include "qt_helpers.h"
|
||||
#include "Spacing.h"
|
||||
|
||||
#include "support/debug.h"
|
||||
#include "support/gettext.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QCloseEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
using std::istringstream;
|
||||
|
@ -55,7 +55,6 @@
|
||||
#include <QTimer>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
#include <QX11Info>
|
||||
@ -238,9 +237,8 @@ GuiWorkArea::GuiWorkArea(Buffer & buffer, GuiView & lv)
|
||||
// PageStep only depends on the viewport height.
|
||||
verticalScrollBar()->setPageStep(viewport()->height());
|
||||
|
||||
LYXERR(Debug::GUI, BOOST_CURRENT_FUNCTION
|
||||
<< "\n viewport width\t" << viewport()->width()
|
||||
<< "\n viewport height\t" << viewport()->height());
|
||||
LYXERR(Debug::GUI, "viewport width: " << viewport()->width()
|
||||
<< " viewport height: " << viewport()->height());
|
||||
|
||||
// Enables input methods for asian languages.
|
||||
// Must be set when creating custom text editing widgets.
|
||||
@ -648,18 +646,15 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * ev)
|
||||
#ifdef Q_WS_X11
|
||||
if (XEventsQueued(QX11Info::display(), 0) > 1 && ev->isAutoRepeat()
|
||||
&& (Qt::Key_PageDown || Qt::Key_PageUp)) {
|
||||
LYXERR(Debug::KEY, BOOST_CURRENT_FUNCTION
|
||||
<< "\nsystem is busy: scroll key event ignored");
|
||||
LYXERR(Debug::KEY, "system is busy: scroll key event ignored");
|
||||
ev->ignore();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
LYXERR(Debug::KEY, BOOST_CURRENT_FUNCTION
|
||||
<< " count=" << ev->count()
|
||||
<< " text=" << fromqstr(ev->text())
|
||||
<< " isAutoRepeat=" << ev->isAutoRepeat()
|
||||
<< " key=" << ev->key());
|
||||
LYXERR(Debug::KEY, " count: " << ev->count()
|
||||
<< " text: " << fromqstr(ev->text())
|
||||
<< " isAutoRepeat: " << ev->isAutoRepeat() << " key: " << ev->key());
|
||||
|
||||
KeySymbol sym;
|
||||
setKeySymbol(&sym, ev);
|
||||
@ -701,12 +696,8 @@ void GuiWorkArea::update(int x, int y, int w, int h)
|
||||
void GuiWorkArea::paintEvent(QPaintEvent * ev)
|
||||
{
|
||||
QRect const rc = ev->rect();
|
||||
/*
|
||||
LYXERR(Debug::PAINTING) << "paintEvent begin: x: " << rc.x()
|
||||
<< " y: " << rc.y()
|
||||
<< " w: " << rc.width()
|
||||
<< " h: " << rc.height() << endl;
|
||||
*/
|
||||
// LYXERR(Debug::PAINTING, "paintEvent begin: x: " << rc.x()
|
||||
// << " y: " << rc.y() << " w: " << rc.width() << " h: " << rc.height());
|
||||
|
||||
if (need_resize_) {
|
||||
verticalScrollBar()->setPageStep(viewport()->height());
|
||||
@ -765,14 +756,13 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
|
||||
|
||||
if (!commit_string.isEmpty()) {
|
||||
|
||||
LYXERR(Debug::KEY, BOOST_CURRENT_FUNCTION
|
||||
<< " preeditString =" << fromqstr(e->preeditString())
|
||||
<< " commitString =" << fromqstr(e->commitString()));
|
||||
LYXERR(Debug::KEY, "preeditString: " << fromqstr(e->preeditString())
|
||||
<< " commitString: " << fromqstr(e->commitString()));
|
||||
|
||||
int key = 0;
|
||||
|
||||
// FIXME Iwami 04/01/07: we should take care also of UTF16 surrogates here.
|
||||
for (int i = 0; i < commit_string.size(); ++i) {
|
||||
for (int i = 0; i != commit_string.size(); ++i) {
|
||||
QKeyEvent ev(QEvent::KeyPress, key, Qt::NoModifier, commit_string[i]);
|
||||
keyPressEvent(&ev);
|
||||
}
|
||||
@ -820,7 +810,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
|
||||
// cursor_pos : cursor position in preedit string.
|
||||
size_t cursor_pos = 0;
|
||||
bool cursor_is_visible = false;
|
||||
for (int i = 0; i < att.size(); ++i) {
|
||||
for (int i = 0; i != att.size(); ++i) {
|
||||
if (att.at(i).type == QInputMethodEvent::Cursor) {
|
||||
cursor_pos = att.at(i).start;
|
||||
cursor_is_visible = att.at(i).length != 0;
|
||||
@ -837,7 +827,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
|
||||
// rLength : selected string length in IM.
|
||||
size_t rLength = 0;
|
||||
if (cursor_pos < preedit_length) {
|
||||
for (int i = 0; i < att.size(); ++i) {
|
||||
for (int i = 0; i != att.size(); ++i) {
|
||||
if (att.at(i).type == QInputMethodEvent::TextFormat) {
|
||||
if (att.at(i).start <= int(cursor_pos)
|
||||
&& int(cursor_pos) < att.at(i).start + att.at(i).length) {
|
||||
|
@ -21,12 +21,10 @@
|
||||
#include "BufferView.h"
|
||||
#include "CoordCache.h"
|
||||
#include "Cursor.h"
|
||||
#include "support/debug.h"
|
||||
#include "Dimension.h"
|
||||
#include "DispatchResult.h"
|
||||
#include "FuncRequest.h"
|
||||
#include "FuncStatus.h"
|
||||
#include "support/gettext.h"
|
||||
#include "Text.h"
|
||||
#include "TextClass.h"
|
||||
#include "MetricsInfo.h"
|
||||
@ -36,8 +34,8 @@
|
||||
#include "frontends/Application.h"
|
||||
|
||||
#include "support/convert.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include "support/debug.h"
|
||||
#include "support/gettext.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
@ -204,13 +202,13 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd,
|
||||
|
||||
void Inset::edit(Cursor &, bool)
|
||||
{
|
||||
LYXERR(Debug::INSETS, BOOST_CURRENT_FUNCTION << ": edit left/right");
|
||||
LYXERR(Debug::INSETS, "edit left/right");
|
||||
}
|
||||
|
||||
|
||||
Inset * Inset::editXY(Cursor &, int x, int y)
|
||||
{
|
||||
LYXERR(Debug::INSETS, BOOST_CURRENT_FUNCTION << ": x=" << x << " y= " << y);
|
||||
LYXERR(Debug::INSETS, "x: " << x << " y: " << y);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -218,9 +216,9 @@ Inset * Inset::editXY(Cursor &, int x, int y)
|
||||
Inset::idx_type Inset::index(row_type row, col_type col) const
|
||||
{
|
||||
if (row != 0)
|
||||
LYXERR0(BOOST_CURRENT_FUNCTION << ": illegal row: " << row);
|
||||
LYXERR0("illegal row: " << row);
|
||||
if (col != 0)
|
||||
LYXERR0(BOOST_CURRENT_FUNCTION << ": illegal col: " << col);
|
||||
LYXERR0("illegal col: " << col);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -21,19 +21,17 @@
|
||||
#include "support/lstrings.h"
|
||||
#include "support/textutils.h"
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
using std::endl;
|
||||
|
||||
|
||||
namespace lyx {
|
||||
|
||||
|
||||
|
||||
MathData & InsetMath::cell(idx_type)
|
||||
{
|
||||
static MathData dummyCell;
|
||||
lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
|
||||
LYXERR0("I don't have any cell");
|
||||
return dummyCell;
|
||||
}
|
||||
|
||||
@ -41,7 +39,7 @@ MathData & InsetMath::cell(idx_type)
|
||||
MathData const & InsetMath::cell(idx_type) const
|
||||
{
|
||||
static MathData dummyCell;
|
||||
lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl;
|
||||
LYXERR0("I don't have any cell");
|
||||
return dummyCell;
|
||||
}
|
||||
|
||||
@ -59,13 +57,13 @@ void InsetMath::dump() const
|
||||
|
||||
void InsetMath::metricsT(TextMetricsInfo const &, Dimension &) const
|
||||
{
|
||||
lyxerr << "InsetMath::metricsT(Text) called directly!" << endl;
|
||||
LYXERR0("InsetMath::metricsT(Text) called directly!");
|
||||
}
|
||||
|
||||
|
||||
void InsetMath::drawT(TextPainter &, int, int) const
|
||||
{
|
||||
lyxerr << "InsetMath::drawT(Text) called directly!" << endl;
|
||||
LYXERR0("InsetMath::drawT(Text) called directly!");
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "support/unicode.h"
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
#include <cerrno>
|
||||
|
||||
@ -77,10 +76,9 @@ Messages::Messages(string const & l)
|
||||
: lang_(l), warned_(false)
|
||||
{
|
||||
// strip off any encoding suffix, i.e., assume 8-bit po files
|
||||
string::size_type i = lang_.find(".");
|
||||
size_t i = lang_.find(".");
|
||||
lang_ = lang_.substr(0, i);
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
|
||||
<< ": language(" << lang_ << ")");
|
||||
LYXERR(Debug::DEBUG, "language(" << lang_ << ")");
|
||||
}
|
||||
|
||||
|
||||
@ -91,16 +89,14 @@ void Messages::init()
|
||||
char const * c = bindtextdomain(PACKAGE, locale_dir.c_str());
|
||||
int e = errno;
|
||||
if (e) {
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
|
||||
<< "Error code: " << errno << '\n'
|
||||
LYXERR(Debug::DEBUG, "Error code: " << errno << '\n'
|
||||
<< "Directory : " << package().locale_dir().absFilename() << '\n'
|
||||
<< "Rtn value : " << c);
|
||||
}
|
||||
|
||||
if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
|
||||
LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
|
||||
<< "Error code: " << errno << '\n'
|
||||
<< "Codeset : " << ucs4_codeset << '\n');
|
||||
LYXERR(Debug::DEBUG, "Error code: " << errno << '\n'
|
||||
<< "Codeset : " << ucs4_codeset);
|
||||
}
|
||||
|
||||
textdomain(PACKAGE);
|
||||
|
@ -167,11 +167,25 @@ extern LyXErr lyxerr;
|
||||
|
||||
} // namespace lyx
|
||||
|
||||
// stolen from boost/current_function.hpp
|
||||
#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600))
|
||||
# define CURRENT_FUNCTION __PRETTY_FUNCTION__
|
||||
#elif defined(__FUNCSIG__)
|
||||
# define CURRENT_FUNCTION __FUNCSIG__
|
||||
#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
|
||||
# define CURRENT_FUNCTION __FUNCTION__
|
||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
|
||||
# define CURRENT_FUNCTION __FUNC__
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
|
||||
# define CURRENT_FUNCTION __func__
|
||||
#else
|
||||
# define CURRENT_FUNCTION "(unknown)"
|
||||
#endif
|
||||
|
||||
#define LYXERR(type, msg) \
|
||||
do { \
|
||||
if (!lyx::lyxerr.debugging(type)) {} \
|
||||
else { lyx::lyxerr << msg; lyx::lyxerr.endl(); } \
|
||||
else { lyx::lyxerr << CURRENT_FUNCTION <<": "<<msg; lyx::lyxerr.endl(); } \
|
||||
} while (0)
|
||||
|
||||
#define LYXERR0(msg) LYXERR(lyx::Debug::ANY, msg)
|
||||
|
Loading…
Reference in New Issue
Block a user