From 9f777d4bfb711f3fa6daa8d61eb071d365b5d076 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 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 7ae5bc0358..f2f65ccddf 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -5885,7 +5885,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; } -- 2.39.2