]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_scriptinset.C
more IU
[lyx.git] / src / mathed / math_scriptinset.C
index 7350dcb9192ee83bc5dd5dec8ec015e01ab89cd4..1118070fe76bf63b34a64b20214b594673d123a0 100644 (file)
 #include <config.h>
 
 #include "math_scriptinset.h"
+#include "math_data.h"
+#include "math_mathmlstream.h"
 #include "math_support.h"
 #include "math_symbolinset.h"
-#include "math_mathmlstream.h"
-#include "funcrequest.h"
-#include "support/LAssert.h"
+#include "dispatchresult.h"
 #include "debug.h"
+#include "funcrequest.h"
+
+#include <boost/assert.hpp>
 
-using namespace lyx::support;
 
+using std::string;
 using std::max;
 using std::auto_ptr;
 using std::endl;
@@ -158,14 +161,14 @@ int MathScriptInset::dy1() const
 
 int MathScriptInset::dx0() const
 {
-       Assert(hasDown());
+       BOOST_ASSERT(hasDown());
        return hasLimits() ? (dim_.wid - down().width()) / 2 : nwid();
 }
 
 
 int MathScriptInset::dx1() const
 {
-       Assert(hasUp());
+       BOOST_ASSERT(hasUp());
        return hasLimits() ? (dim_.wid - up().width()) / 2 : nwid();
 }
 
@@ -509,8 +512,9 @@ void MathScriptInset::notifyCursorLeaves(idx_type idx)
 }
 
 
-dispatch_result MathScriptInset::dispatch
-       (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+MathScriptInset::priv_dispatch(FuncRequest const & cmd,
+                         idx_type & idx, pos_type & pos)
 {
        if (cmd.action == LFUN_MATH_LIMITS) {
                if (!cmd.argument.empty()) {
@@ -521,11 +525,11 @@ dispatch_result MathScriptInset::dispatch
                        else
                                limits_ = 0;
                } else if (limits_ == 0)
-                       limits_ =  (hasLimits()) ? -1 : 1;
+                       limits_ = hasLimits() ? -1 : 1;
                else
                        limits_ = 0;
-               return DISPATCHED;
+               return DispatchResult(true, true);
        }
 
-       return MathNestInset::dispatch(cmd, idx, pos);
+       return MathNestInset::priv_dispatch(cmd, idx, pos);
 }