From 0f9c2b4f047e7d2f316a7a0eb0a187e992c560b8 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 25 Jul 2015 12:48:13 +0200 Subject: [PATCH] Do not attempt to select an empty cell before inserting a longtable caption Fixes: #9692 --- src/insets/InsetTabular.cpp | 4 +++- status.21x | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 1807bcb8ae..3013db791e 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -5930,7 +5930,9 @@ void InsetTabular::tabularFeatures(Cursor & cur, cur.setSelection(false); // If a row is set as caption, then also insert // a caption. Otherwise the LaTeX output is broken. - lyx::dispatch(FuncRequest(LFUN_INSET_SELECT_ALL)); + // Select cell if it is non-empty + if (cur.lastpos() > 0 || cur.lastpit() > 0) + lyx::dispatch(FuncRequest(LFUN_INSET_SELECT_ALL)); lyx::dispatch(FuncRequest(LFUN_CAPTION_INSERT)); break; } diff --git a/status.21x b/status.21x index e32d2a1887..a63ee2351d 100644 --- a/status.21x +++ b/status.21x @@ -63,7 +63,8 @@ What's new * USER INTERFACE - +- Fix automatic insertion of longtable captions (bug 9692). + * INTERNALS