Prepare ANNOUNCE and NEWS for rc2
[lyx.git] / src / Row.cpp
blob975940310c41b346b90342597a8c907b81190e34
1 /**
2 * \file Row.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author unknown
7 * \author Lars Gullik Bjønnes
8 * \author John Levon
9 * \author André Pönitz
10 * \author Jürgen Vigna
12 * Full author contact details are available in file CREDITS.
14 * Metrics for an on-screen text row.
17 #include <config.h>
19 #include "Row.h"
21 #include "support/debug.h"
24 namespace lyx {
27 Row::Row()
28 : separator(0), label_hfill(0), x(0),
29 sel_beg(-1), sel_end(-1), changed_(false), crc_(0), pos_(0), end_(0)
33 Row::Row(pos_type pos)
34 : separator(0), label_hfill(0), x(0),
35 sel_beg(-1), sel_end(-1), changed_(false), crc_(0), pos_(pos), end_(0)
39 void Row::setCrc(size_type crc) const
41 changed_ = crc != crc_;
42 crc_ = crc;
46 void Row::setDimension(Dimension const & dim)
48 dim_ = dim;
52 void Row::pos(pos_type p)
54 pos_ = p;
58 void Row::endpos(pos_type p)
60 end_ = p;
64 void Row::setSelection(pos_type beg, pos_type end) const
66 if (pos_ >= beg && pos_ <= end)
67 sel_beg = pos_;
68 else if (beg > pos_ && beg <= end_)
69 sel_beg = beg;
70 else
71 sel_beg = -1;
73 if (end_ >= beg && end_ <= end)
74 sel_end = end_;
75 else if (end < end_ && end >= pos_)
76 sel_end = end;
77 else
78 sel_end = -1;
82 void Row::dump(char const * s) const
84 LYXERR0(s << " pos: " << pos_ << " end: " << end_
85 << " width: " << dim_.wid
86 << " ascent: " << dim_.asc
87 << " descent: " << dim_.des);
91 } // namespace lyx