]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.h
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insettext.h
index 1434f06b5c0774581b8db117977df10f42f12078..d88a94a8442c9da83726929fa39594f025efc99b 100644 (file)
@@ -76,7 +76,7 @@ public:
        ///
        explicit InsetText(InsetText const &);
        ///
-       InsetBase * clone() const;
+       virtual std::auto_ptr<InsetBase> clone() const;
        ///
        InsetText & operator=(InsetText const & it);
        /// empty inset to empty par, or just mark as erased
@@ -88,13 +88,11 @@ public:
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
-       int textWidth(BufferView *, bool fordraw = false) const;
+       int textWidth() const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       void update(BufferView *, bool = false);
-       ///
-       void setUpdateStatus(BufferView *, int what) const;
+       void setUpdateStatus(int what) const;
        ///
        string const editMessage() const;
        ///
@@ -107,7 +105,7 @@ public:
        bool unlockInsetInInset(BufferView *,
                                UpdatableInset *, bool lr = false);
        ///
-       bool updateInsetInInset(BufferView *, Inset *);
+       bool updateInsetInInset(BufferView *, InsetOld *);
        ///
        RESULT localDispatch(FuncRequest const &);
        ///
@@ -116,13 +114,13 @@ public:
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
-       int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
+       int linuxdoc(Buffer const *, std::ostream &) const ;
        ///
        int docbook(Buffer const *, std::ostream &, bool mixcont) const ;
        ///
        void validate(LaTeXFeatures & features) const;
        ///
-       Inset::Code lyxCode() const { return Inset::TEXT_CODE; }
+       InsetOld::Code lyxCode() const { return InsetOld::TEXT_CODE; }
        /// FIXME, document
        void getCursorPos(BufferView *, int & x, int & y) const;
        /// Get the absolute document x,y of the cursor
@@ -132,20 +130,18 @@ public:
        ///
        void fitInsetCursor(BufferView *) const;
        ///
-       bool insertInset(BufferView *, Inset *);
+       bool insertInset(BufferView *, InsetOld *);
        ///
-       bool insetAllowed(Inset::Code) const;
+       bool insetAllowed(InsetOld::Code) const;
        ///
        UpdatableInset * getLockingInset() const;
        ///
-       UpdatableInset * getFirstLockingInsetOfType(Inset::Code);
+       UpdatableInset * getFirstLockingInsetOfType(InsetOld::Code);
        ///
        void setFont(BufferView *, LyXFont const &,
                     bool toggleall = false,
                     bool selectall = false);
        ///
-       int getMaxWidth(BufferView *, UpdatableInset const *) const;
-       ///
        void init(InsetText const * ins);
        ///
        void writeParagraphData(Buffer const *, std::ostream &) const;
@@ -187,11 +183,9 @@ public:
                UpdatableInset::scroll(bv, offset);
        }
        ///
-       void selectAll(BufferView * bv);
-       ///
        void clearSelection(BufferView * bv);
        ///
-       Inset * getInsetFromID(int id) const;
+       InsetOld * getInsetFromID(int id) const;
        ///
        ParagraphList * getParagraphs(int) const;
        ///
@@ -302,29 +296,29 @@ private:
        ///
        void removeNewlines();
        ///
-       int cx(BufferView *) const;
+       int cx() const;
        ///
-       int cix(BufferView *) const;
+       int cix() const;
        ///
-       int cy(BufferView *) const;
+       int cy() const;
        ///
-       int ciy(BufferView *) const;
+       int ciy() const;
        ///
-       lyx::pos_type cpos(BufferView *) const;
+       lyx::pos_type cpos() const;
        ///
-       ParagraphList::iterator cpar(BufferView *) const;
+       ParagraphList::iterator cpar() const;
        ///
-       bool cboundary(BufferView *) const;
+       bool cboundary() const;
        ///
-       RowList::iterator crow(BufferView *) const;
+       RowList::iterator crow() const;
        ///
        void drawFrame(Painter &, int x) const;
        ///
        void clearInset(BufferView *, int start_x, int baseline) const;
        ///
-       void saveLyXTextState(LyXText *) const;
+       void saveLyXTextState() const;
        ///
-       void restoreLyXTextState(LyXText *) const;
+       void restoreLyXTextState() const;
        ///
        void collapseParagraphs(BufferView *);
 
@@ -332,8 +326,6 @@ private:
        ///
        mutable bool locked;
        ///
-       mutable Dimension dim_;
-       ///
        mutable int top_y;
        ///
        ParagraphList::iterator inset_par;
@@ -346,8 +338,6 @@ private:
        ///
        mutable int inset_y;
        ///
-       mutable int old_max_width;
-       ///
        bool no_selection;
        ///
        UpdatableInset * the_locking_inset;
@@ -366,8 +356,6 @@ private:
        mutable int frame_y;
        mutable int frame_w;
        mutable int frame_h;
-       ///
-       bool in_update; /* as update is not reentrant! */
        mutable bool in_insetAllowed;
        ///
        // these are used to check for mouse movement in Motion selection code
@@ -379,5 +367,7 @@ public:
        void reinitLyXText() const;
        ///
        mutable LyXText text_;
+       ///
+       mutable int textwidth_;
 };
 #endif