]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettabular.C
more cleanup:
[lyx.git] / src / insets / insettabular.C
index bc7888fe3e1a9801aeb05553a33273186d51274c..849bf95079b7966784bcc9eb737913a072acdc6f 100644 (file)
@@ -246,7 +246,7 @@ void InsetTabular::read(Buffer const & buf, LyXLex & lex)
 }
 
 
-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";
@@ -300,7 +300,9 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
        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;
 }
 
 
@@ -493,12 +495,12 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
        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;
                }
 
@@ -658,7 +660,7 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
        // 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))