]> git.lyx.org Git - features.git/commitdiff
send UpdatableInset down the way of the Dodo
authorAndré Pönitz <poenitz@gmx.net>
Fri, 15 Jul 2005 22:10:25 +0000 (22:10 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 15 Jul 2005 22:10:25 +0000 (22:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10228 a592a061-630c-0410-9148-cb99ea01b6c8

27 files changed:
src/BufferView.C
src/cursor.C
src/cursor_slice.C
src/cursor_slice.h
src/factory.C
src/frontends/screen.C
src/insets/ChangeLog
src/insets/Makefile.am
src/insets/inset.C
src/insets/inset.h
src/insets/insetbase.h
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/updatableinset.C [deleted file]
src/insets/updatableinset.h [deleted file]
src/lyxfunc.C
src/mathed/math_hullinset.C
src/mathed/math_hullinset.h
src/paragraph.C
src/paragraph.h
src/paragraph_pimpl.h
src/text3.C
src/undo.C

index 5009b2961d6d336541f9a8c1bbfd65498368432c..31e01b155bae53be96e9146e4d8f931687d0ee63 100644 (file)
@@ -45,7 +45,6 @@
 #include "frontends/WorkArea.h"
 
 #include "insets/insetcommand.h" // ChangeRefs
-#include "insets/updatableinset.h"
 #include "insets/insettext.h"
 
 using lyx::support::bformat;
index e72426f64753af016508c789645b98736ca49466..461777ececd8ae35c51f496166bbb6afa658eb16 100644 (file)
@@ -32,7 +32,6 @@
 #include "paragraph_funcs.h"
 #include "pariterator.h"
 
-#include "insets/updatableinset.h"
 #include "insets/insettabular.h"
 #include "insets/insettext.h"
 
index f4a59dfb80da84c6f3747c05fb647c7d6f2f24f9..086317800bf3364c3ab30ef3743c9c70c6ce328b 100644 (file)
@@ -21,9 +21,6 @@
 #include "mathed/math_inset.h"
 #include "mathed/math_data.h"
 
-#include "insets/updatableinset.h"
-
-
 #include <boost/assert.hpp>
 
 using std::endl;
@@ -90,13 +87,6 @@ MathInset * CursorSlice::asMathInset() const
 }
 
 
-UpdatableInset * CursorSlice::asUpdatableInset() const
-{
-       BOOST_ASSERT(inset_);
-       return inset_->asUpdatableInset();
-}
-
-
 MathArray & CursorSlice::cell() const
 {
        BOOST_ASSERT(asMathInset());
index 304dceb901e0e821e36fb9c5290ab11c901c7ad3..017def63a43b2e132208adcda3877122a3c80e92 100644 (file)
@@ -28,13 +28,12 @@ class MathInset;
 class MathArray;
 class LyXText;
 class Paragraph;
-class UpdatableInset;
 
 
 /// This encapsulates a single slice of a document iterator as used e.g.
 /// for cursors.
 
-// After IU, the distinction of MathInset and UpdatableInset as well as
+// After IU, the distinction of MathInset and InsetOld as well as
 // that of MathArray and LyXText should vanish. They are conceptually the
 // same (now...)
 
@@ -108,8 +107,6 @@ public:
        LyXText * text();
        /// returns text corresponding to this position
        LyXText const * text() const;
-       /// returns the owning inset if it is an UpdatableInset, else 0
-       UpdatableInset * asUpdatableInset() const;
        /// paragraph in this cell
        Paragraph & paragraph();
        /// paragraph in this cell
index 272133df699f30572c58b365b9db799beb84f951..591f8d6f04da06fd0f50903e7d5e52445706ca86 100644 (file)
@@ -159,32 +159,28 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
                        bv->getLyXText()->getStringToIndex(bv->cursor()) :
                        cmd.argument;
                icp.setContents(contents);
-
                return new InsetIndex(icp);
-
        }
 
-       case LFUN_TABULAR_INSERT:
-               if (!cmd.argument.empty()) {
-                       std::istringstream ss(cmd.argument);
-                       int r = 0, c = 0;
-                       ss >> r >> c;
-                       if (r <= 0) r = 2;
-                       if (c <= 0) c = 2;
-                       return new InsetTabular(*bv->buffer(), r, c);
-               }
-               return 0;
+       case LFUN_TABULAR_INSERT: {
+               if (!cmd.argument.empty()) 
+                       return 0;
+               std::istringstream ss(cmd.argument);
+               int r = 0, c = 0;
+               ss >> r >> c;
+               if (r <= 0)
+                       r = 2;
+               if (c <= 0)
+                       c = 2;
+               return new InsetTabular(*bv->buffer(), r, c);
+       }
 
        case LFUN_INSET_CAPTION: {
-               UpdatableInset * up = bv->cursor().inset().asUpdatableInset();
-               if (!up) {
-                       auto_ptr<InsetCaption> inset(new InsetCaption(params));
-                       inset->setAutoBreakRows(true);
-                       inset->setDrawFrame(true);
-                       inset->setFrameColor(LColor::captionframe);
-                       return inset.release();
-               }
-               return 0;
+               auto_ptr<InsetCaption> inset(new InsetCaption(params));
+               inset->setAutoBreakRows(true);
+               inset->setDrawFrame(true);
+               inset->setFrameColor(LColor::captionframe);
+               return inset.release();
        }
 
        case LFUN_INDEX_PRINT:
index ae796390b3da4a920e6da9dd46e1d718cfa3130d..d7a1f34e55dad26386c26ecefe6c9f32f52c53dc 100644 (file)
@@ -35,8 +35,6 @@
 #include "rowpainter.h"
 #include "version.h"
 
-#include "insets/updatableinset.h"
-
 #include "graphics/GraphicsImage.h"
 #include "graphics/GraphicsLoader.h"
 
index efaf3cb8c5dd9e0ef886c902c0d56981c3e6ac72..35572547bf3a5e65288a599f355666f28d9594ed 100644 (file)
@@ -1,3 +1,11 @@
+2005-07-15  André Pönitz  <poenitz@gmx.net>
+
+       * Makefile.am:
+       * inset.[Ch]:
+       * insetcollapsable.[Ch]:
+       * insettabular.[Ch]:
+       * updatableinset.[Ch]: remove UpdatableInset
+
 2005-07-15  José Matos  <jamatos@lyx.org>
 
        * insettext.C (plaintext): fix call to asciiParagraph.
index 5685c9ee6035b95860b905c4d8a5d66e6dfc7e76..2a19b87f6008a0af8ec696f4ebb5b61a5d12483a 100644 (file)
@@ -110,12 +110,12 @@ libinsets_la_SOURCES = \
        insetvspace.C \
        insetvspace.h \
        insetwrap.h \
-       insetwrap.C \
-       updatableinset.C \
-       updatableinset.h
+       insetwrap.C 
+
 #      insetlist.C \
 #      insetlist.h \
 #      insetsection.h \
 #      insetsection.C \
 #      insettheorem.C \
 #      insettheorem.h
+
index 7d846f23839f450ea6ebbb7ffe05d1b121ccdfa2..38640a11f9fa9822426b1bf5027aed17c873e3dd 100644 (file)
@@ -14,7 +14,6 @@
 #include <config.h>
 
 #include "inset.h"
-#include "updatableinset.h"
 
 #include "BufferView.h"
 #include "debug.h"
index 8f048b25f01c0cfff6ecd50b467de7d0b9d787a0..be38ca8cf18ecc98e2fe28ccc8363da2e3d59731 100644 (file)
@@ -19,7 +19,6 @@
 #include "dimension.h"
 
 class LColor_color;
-class UpdatableInset;
 
 
 /// Insets
index b14fbd60d0ebc0ecca747c6b3afc8d3b99b710c6..d405bfc9ca5609ec7a48eb91b448d4d03e4fce8a 100644 (file)
@@ -74,8 +74,6 @@ public:
 
        /// identification as math inset
        virtual MathInset * asMathInset() { return 0; }
-       /// identification as non-math inset
-       virtual UpdatableInset * asUpdatableInset() { return 0; }
        /// true for 'math' math inset, but not for e.g. mbox
        virtual bool inMathed() const { return false; }
 
@@ -116,6 +114,8 @@ public:
        virtual void drawSelection(PainterInfo &, int, int) const {}
        ///
        virtual bool editing(BufferView * bv) const;
+       ///
+       virtual bool showInsetDialog(BufferView *) const { return false; }
        /// draw four angular markers
        void drawMarkers(PainterInfo & pi, int x, int y) const;
        /// draw two angular markers
index 7967caec2a6cd84abd2bc6631ec5c5c4ceee15a1..d688cf3301000cb3a66f251afc6034b8bb693c0d 100644 (file)
@@ -367,17 +367,6 @@ bool InsetCollapsable::getStatus(LCursor & cur, FuncRequest const & cmd,
 }
 
 
-int InsetCollapsable::scroll(bool recursive) const
-{
-       int sx = UpdatableInset::scroll(false);
-
-       if (recursive)
-               sx += InsetText::scroll(false);
-
-       return sx;
-}
-
-
 void InsetCollapsable::setLabel(string const & l)
 {
        label = l;
index ee90a458c26b49418eecb51b39872393a091841b..6b351bf9d1a42f0fb3ff8bd6fcb973f16944175e 100644 (file)
@@ -65,8 +65,6 @@ public:
        ///
        void setLabelFont(LyXFont & f);
        ///
-       int scroll(bool recursive = true) const;
-       ///
        bool isOpen() const { return status_ == Open || status_ == Inlined; }
        ///
        bool inlined() const { return status_ == Inlined; }
@@ -80,14 +78,11 @@ public:
        void setStatus(LCursor & cur, CollapseStatus st);
 
 protected:
-
        ///
        virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
        ///
        Dimension dimensionCollapsed() const;
        ///
-       int getMaxTextWidth(Painter & pain, UpdatableInset const *) const;
-       ///
        Box const & buttonDim() const;
        ///
        void edit(LCursor & cur, bool left);
index 868e9d1004c2afe57841488c8b6aeb7e8215f194..e86c1d305b418318656dd445333429402839b70a 100644 (file)
@@ -164,13 +164,13 @@ bool InsetTabular::hasPasteBuffer() const
 InsetTabular::InsetTabular(Buffer const & buf, row_type rows,
                            col_type columns)
        : tabular(buf.params(), max(rows, row_type(1)),
-         max(columns, col_type(1))), buffer_(&buf), cursorx_(0)
+         max(columns, col_type(1))), buffer_(&buf), scx_(0)
 {}
 
 
 InsetTabular::InsetTabular(InsetTabular const & tab)
-       : UpdatableInset(tab), tabular(tab.tabular),
-               buffer_(tab.buffer_), cursorx_(0)
+       : InsetOld(tab), tabular(tab.tabular),
+               buffer_(tab.buffer_), scx_(0)
 {}
 
 
@@ -279,7 +279,7 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
 
        //resetPos(bv->cursor());
 
-       x += scroll();
+       x += scx_;
        x += ADD_TO_TABULAR_WIDTH;
 
        idx_type idx = 0;
@@ -329,8 +329,7 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
 
        //resetPos(cur);
 
-       x += scroll();
-       x += ADD_TO_TABULAR_WIDTH;
+       x += scx_ + ADD_TO_TABULAR_WIDTH;
 
        if (tablemode(cur)) {
                row_type rs, re;
@@ -772,6 +771,7 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
        default:
                // we try to handle this event in the insets dispatch function.
                cell(cur.idx())->dispatch(cur, cmd);
+               resetPos(cur);
                break;
        }
 
@@ -1111,7 +1111,7 @@ void InsetTabular::cursorPos
        }
        x += tabular.getBeginningOfTextInCell(idx);
        x += ADD_TO_TABULAR_WIDTH;
