2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
17 using std::istringstream;
22 #include "support/LOstream.h"
44 float getValue() const {
46 case Single: return 1.0;
47 case Onehalf: return 1.25;
48 case Double: return 1.667;
49 case Other: return value;
54 Spacing::Space getSpace() const {
58 void set(Spacing::Space sp, float val = 1.0) {
61 switch(int(val * 1000 + 0.5)) {
62 case 1000: space = Single; break;
63 case 1250: space = Onehalf; break;
64 case 1667: space = Double; break;
65 default: value = val; break;
70 void set(Spacing::Space sp, char const * val) {
73 istringstream istr(val);
81 void writeFile(ostream &);
83 friend bool operator!=(Spacing const & a, Spacing const & b) {
84 if (a.space == b.space && a.getValue() == b.getValue())