]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_scriptinset.C
more IU
[lyx.git] / src / mathed / math_scriptinset.C
index 2efedd1724dda88315ca5a546e4546a9a3abe256..1118070fe76bf63b34a64b20214b594673d123a0 100644 (file)
@@ -1,15 +1,31 @@
+/**
+ * \file math_scriptinset.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#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;
 
 
 MathScriptInset::MathScriptInset()
@@ -145,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();
 }
 
@@ -359,7 +375,8 @@ void MathScriptInset::write(WriteStream & os) const
                //}
        } else {
                if (os.firstitem())
-                       lyxerr[Debug::MATHED] << "suppressing {} when writing\n";
+                       lyxerr[Debug::MATHED] << "suppressing {} when writing"
+                                             << endl;
                else
                        os << "{}";
        }
@@ -495,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()) {
@@ -507,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);
 }