]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
Lyx crashed after inserting, deleting and inserting float object.
[lyx.git] / src / Text3.cpp
index d0713fd86bcc162bdff506f1daded901d365d5cb..68f822173acc64d934bf4364c4a4d951dd47ef4c 100644 (file)
@@ -1271,7 +1271,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                // reposition the cursor to the caption
                cur.pit() = cap_pit;
                cur.pos() = 0;
-               cur.dispatch(FuncRequest(LFUN_CAPTION_INSERT));
+               // FIXME: This Text/Cursor dispatch handling is a mess!
+               // We cannot use Cursor::dispatch here it needs access to up to
+               // date metrics.
+               cur.text()->dispatch(cur, FuncRequest(LFUN_CAPTION_INSERT));
+               cur.updateFlags(Update::Force);
                // FIXME: When leaving the Float (or Wrap) inset we should
                // delete any empty paragraph left above or below the
                // caption.
@@ -1766,7 +1770,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                break;
        case LFUN_CHARSTYLE_INSERT:
                code = Inset::CHARSTYLE_CODE;
-               if (cur.buffer().params().getTextClass().charstyles().empty())
+               if (cur.buffer().params().getTextClass().insetlayouts().empty())
                        enable = false;
                break;
        case LFUN_BOX_INSERT: