+/**
+ * \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 std::string;
using std::max;
+using std::auto_ptr;
+using std::endl;
MathScriptInset::MathScriptInset()
-MathInset * MathScriptInset::clone() const
+auto_ptr<InsetBase> MathScriptInset::clone() const
{
- return new MathScriptInset(*this);
+ return auto_ptr<InsetBase>(new MathScriptInset(*this));
}
int MathScriptInset::dx0() const
{
- lyx::Assert(hasDown());
+ BOOST_ASSERT(hasDown());
return hasLimits() ? (dim_.wid - down().width()) / 2 : nwid();
}
int MathScriptInset::dx1() const
{
- lyx::Assert(hasUp());
+ BOOST_ASSERT(hasUp());
return hasLimits() ? (dim_.wid - up().width()) / 2 : nwid();
}
//}
} else {
if (os.firstitem())
- lyxerr[Debug::MATHED] << "suppressing {} when writing\n";
+ lyxerr[Debug::MATHED] << "suppressing {} when writing"
+ << endl;
else
os << "{}";
}
}
-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()) {
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);
}