The branch, 2.0.x, has been updated.

- Log -----------------------------------------------------------------

commit fb80ce20ca73fafcde388db9f1c199561029192b
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu Jun 7 17:19:04 2012 +0200

    Handle sending a FuncRequest object to lyxerr
    
      * Implement the corresponding operator<<
    
      * Use it in a couple new places

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index dda765e..8130db3 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1204,14 +1204,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_;
diff --git a/src/FuncRequest.cpp b/src/FuncRequest.cpp
index 1d98ca1..c912b3a 100644
--- a/src/FuncRequest.cpp
+++ b/src/FuncRequest.cpp
@@ -13,6 +13,7 @@
 #include "FuncRequest.h"
 #include "LyXAction.h"
 
+#include "support/debug.h"
 #include "support/lstrings.h"
 
 #include <climits>
@@ -132,12 +133,19 @@ bool operator==(FuncRequest const & lhs, FuncRequest 
const & rhs)
 ostream & operator<<(ostream & os, FuncRequest const & cmd)
 {
        return os
-               << " action: " << cmd.action() 
-               << " [" << lyxaction.getActionName(cmd.action()) << "] " 
+               << " action: " << cmd.action()
+               << " [" << lyxaction.getActionName(cmd.action()) << "] "
                << " arg: '" << to_utf8(cmd.argument()) << "'"
                << " x: " << cmd.x()
                << " y: " << cmd.y();
 }
 
 
+LyXErr & operator<<(LyXErr &l, FuncRequest const &fr)
+{
+       ostringstream oss;
+       oss << fr;
+       return l << oss.str();
+}
+
 } // namespace lyx
diff --git a/src/FuncRequest.h b/src/FuncRequest.h
index 175eb59..613c443 100644
--- a/src/FuncRequest.h
+++ b/src/FuncRequest.h
@@ -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
 
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 77131a0..31fb6b5 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -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
diff --git a/status.20x b/status.20x
index 0ccd50e..2d024fa 100644
--- a/status.20x
+++ b/status.20x
@@ -291,6 +291,9 @@ What's new
 
 - Fixed compilation with clang.
 
+- In debugging messages related to LyX actions, make sure that the
+  action and its arguments are correctly reported. 
+
 - Included the qt gif plugin in the Windows installer. This
   enables the busy icon in the status bar.
 

-----------------------------------------------------------------------

Summary of changes:
 src/BufferView.cpp       |    9 +--------
 src/FuncRequest.cpp      |   12 ++++++++++--
 src/FuncRequest.h        |    4 ++++
 src/insets/InsetText.cpp |    3 +--
 status.20x               |    3 +++
 5 files changed, 19 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to