]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetTabular.cpp
Do not attempt to select an empty cell before inserting a longtable caption
[features.git] / src / insets / InsetTabular.cpp
index 7ae5bc035848bd4b186bfac010ccf767e95a804d..f2f65ccddfc3df535a3ab76711ac2b54ffd10ac1 100644 (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;
        }