diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 3ccd24a049..20812eacf6 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2006-08-22 Jean-Marc Lasgouttes + + * math_nestinset.C (lfunMousePress): on button 2 press, paste + inner LyX selection if it exists (bug 2779). + 2006-08-18 Jean-Marc Lasgouttes * math_nestinset.C (script): when creating a script inset, handle diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 858e6d5127..01e0a30fca 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -1032,19 +1032,19 @@ InsetBase * MathNestInset::editXY(LCursor & cur, int x, int y) void MathNestInset::lfunMousePress(LCursor & cur, FuncRequest & cmd) { //lyxerr << "## lfunMousePress: buttons: " << cmd.button() << endl; + BufferView & bv = cur.bv(); if (cmd.button() == mouse_button::button1) { //lyxerr << "## lfunMousePress: setting cursor to: " << cur << endl; - cur.bv().mouseSetCursor(cur); - } - - if (cmd.button() == mouse_button::button2) { + bv.mouseSetCursor(cur); + } else if (cmd.button() == mouse_button::button2) { MathArray ar; - asArray(cur.bv().getClipboard(), ar); - cur.clearSelection(); - editXY(cur, cmd.x, cmd.y); + if (cur.selection()) + asArray(bv.cursor().selectionAsString(false), ar); + else + asArray(bv.getClipboard(), ar); + cur.insert(ar); - cur.bv().update(); - return; + bv.mouseSetCursor(cur); } } diff --git a/status.14x b/status.14x index 8e6dab853c..b6fb4c737c 100644 --- a/status.14x +++ b/status.14x @@ -80,6 +80,9 @@ What's new - Handle properly script insets which nucleus has more than one element (like {a'}^{2}). +- On button 2 press in math inset, paste inner LyX selection if it + exists (bug 2779). + - Fix disabling of some toolbar icons after closing a dialog (bug 2423). - Fix editing of document while Error List dialog is open (bug 2179).