-       x += scroll();
+       x += scx_;
 }
 
 
@@ -1204,7 +1204,7 @@ void InsetTabular::resetPos(LCursor & cur) const
        int const maxwidth = bv.workWidth();
 
        if (&cur.inset() != this) {
-               //scx = 0;
+               scx_ = 0;
        } else {
                int const X1 = 0;
                int const X2 = maxwidth;
@@ -1213,11 +1213,11 @@ void InsetTabular::resetPos(LCursor & cur) const
                int const x2 = x1 + tabular.getWidthOfColumn(cur.idx());
 
                if (x1 < X1)
-                       scx = X1 + 20 - x1;
+                       scx_ = X1 + 20 - x1;
                else if (x2 > X2)
-                       scx = X2 - 20 - x2;
+                       scx_ = X2 - 20 - x2;
                else
-                       scx = 0;
+                       scx_ = 0;
        }
 
        cur.needsUpdate();
index 53f974eec9fe98e1ec654a745a53a4a8d0f685b0..5bb7dbed46a9e849aff8cf64eab8a5dde03ef7da 100644 (file)
@@ -45,7 +45,7 @@ class Paragraph;
 class CursorSlice;
 
 
-class InsetTabular : public UpdatableInset {
+class InsetTabular : public InsetOld {
 public:
        ///
        InsetTabular(Buffer const &, row_type rows = 1,
@@ -65,6 +65,8 @@ public:
        ///
        std::string const editMessage() const;
        ///
+       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       ///
        bool insetAllowed(InsetBase::Code) const { return true; }
        ///
        bool isTextInset() const { return true; }
@@ -140,10 +142,10 @@ public:
        mutable LyXTabular tabular;
 
 protected:
+       ///
        InsetTabular(InsetTabular const &);
-
+       ///
        virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
-
        ///
        bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
 private:
@@ -191,9 +193,9 @@ private:
        ///
        Buffer const * buffer_;
        ///
-       mutable int cursorx_;
-       ///
        mutable idx_type first_visible_cell;
+       ///
+       mutable int scx_;
 };
 
 
index dbcff754b2484aac3416f76604e8fd1e5bff86d0..62c29c2d8992e9d02a06b2aa3f160273d11b5283 100644 (file)
@@ -86,7 +86,7 @@ InsetText::InsetText(BufferParams const & bp)
 
 
 InsetText::InsetText(InsetText const & in)
-       : UpdatableInset(in), text_(in.text_.bv_owner)
+       : InsetOld(in), text_(in.text_.bv_owner)
 {
        text_.autoBreakRows_ = in.text_.autoBreakRows_;
        drawFrame_ = in.drawFrame_;
@@ -194,7 +194,6 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
        BufferView * bv = pi.base.bv;
        bv->hideCursor();
 
-       x += scroll();
        text_.draw(pi, x + border_, y);
 
        if (drawFrame_)
@@ -299,15 +298,10 @@ InsetBase * InsetText::editXY(LCursor & cur, int x, int y)
 
 void InsetText::doDispatch(LCursor & cur, FuncRequest & cmd)
 {
-       lyxerr[Debug::DEBUG]
-                << BOOST_CURRENT_FUNCTION
-                << " [ cmd.action = " << cmd.action << ']'
-                << endl;
-        
+       lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION
+    << " [ cmd.action = " << cmd.action << ']' << endl;
        setViewCache(&cur.bv());
-
        text_.dispatch(cur, cmd);
-
 }
 
 
index c243b34809494a235b94b7acb1c7195f14ba4f71..1699154fc29171baea42b702c74ebdaeea219652 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef INSETTEXT_H
 #define INSETTEXT_H
 
-#include "updatableinset.h"
+#include "inset.h"
 #include "RowList_fwd.h"
 #include "lyxfont.h"
 #include "lyxtext.h"
@@ -24,9 +24,9 @@
 class Buffer;
 class BufferParams;
 class BufferView;
+class CursorSlice;
 class Dimension;
 class LColor_color;
-class CursorSlice;
 class Painter;
 class ParagraphList;
 class Row;
@@ -36,7 +36,7 @@ class Row;
  A text inset is like a TeX box to write full text
  (including styles and other insets) in a given space.
  */
-class InsetText : public UpdatableInset {
+class InsetText : public InsetOld {
 public:
        ///
        explicit InsetText(BufferParams const &);
@@ -57,6 +57,8 @@ public:
        ///
        std::string const editMessage() const;
        ///
+       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       ///
        bool isTextInset() const { return true; }
        ///
        int latex(Buffer const &, std::ostream &,
diff --git a/src/insets/updatableinset.C b/src/insets/updatableinset.C
deleted file mode 100644 (file)
index 55984a7..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * \file updatableinset.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Alejandro Aguilar Sierra
- * \author Jürgen Vigna
- * \author Lars Gullik Bjønnes
- * \author Matthias Ettrich
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "updatableinset.h"
-
-#include "BufferView.h"
-#include "coordcache.h"
-#include "cursor.h"
-#include "debug.h"
-#include "dispatchresult.h"
-#include "funcrequest.h"
-#include "lyxtext.h"
-
-#include "support/convert.h"
-
-#include <boost/assert.hpp>
-
-
-// An updatable inset is highly editable by definition
-InsetBase::EDITABLE UpdatableInset::editable() const
-{
-       return HIGHLY_EDITABLE;
-}
-
-
-int UpdatableInset::scroll(bool) const
-{
-       return scx;
-}
-
-
-void UpdatableInset::setScroll(int maxwidth, int pos) const
-{
-       scx = pos;
-}
-
-
-void UpdatableInset::getCursorDim(int &, int &) const
-{
-       BOOST_ASSERT(false);
-}
-
diff --git a/src/insets/updatableinset.h b/src/insets/updatableinset.h
deleted file mode 100644 (file)
index 3c29e64..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// -*- C++ -*-
-/**
- * \file updatableinset.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Alejandro Aguilar Sierra
- * \author Jürgen Vigna
- * \author Lars Gullik Bjønnes
- * \author Matthias Ettrich
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef UPDATABLEINSET_H
-#define UPDATABLEINSET_H
-
-//  Updatable Insets. These insets can receive directly user interaction.
-//  Note that all pure methods from Inset class are pure here too.
-//  [Alejandro 080596]
-
-#include "inset.h"
-
-class UpdatableInset : public InsetOld {
-public:
-       ///
-       UpdatableInset() : scx(0) {}
-       ///
-       virtual EDITABLE editable() const;
-       /// identification as text inset in a cursor slice
-       UpdatableInset * asUpdatableInset() { return this; }
-
-       /// return the cursor dim
-       virtual void getCursorDim(int &, int &) const;
-       ///
-       virtual bool showInsetDialog(BufferView *) const { return false; }
-
-protected:
-       /// scrolls offset pixels
-       void setScroll(int maxwidth, int offset) const;
-       /// returns the actual scroll value
-       virtual int scroll(bool recursive = true) const;
-       ///
-       mutable int scx;
-};
-
-#endif
index fc6ef321c0a6ff559f9fa961ac9cfe47da79822f..dd84ab6bd7d395d8e613848d9c73052b57c1f9dd 100644 (file)
@@ -428,12 +428,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                enable = false;
                if (!cur)
                        break;
-               UpdatableInset * inset = cur.inset().asUpdatableInset();
-               lyxerr << "inset: " << inset << endl;
-               if (!inset)
-                       break;
-
-               InsetBase::Code code = inset->lyxCode();
+               InsetBase::Code code = cur.inset().lyxCode();
                switch (code) {
                        case InsetBase::TABULAR_CODE:
                                enable = cmd.argument == "tabular";
index 6a9678a087e0db9c7be1310952c7d2c5bfe7a14c..ead9fd3ea80cb3ae59e45e3873d1a3c4e12e4589 100644 (file)
@@ -1250,14 +1250,6 @@ string const MathHullInset::editMessage() const
 }
 
 
-void MathHullInset::getCursorDim(int & asc, int & desc) const
-{
-       asc = 10;
-       desc = 2;
-       //math_font_max_dim(font_, asc, des);
-}
-
-
 void MathHullInset::revealCodes(LCursor & cur) const
 {
        if (!cur.inMathed())
index 64bd708820babb8b370885938137ed4f37459686..9793d8eaab22fe614a692ba8b5d9aa313e3f9a83 100644 (file)
@@ -184,8 +184,6 @@ public:
        /// what appears in the minibuffer when opening
        virtual std::string const editMessage() const;
        ///
-       virtual void getCursorDim(int &, int &) const;
-       ///
        virtual bool isTextInset() const { return true; }
        ///
        virtual void mutateToText();
index 24942fc32bda23f9d2829a76eda42ab820a30a23..38d5763ec96963d04e6a6e679bae0bf188312899 100644 (file)
@@ -521,7 +521,7 @@ void Paragraph::setFont(pos_type pos, LyXFont const & font)
                if (it->pos() >= pos)
                        break;
        }
-       unsigned int i = distance(beg, it);
+       size_t const i = distance(beg, it);
        bool notfound = (it == endit);
 
        if (!notfound && pimpl_->fontlist[i].font() == font)
@@ -1644,7 +1644,7 @@ string const Paragraph::asString(Buffer const & buffer,
 }
 
 
-void Paragraph::setInsetOwner(UpdatableInset * inset)
+void Paragraph::setInsetOwner(InsetBase * inset)
 {
        pimpl_->inset_owner = inset;
 }
@@ -1742,7 +1742,7 @@ void Paragraph::layout(LyXLayout_ptr const & new_layout)
 }
 
 
-UpdatableInset * Paragraph::inInset() const
+InsetBase * Paragraph::inInset() const
 {
        return pimpl_->inset_owner;
 }
index 7f79546034c6ecd77da70a24e8d42c7f2a623a89..14c9cc156eaecb16d30a4320f999e2faf81c44df 100644 (file)
@@ -47,7 +47,7 @@ class OutputParams;
 class PainterInfo;
 class ParagraphParameters;
 class TexRow;
-class UpdatableInset;
+
 
 /// A Paragraph holds all text, attributes and insets in a text paragraph
 class Paragraph  {
@@ -76,7 +76,6 @@ public:
        Paragraph & operator=(Paragraph const &);
        ///
        ~Paragraph();
-
        ///
        int id() const;
 
@@ -164,9 +163,9 @@ public:
        void makeSameLayout(Paragraph const & par);
 
        ///
-       void setInsetOwner(UpdatableInset * inset);
+       void setInsetOwner(InsetBase * inset);
        ///
-       UpdatableInset * inInset() const;
+       InsetBase * inInset() const;
        ///
        InsetBase::Code ownerCode() const;
        ///
index 35db59cf8d62d5bdf96c1d42e43735247a7bbd1b..5d15a82ec383bfed6e72d35378fb997ff1508bfa 100644 (file)
@@ -78,7 +78,7 @@ public:
        /// erase the given range
        int erase(lyx::pos_type start, lyx::pos_type end);
        ///
-       UpdatableInset * inset_owner;
+       InsetBase * inset_owner;
 
        /** A font entry covers a range of positions. Notice that the
            entries in the list are inserted in random order.
index 475712a46bb977fc0bf7b9ca9bcfd12386619d17..43a61df8961a8a4845c18ed897b8c93360e1129a 100644 (file)
@@ -727,8 +727,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_INSET_SETTINGS:
-               if (cur.inset().asUpdatableInset())
-                       cur.inset().asUpdatableInset()->showInsetDialog(bv);
+               cur.inset().showInsetDialog(bv);
                break;
 
        case LFUN_NEXT_INSET_TOGGLE: {
index cecca1c39ec84526172f68de671477c022133889..1a854a192c23af5f132b204203b62139aeebb4b6 100644 (file)
@@ -24,7 +24,7 @@
 #include "paragraph.h"
 
 #include "mathed/math_support.h"
-#include "insets/updatableinset.h"
+#include "insets/inset.h"
 
 #include <algorithm>
 
@@ -182,8 +182,7 @@ bool textUndoOrRedo(BufferView & bv,
                ParagraphList::const_iterator pit = undo.pars.begin();
                ParagraphList::const_iterator end = undo.pars.end();
                for (; pit != end; ++pit)
-                       const_cast<Paragraph &>(*pit).setInsetOwner(
-                               dynamic_cast<UpdatableInset *>(&dit.inset()));
+                       const_cast<Paragraph &>(*pit).setInsetOwner(&dit.inset());
                plist.insert(first, undo.pars.begin(), undo.pars.end());
        }