2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-1999 The LyX Team.
10 * ======================================================*/
38 float getValue() const
41 case Single
: return 1.0;
42 case Onehalf
: return 1.25;
43 case Double
: return 1.667;
44 case Other
: return value
;
49 Spacing::Space
getSpace() const
54 void set(Spacing::Space sp
, float val
= 1.0)
58 switch(int(val
*1000 + 0.5)) {
59 case 1000: space
= Single
; break;
60 case 1250: space
= Onehalf
; break;
61 case 1667: space
= Double
; break;
62 default: value
= val
; break;
67 void set(Spacing::Space sp
, char const* val
)
70 sscanf(val
,"%f",&fval
);
74 void writeFile(FILE *file
);
76 friend bool operator!=(Spacing
const &a
, Spacing
const &b
)
78 if (a
.space
== b
.space
&& a
.getValue() == b
.getValue())