Get rid of SEPARATOR row element type

It is not used anymore.

Also get rid of a comment made irrelevant by recent changes.
This commit is contained in:
Jean-Marc Lasgouttes 2015-07-21 09:51:06 +02:00
parent 25727ee5a8
commit 371bd2b1e5
3 changed files with 5 additions and 45 deletions

View File

@ -87,7 +87,6 @@ pos_type Row::Element::x2pos(int &x) const
i = 0;
x = rtl ? int(full_width()) : 0;
break;
case SEPARATOR:
case INSET:
case SPACE:
// those elements contain only one position. Round to
@ -233,9 +232,6 @@ ostream & operator<<(ostream & os, Row::Element const & e)
case Row::INSET:
os << "INSET: " << to_utf8(e.inset->layoutName()) << ", ";
break;
case Row::SEPARATOR:
os << "SEPARATOR: extra=" << e.extra << ", ";
break;
case Row::SPACE:
os << "SPACE: ";
break;
@ -360,18 +356,6 @@ void Row::addVirtual(pos_type const pos, docstring const & s,
}
void Row::addSeparator(pos_type const pos, char_type const c,
Font const & f, Change const & ch)
{
finalizeLast();
Element e(SEPARATOR, pos, f, ch);
e.str += c;
e.dim.wid = theFontMetrics(f).width(c);
elements_.push_back(e);
dim_.wid += e.dim.wid;
}
void Row::addSpace(pos_type const pos, int const width,
Font const & f, Change const & ch)
{

View File

@ -29,18 +29,6 @@ namespace lyx {
class DocIterator;
class Inset;
/**
* FIXME: Change Row object to operate only on integers and not doubles.
*
* This use of double is only useful to distribute the extra
* horizontal space between separators in justified text. If we do
* integer arithmetic, then it is possible to have two groups of
* separators, with size s or s+1. Then strings can be drawn without
* cutting at separators in justfied text, as it is done in
* non-justified text. This will improve performance.
*/
/**
* An on-screen row of text. A paragraph is broken into a RowList for
* display. Each Row contains a tokenized description of the contents
@ -58,8 +46,6 @@ public:
* correspond to any paragraph contents
*/
VIRTUAL,
// A stretchable space, basically
SEPARATOR,
// An inset
INSET,
// Some spacing described by its width, not a string
@ -114,10 +100,10 @@ public:
// Non-zero only if element is an inset
Inset const * inset;
// Only non-null for separator elements
// Only non-null for justified rows
double extra;
// Non-empty if element is a string or separator
// Non-empty if element is a string or is virtual
docstring str;
//
Font font;
@ -192,9 +178,6 @@ public:
void addVirtual(pos_type pos, docstring const & s,
Font const & f, Change const & ch);
///
void addSeparator(pos_type pos, char_type const c,
Font const & f, Change const & ch);
///
void addSpace(pos_type pos, int width, Font const & f, Change const & ch);
///
@ -249,7 +232,7 @@ public:
friend std::ostream & operator<<(std::ostream & os, Row const & row);
/// width of a separator (i.e. space)
/// additional width for separators in justified rows (i.e. space)
double separator;
/// width of hfills in the label
double label_hfill;

View File

@ -163,13 +163,6 @@ void RowPainter::paintInset(Inset const * inset, Font const & font,
}
void RowPainter::paintSeparator(double width, Font const & font)
{
pi_.pain.textDecoration(font.fontInfo(), int(x_), yo_, int(width));
x_ += width;
}
void RowPainter::paintForeignMark(double orig_x, Language const * lang, int desc) const
{
if (!lyxrc.mark_foreign_language)
@ -651,9 +644,9 @@ void RowPainter::paintText()
foreign_descent = e.dim.descent();
}
break;
case Row::SEPARATOR:
case Row::SPACE:
paintSeparator(e.full_width(), e.font);
pi_.pain.textDecoration(e.font.fontInfo(), int(x_), yo_, int(e.full_width()));
x_ += e.full_width();
}
// The line that indicates word in a different language