From 149c83d35d2cbdf1a34a49000cbd072335a93cca Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 28 Mar 2006 14:04:14 +0000 Subject: [PATCH] src/insets/insettabular (doDispatch, insertAsciiString): fix insertion of \t- and \n-separated content from external clipboard (bug 2394) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13518 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insettabular.C | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index bc8eb65d2f..af9ee9ffea 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -46,6 +46,7 @@ #include #include +using lyx::cap::dirtyTabularStack; using lyx::cap::tabularStackDirty; using lyx::graphics::PreviewLoader; @@ -467,10 +468,8 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd) } if (cmd.button() == mouse_button::button2) { - // FIXME: pasting multiple cells (with insettabular's own - // LFUN_PASTESELECTION still does not work! (jspitzm) cmd = FuncRequest(LFUN_PASTESELECTION, "paragraph"); - cell(cur.idx())->dispatch(cur, cmd); + doDispatch(cur, cmd); break; } @@ -726,11 +725,15 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd) if (cell < cells && op < len) paste_tabular->getCellInset(cell)-> setText(clip.substr(op, len - op), font); - } else if (!insertAsciiString(cur.bv(), clip, true)) { + dirtyTabularStack(true); + } else if (insertAsciiString(cur.bv(), clip, false)) + break; + else { // so that the clipboard is used and it goes on // to default // and executes LFUN_PASTESELECTION in insettext! paste_tabular.reset(); + dirtyTabularStack(false); } // fall through } @@ -1885,6 +1888,7 @@ bool InsetTabular::insertAsciiString(BufferView & bv, string const & buf, new LyXTabular(bv.buffer()->params(), rows, maxCols, &bv)); loctab = paste_tabular.get(); cols = 0; + dirtyTabularStack(true); } else { loctab = &tabular; cell = bv.cursor().idx(); -- 2.39.5