mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
Add operator<< for Row::Elements
This is useful for debugging.
This commit is contained in:
parent
4b69f5efa7
commit
71c2e2fda6
19
src/Row.cpp
19
src/Row.cpp
@ -275,6 +275,17 @@ ostream & operator<<(ostream & os, Row::Element const & e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ostream & operator<<(ostream & os, Row::Elements const & elts)
|
||||||
|
{
|
||||||
|
double x = 0;
|
||||||
|
for (Row::Element const & e : elts) {
|
||||||
|
os << "x=" << x << " => " << e << endl;
|
||||||
|
x += e.full_width();
|
||||||
|
}
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ostream & operator<<(ostream & os, Row const & row)
|
ostream & operator<<(ostream & os, Row const & row)
|
||||||
{
|
{
|
||||||
os << " pos: " << row.pos_ << " end: " << row.end_
|
os << " pos: " << row.pos_ << " end: " << row.end_
|
||||||
@ -286,11 +297,11 @@ ostream & operator<<(ostream & os, Row const & row)
|
|||||||
<< " separator: " << row.separator
|
<< " separator: " << row.separator
|
||||||
<< " label_hfill: " << row.label_hfill
|
<< " label_hfill: " << row.label_hfill
|
||||||
<< " row_boundary: " << row.right_boundary() << "\n";
|
<< " row_boundary: " << row.right_boundary() << "\n";
|
||||||
|
// We cannot use the operator above, unfortunately
|
||||||
double x = row.left_margin;
|
double x = row.left_margin;
|
||||||
Row::Elements::const_iterator it = row.elements_.begin();
|
for (Row::Element const & e : row.elements_) {
|
||||||
for ( ; it != row.elements_.end() ; ++it) {
|
os << "x=" << x << " => " << e << endl;
|
||||||
os << "x=" << x << " => " << *it << endl;
|
x += e.full_width();
|
||||||
x += it->full_width();
|
|
||||||
}
|
}
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
@ -378,6 +378,8 @@ private:
|
|||||||
bool changebar_ = false;
|
bool changebar_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::ostream & operator<<(std::ostream & os, Row::Elements const & elts);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Each paragraph is broken up into a number of rows on the screen.
|
* Each paragraph is broken up into a number of rows on the screen.
|
||||||
|
Loading…
Reference in New Issue
Block a user