#include "support/lstrings.h"
#include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
// incalculate the layout spaces
maxasc += int(layoutasc * 2 / (2 + pars_[pit].getDepth()));
maxdesc += int(layoutdesc * 2 / (2 + pars_[pit].getDepth()));
-
+
+ // Top and bottom margin of the document (only at top-level)
+ if (bv_owner->text() == this) {
+ if (pit == 0 && row.pos() == 0)
+ maxasc += 20;
+ if (pit == pars_.size() - 1 && row.endpos() == par.size())
+ maxdesc += 20;
+ }
+
row.ascent(maxasc + labeladdon);
row.descent(maxdesc);
}
z = row.endpos();
} while (z < par.size());
- dim.asc += par.rows()[0].ascent();
- dim.des -= par.rows()[0].ascent();
+ dim.asc += par.rows()[0].ascent();
+ dim.des -= par.rows()[0].ascent();
par.dim_ = dim;
//lyxerr << "redoParagraph: " << par.rows().size() << " rows\n";
}
beg.top() = cur.selBegin();
end.top() = cur.selEnd();
-
+
// the selection doesn't touch the visible screen
if (bv_funcs::status(pi.base.bv, beg) == bv_funcs::CUR_BELOW
|| bv_funcs::status(pi.base.bv, end) == bv_funcs::CUR_ABOVE)
Paragraph const & par1 = pars_[beg.pit()];
Paragraph const & par2 = pars_[end.pit()];
-
+
Row const & row1 = par1.getRow(beg.pos());
Row const & row2 = par2.getRow(end.pos());
-
+
int y1,x1,x2;
if (bv_funcs::status(pi.base.bv, beg) == bv_funcs::CUR_ABOVE) {
y1 = 0;
X1 = isRTL(par2) ? 0 : endx;
X2 = isRTL(par2) ? endx : 0 + dim_.wid;
}
-
+
lyxerr << " y1: " << y1 << " y2: " << y2
- << " xo: " << xo_ << " wid: " << dim_.wid
+ << " xo: " << xo_ << " wid: " << dim_.wid
<< endl;
// paint big rectangle in one go
beg.top() = cur.selBegin();
end.top() = cur.selEnd();
-
+
// the selection doesn't touch the visible screen
if (bv_funcs::status(pi.base.bv, beg) == bv_funcs::CUR_BELOW
|| bv_funcs::status(pi.base.bv, end) == bv_funcs::CUR_ABOVE)
Paragraph const & par1 = pars_[beg.pit()];
Paragraph const & par2 = pars_[end.pit()];
-
+
bool const above = (bv_funcs::status(pi.base.bv, beg)
== bv_funcs::CUR_ABOVE);
bool const below = (bv_funcs::status(pi.base.bv, end)
// The paragraph depth
int depth = cur.paragraph().getDepth();
if (depth > 0)
- os << bformat(_(", Depth: %1$s"), tostr(depth));
+ os << bformat(_(", Depth: %1$d"), depth);
// The paragraph spacing, but only if different from
// buffer spacing.
os << _("Double");
break;
case Spacing::Other:
- os << _("Other (") << spacing.getValue() << ')';
+ os << _("Other (") << spacing.getValueAsString() << ')';
break;
case Spacing::Default:
// should never happen, do nothing
// Paragraph const & par = pars_[pit];
// Row const & r = par.rows()[row];
// int x = 0;
-// pos -= r.pos();
+// pos -= r.pos();
//}
{
pit_type pit = getPitNearY(y);
int yy = theCoords.get(this, pit).y_ - pars_[pit].ascent();
- lyxerr << "setCursorFromCoordinates: x: " << x << " y: " << y
+ lyxerr << "setCursorFromCoordinates: x: " << x << " y: " << y
<< " pit: " << pit << " yy: " << yy << endl;
Paragraph const & par = pars_[pit];
}
Row const & row = par.rows()[r];
-
+
lyxerr << "setCursorFromCoordinates: row " << r
<< " from pos: " << row.pos() << endl;
-
+
bool bound = false;
int xx = x;
pos_type const pos = row.pos() + getColumnNearX(pit, row, xx, bound);