2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
2007-04-25 03:01:35 +00:00
|
|
|
|
* \file InsetMathFracBase.cpp
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
2001-08-08 17:26:30 +00:00
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
|
#include "InsetMathFracBase.h"
|
2007-04-25 16:11:45 +00:00
|
|
|
|
#include "MathArray.h"
|
2004-01-20 14:25:24 +00:00
|
|
|
|
#include "cursor.h"
|
2001-08-08 17:26:30 +00:00
|
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathFracBase::InsetMathFracBase()
|
|
|
|
|
: InsetMathNest(2)
|
2001-08-08 17:26:30 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
bool InsetMathFracBase::idxRight(LCursor &) const
|
2001-08-08 17:26:30 +00:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
bool InsetMathFracBase::idxLeft(LCursor &) const
|
2001-08-08 17:26:30 +00:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
bool InsetMathFracBase::idxUpDown(LCursor & cur, bool up) const
|
2001-08-08 17:26:30 +00:00
|
|
|
|
{
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMath::idx_type target = !up; // up ? 0 : 1, since upper cell has idx 0
|
2004-01-15 17:34:44 +00:00
|
|
|
|
if (cur.idx() == target)
|
2001-08-08 17:26:30 +00:00
|
|
|
|
return false;
|
2004-01-15 17:34:44 +00:00
|
|
|
|
cur.idx() = target;
|
2004-01-26 10:13:15 +00:00
|
|
|
|
cur.pos() = cell(target).x2pos(cur.x_target());
|
2001-08-08 17:26:30 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|