]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fracbase.C
Reduce Michael's buglist.
[lyx.git] / src / mathed / math_fracbase.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_fracbase.h"
6 #include "math_mathmlstream.h"
7
8
9 MathFracbaseInset::MathFracbaseInset()
10         : MathNestInset(2)
11 {}
12
13
14 bool MathFracbaseInset::idxRight(MathInset::idx_type &,
15                                  MathInset::pos_type &) const
16 {
17         return false;
18 }
19
20
21 bool MathFracbaseInset::idxLeft(MathInset::idx_type &,
22                                 MathInset::pos_type &) const
23 {
24         return false;
25 }
26
27
28 bool MathFracbaseInset::idxFirstUp(idx_type & idx, pos_type & pos) const
29 {
30         idx = 0;
31         pos = 0;
32         return true;
33 }
34
35
36 bool MathFracbaseInset::idxFirstDown(idx_type & idx, pos_type & pos) const
37 {
38         idx = 1;
39         pos = 0;
40         return true;
41 }
42
43
44 bool MathFracbaseInset::idxLastUp(idx_type & idx, pos_type & pos) const
45 {
46         idx = 0;
47         pos = cell(0).size();
48         return true;
49 }
50
51
52 bool MathFracbaseInset::idxLastDown(idx_type & idx, pos_type & pos) const
53 {
54         idx = 1;
55         pos = cell(1).size();
56         return true;
57 }
58
59
60 bool MathFracbaseInset::idxUp(MathInset::idx_type & idx,
61                               MathInset::pos_type & pos) const
62 {
63         if (idx == 0)
64                 return false;
65         idx = 0;
66         pos = std::min(pos, cell(idx).size());
67         return true;
68 }
69
70
71 bool MathFracbaseInset::idxDown(MathInset::idx_type & idx,
72                                 MathInset::pos_type & pos) const
73 {
74         if (idx == 1)
75                 return false;
76         idx = 1;
77         pos = std::min(pos, cell(idx).size());
78         return true;
79 }