}
-void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
{
//lyxerr << "InsetTabular::metrics: " << mi.base.bv << " width: " <<
// mi.base.textwidth << "\n";
dim.asc = tabular.getAscentOfRow(0);
dim.des = tabular.getHeightOfTabular() - dim.asc;
dim.wid = tabular.getWidthOfTabular() + 2 * ADD_TO_TABULAR_WIDTH;
+ bool const changed = dim_ != dim;
dim_ = dim;
+ return changed;
}
case LFUN_MOUSE_PRESS:
//lyxerr << "# InsetTabular::MousePress\n" << cur.bv().cursor() << endl;
- if (cmd.button() == mouse_button::button1
- || cmd.button() == mouse_button::button3) {
+ if (cmd.button() == mouse_button::button1
+ || (cmd.button() == mouse_button::button3
+ && (&bvcur.selBegin().inset() != this || !tablemode(bvcur)))) {
cur.selection() = false;
setCursorFromCoordinates(cur, cmd.x, cmd.y);
- cur.resetAnchor();
- bvcur = cur;
+ cur.bv().mouseSetCursor(cur);
break;
}
// insert file functions
case LFUN_FILE_INSERT_ASCII_PARA:
case LFUN_FILE_INSERT_ASCII: {
- // FIXME: We don't know the encoding of filenames
+ // FIXME UNICODE
string const tmpstr = getContentsOfAsciiFile(&cur.bv(), to_utf8(cmd.argument()), false);
// FIXME: We don't know the encoding of the file
if (!tmpstr.empty() && !insertAsciiString(cur.bv(), from_utf8(tmpstr), false))