From: Juergen Spitzmueller Date: Sat, 25 Jul 2015 10:48:13 +0000 (+0200) Subject: Do not attempt to select an empty cell before inserting a longtable caption X-Git-Tag: 2.2.0alpha1~393 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9f777d4bfb711f3fa6daa8d61eb071d365b5d076;p=features.git Do not attempt to select an empty cell before inserting a longtable caption Fixes: #9692 --- 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; }