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 dc402db113
commit 0f9c2b4f04
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -63,7 +63,8 @@ What's new
* USER INTERFACE
- Fix automatic insertion of longtable captions (bug 9692).
* INTERNALS