]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathFracBase.C
BUG 686: delete empty math box with delete/backspace key
[lyx.git] / src / mathed / InsetMathFracBase.C
1 /**
2  * \file InsetMathFracBase.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetMathFracBase.h"
14 #include "MathData.h"
15 #include "cursor.h"
16
17
18 namespace lyx {
19
20
21 InsetMathFracBase::InsetMathFracBase()
22         : InsetMathNest(2)
23 {}
24
25
26 bool InsetMathFracBase::idxRight(LCursor &) const
27 {
28         return false;
29 }
30
31
32 bool InsetMathFracBase::idxLeft(LCursor &) const
33 {
34         return false;
35 }
36
37
38 bool InsetMathFracBase::idxUpDown(LCursor & cur, bool up) const
39 {
40         InsetMath::idx_type target = !up; // up ? 0 : 1, since upper cell has idx 0
41         if (cur.idx() == target)
42                 return false;
43         cur.idx() = target;
44         cur.pos() = cell(target).x2pos(cur.x_target());
45         return true;
46 }
47
48
49 } // namespace lyx