#include <sstream>
+using lyx::docstring;
using lyx::pit_type;
using lyx::pos_type;
for (pit_type pit = 0; pit != end; ++pit)
pars_[pit].rows().clear();
- current_font = getFont(pars_[0], 0);
updateLabels(*bv->buffer());
}
break;
}
// Realize against environment font information
- if (pit < pars_.size())
+ // NOTE: the cast to pit_type should be removed when pit_type
+ // changes to a unsigned integer.
+ if (pit < pit_type(pars_.size()))
font.realize(outerFont(pit, pars_));
// Realize with the fonts of lesser depth.
bool LyXText::changeDepthAllowed(LCursor & cur, DEPTH_CHANGE type) const
{
BOOST_ASSERT(this == cur.text());
+ // this happens when selecting several cells in tabular (bug 2630)
+ if (cur.selBegin().idx() != cur.selEnd().idx())
+ return false;
+
pit_type const beg = cur.selBegin().pit();
pit_type const end = cur.selEnd().pit() + 1;
int max_depth = (beg != 0 ? pars_[beg - 1].getMaxDepthAfter() : 0);
c = bidi.vis2log(vc);
last_tmpx = tmpx;
if (body_pos > 0 && c == body_pos - 1) {
+ string lsep = layout->labelsep;
+ docstring dlsep(lsep.begin(), lsep.end());
tmpx += r.label_hfill +
- font_metrics::width(layout->labelsep, getLabelFont(par));
+ font_metrics::width(dlsep, getLabelFont(par));
if (par.isLineSeparator(body_pos - 1))
tmpx -= singleWidth(par, body_pos - 1);
}