From f8ee0a77585e18aaca30833d70be830eda173eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Fri, 24 Oct 2008 11:20:12 +0000 Subject: [PATCH] * src/Cursor.cpp (selectionAsString): - Fix a crash when selecting multiple cells of a tabular. (I might have a look at the missing table->asString later). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@27080 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Cursor.cpp | 15 +++++++++++++++ status.15x | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 10a65bbe99..3785ea6912 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -1350,6 +1350,21 @@ docstring Cursor::selectionAsString(bool label) const return docstring(); if (inTexted()) { + idx_type const startidx = selBegin().idx(); + idx_type const endidx = selEnd().idx(); + if (startidx != endidx) { + // multicell selection +#if 0 +// FIXME: we do not have table->asString, thus we have to return docstring() here. + InsetTabular * table = static_cast(&inset()); + BOOST_ASSERT(table); + if (!table) + return docstring(); + table->asString(startidx, endidx); +#endif + return docstring(); + } + Buffer const & buffer = *bv().buffer(); ParagraphList const & pars = text()->paragraphs(); diff --git a/status.15x b/status.15x index 00a27f27e8..e9d23b58a8 100644 --- a/status.15x +++ b/status.15x @@ -147,6 +147,8 @@ What's new - Fix a crash on some systems when using the math panel (bug 5189). +- Fix a crash when selecting multiple cells of a tabular. + - Fix the input behaviour when multiple cells of a table were selected, including a possible assertion (bug 5225).