]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_scriptinset.h
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / math_scriptinset.h
index 13b95c10438a1260e259586fc98ca958365b73cb..52beb7073f06b2418328cea41ac31fefcea20519 100644 (file)
@@ -28,7 +28,7 @@ public:
        /// create inset with single script and given nucleus
        MathScriptInset(MathAtom const & at, bool up);
        ///
-       std::auto_ptr<InsetBase> clone() const;
+       mode_type currentMode() const { return MATH_MODE; }
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
@@ -71,13 +71,13 @@ public:
        void limits(int lim) { limits_ = lim; }
        /// get limits
        int limits() const { return limits_; }
-       /// returns subscript
+       /// returns subscript. Always run 'hasDown' or 'has(false)' before!
        MathArray const & down() const;
-       /// returns subscript
+       /// returns subscript. Always run 'hasDown' or 'has(false)' before!
        MathArray & down();
-       /// returns superscript
+       /// returns superscript. Always run 'hasUp' or 'has(true)' before!
        MathArray const & up() const;
-       /// returns superscript
+       /// returns superscript. Always run 'hasUp' or 'has(true)' before!
        MathArray & up();
        /// returns nucleus
        MathArray const & nuc() const;
@@ -100,9 +100,9 @@ public:
        /// say whether we have displayed limits
        void infoize2(std::ostream & os) const;
 protected:
-       ///
-       void priv_dispatch(LCursor & cur, FuncRequest & cmd);
+       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
 private:
+       virtual std::auto_ptr<InsetBase> doClone() const;
        /// returns x offset for main part
        int dxx() const;
        /// returns width of nucleus if any
@@ -122,7 +122,7 @@ private:
        /// where do we have to draw the scripts?
        bool hasLimits() const;
        /// clean up empty cells
-       void notifyCursorLeaves(idx_type idx);
+       void notifyCursorLeaves(LCursor & cur);
 
        /// possible subscript (index 0) and superscript (index 1)
        bool cell_1_is_up_;