#include "support/textutils.h"
#include "support/convert.h"
+#include <boost/current_function.hpp>
+
#include <sstream>
using lyx::pit_type;
if (bv_owner->text() == this) {
if (pit == 0 && row.pos() == 0)
maxasc += 20;
- if (pit + 1 == pars_.size() && row.endpos() == par.size())
+ if (pit + 1 == pit_type(pars_.size()) &&
+ row.endpos() == par.size())
maxdesc += 20;
}
InsetList::iterator iend = par.insetlist.end();
for (; ii != iend; ++ii) {
Dimension dim;
- int const w = maxwidth_ - leftMargin(pit) - rightMargin(par);
+ int const w = maxwidth_ - leftMargin(pit, ii->pos) - rightMargin(par);
MetricsInfo mi(bv(), getFont(par, ii->pos), w);
ii->inset->metrics(mi, dim);
}
// see correction above
if (boundary_correction)
- if (getFont(par, ppos).isRightToLeft())
+ if (getFont(par, ppos).isVisibleRightToLeft())
x -= singleWidth(par, ppos);
else
x += singleWidth(par, ppos);
+ // Make sure inside an inset we always count from the left
+ // edge (bidi!) -- MV
+ if (sl.pos() < par.size()) {
+ font = getFont(par, sl.pos());
+ if (!boundary && font.isVisibleRightToLeft()
+ && par.isInset(sl.pos()))
+ x -= par.getInset(sl.pos())->width();
+ }
return int(x);
}
// x,y are screen coordinates
// sets cursor only within this LyXText
-void LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
+bool LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
{
pit_type pit = getPitNearY(y);
int yy = theCoords.get(this, pit).y_ - pars_[pit].ascent();
<< " pos: " << pos
<< endl;
- setCursor(cur, pit, pos, true, bound);
+ return setCursor(cur, pit, pos, true, bound);
}