Handle sending a FuncRequest object to lyxerr

* Implement the corresponding operator<<

  * Use it in a couple new places
This commit is contained in:
Jean-Marc Lasgouttes 2012-06-07 17:19:04 +02:00
parent 47f70bd913
commit 0ef36860c3
4 changed files with 16 additions and 12 deletions

View File

@ -1218,14 +1218,7 @@ void BufferView::editInset(string const & name, Inset * inset)
void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
{
//lyxerr << [ cmd = " << cmd << "]" << endl;
// Make sure that the cached BufferView is correct.
LYXERR(Debug::ACTION, " action[" << cmd.action() << ']'
<< " arg[" << to_utf8(cmd.argument()) << ']'
<< " x[" << cmd.x() << ']'
<< " y[" << cmd.y() << ']'
<< " button[" << cmd.button() << ']');
LYXERR(Debug::ACTION, "BufferView::dispatch: cmd: " << cmd);
string const argument = to_utf8(cmd.argument());
Cursor & cur = d->cursor_;

View File

@ -13,6 +13,7 @@
#include "FuncRequest.h"
#include "LyXAction.h"
#include "support/debug.h"
#include "support/lstrings.h"
#include <climits>
@ -140,4 +141,11 @@ ostream & operator<<(ostream & os, FuncRequest const & cmd)
}
LyXErr & operator<<(LyXErr &l, FuncRequest const &fr)
{
ostringstream oss;
oss << fr;
return l << oss.str();
}
} // namespace lyx

View File

@ -21,6 +21,8 @@
namespace lyx {
class LyXErr;
/**
* This class encapsulates a LyX action and its argument
* in order to pass it around easily.
@ -108,6 +110,8 @@ bool operator==(FuncRequest const & lhs, FuncRequest const & rhs);
std::ostream & operator<<(std::ostream &, FuncRequest const &);
LyXErr & operator<<(LyXErr &, FuncRequest const &);
} // namespace lyx

View File

@ -261,8 +261,7 @@ Inset * InsetText::editXY(Cursor & cur, int x, int y)
void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
{
LYXERR(Debug::ACTION, "InsetText::doDispatch()"
<< " [ cmd.action() = " << cmd.action() << ']');
LYXERR(Debug::ACTION, "InsetText::doDispatch(): cmd: " << cmd);
if (getLayout().isPassThru()) {
// Force any new text to latex_language FIXME: This