Do not attempt to select an empty cell before inserting a longtable caption

Fixes: #9692
This commit is contained in:
Juergen Spitzmueller 2015-07-25 12:48:13 +02:00
parent 616c7b9272
commit 9f777d4bfb

View File

@ -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;
}