]> git.lyx.org Git - lyx.git/commitdiff
IU of clone() and getLabelList()
authorAndré Pönitz <poenitz@gmx.net>
Mon, 16 Jun 2003 11:49:38 +0000 (11:49 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 16 Jun 2003 11:49:38 +0000 (11:49 +0000)
Some mathed internal renamings to prepare further IU

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7173 a592a061-630c-0410-9148-cb99ea01b6c8

184 files changed:
src/BufferView.C
src/ChangeLog
src/buffer.C
src/buffer.h
src/frontends/controllers/ControlRef.C
src/insets/ChangeLog
src/insets/inset.h
src/insets/insetbase.h
src/insets/insetbibitem.C
src/insets/insetbibitem.h
src/insets/insetbibtex.h
src/insets/insetcite.h
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insetenv.C
src/insets/insetenv.h
src/insets/inseterror.h
src/insets/insetert.C
src/insets/insetert.h
src/insets/insetexternal.C
src/insets/insetexternal.h
src/insets/insetfloat.C
src/insets/insetfloat.h
src/insets/insetfloatlist.h
src/insets/insetfoot.C
src/insets/insetfoot.h
src/insets/insetgraphics.C
src/insets/insetgraphics.h
src/insets/insethfill.h
src/insets/insetinclude.C
src/insets/insetinclude.h
src/insets/insetindex.h
src/insets/insetlabel.C
src/insets/insetlabel.h
src/insets/insetlatexaccent.C
src/insets/insetlatexaccent.h
src/insets/insetmarginal.C
src/insets/insetmarginal.h
src/insets/insetminipage.C
src/insets/insetminipage.h
src/insets/insetnewline.h
src/insets/insetnote.C
src/insets/insetnote.h
src/insets/insetoptarg.C
src/insets/insetoptarg.h
src/insets/insetquotes.C
src/insets/insetquotes.h
src/insets/insetref.h
src/insets/insetspace.C
src/insets/insetspace.h
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/insettheorem.C
src/insets/insettheorem.h
src/insets/insettoc.h
src/insets/inseturl.h
src/insets/insetwrap.C
src/insets/insetwrap.h
src/mathed/ChangeLog
src/mathed/command_inset.C
src/mathed/command_inset.h
src/mathed/formulabase.C
src/mathed/math_amsarrayinset.C
src/mathed/math_amsarrayinset.h
src/mathed/math_arrayinset.C
src/mathed/math_arrayinset.h
src/mathed/math_atom.C
src/mathed/math_atom.h
src/mathed/math_biginset.C
src/mathed/math_biginset.h
src/mathed/math_binaryopinset.C
src/mathed/math_binaryopinset.h
src/mathed/math_binominset.C
src/mathed/math_binominset.h
src/mathed/math_boxinset.C
src/mathed/math_boxinset.h
src/mathed/math_braceinset.C
src/mathed/math_braceinset.h
src/mathed/math_casesinset.C
src/mathed/math_casesinset.h
src/mathed/math_charinset.C
src/mathed/math_charinset.h
src/mathed/math_commentinset.C
src/mathed/math_commentinset.h
src/mathed/math_cursor.C
src/mathed/math_cursor.h
src/mathed/math_decorationinset.C
src/mathed/math_decorationinset.h
src/mathed/math_deliminset.C
src/mathed/math_deliminset.h
src/mathed/math_diffinset.C
src/mathed/math_diffinset.h
src/mathed/math_dotsinset.C
src/mathed/math_dotsinset.h
src/mathed/math_envinset.C
src/mathed/math_envinset.h
src/mathed/math_ertinset.C
src/mathed/math_ertinset.h
src/mathed/math_exfuncinset.C
src/mathed/math_exfuncinset.h
src/mathed/math_exintinset.C
src/mathed/math_exintinset.h
src/mathed/math_fboxinset.C
src/mathed/math_fboxinset.h
src/mathed/math_fontinset.C
src/mathed/math_fontinset.h
src/mathed/math_fontoldinset.C
src/mathed/math_fontoldinset.h
src/mathed/math_fracinset.C
src/mathed/math_fracinset.h
src/mathed/math_frameboxinset.C
src/mathed/math_frameboxinset.h
src/mathed/math_gridinset.C
src/mathed/math_gridinset.h
src/mathed/math_hullinset.C
src/mathed/math_hullinset.h
src/mathed/math_inferinset.C
src/mathed/math_inferinset.h
src/mathed/math_inset.h
src/mathed/math_iterator.C
src/mathed/math_iterator.h
src/mathed/math_kerninset.C
src/mathed/math_kerninset.h
src/mathed/math_lefteqninset.C
src/mathed/math_lefteqninset.h
src/mathed/math_liminset.C
src/mathed/math_liminset.h
src/mathed/math_macro.C
src/mathed/math_macro.h
src/mathed/math_macroarg.C
src/mathed/math_macroarg.h
src/mathed/math_macrotemplate.C
src/mathed/math_macrotemplate.h
src/mathed/math_makeboxinset.C
src/mathed/math_makeboxinset.h
src/mathed/math_matrixinset.C
src/mathed/math_matrixinset.h
src/mathed/math_numberinset.C
src/mathed/math_numberinset.h
src/mathed/math_parboxinset.C
src/mathed/math_parboxinset.h
src/mathed/math_pos.C
src/mathed/math_pos.h
src/mathed/math_rootinset.C
src/mathed/math_rootinset.h
src/mathed/math_scriptinset.C
src/mathed/math_scriptinset.h
src/mathed/math_sizeinset.C
src/mathed/math_sizeinset.h
src/mathed/math_spaceinset.C
src/mathed/math_spaceinset.h
src/mathed/math_splitinset.C
src/mathed/math_splitinset.h
src/mathed/math_sqrtinset.C
src/mathed/math_sqrtinset.h
src/mathed/math_stackrelinset.C
src/mathed/math_stackrelinset.h
src/mathed/math_stringinset.C
src/mathed/math_stringinset.h
src/mathed/math_substackinset.C
src/mathed/math_substackinset.h
src/mathed/math_symbolinset.C
src/mathed/math_symbolinset.h
src/mathed/math_tabularinset.C
src/mathed/math_tabularinset.h
src/mathed/math_textinset.C
src/mathed/math_textinset.h
src/mathed/math_undersetinset.C
src/mathed/math_undersetinset.h
src/mathed/math_unknowninset.C
src/mathed/math_unknowninset.h
src/mathed/math_xarrowinset.C
src/mathed/math_xarrowinset.h
src/mathed/math_xyarrowinset.C
src/mathed/math_xyarrowinset.h
src/mathed/ref_inset.C
src/mathed/ref_inset.h
src/paragraph.C
src/tabular.C
src/tabular.h

index 016f495ae5a0b0e407ede88cf688de8bfe76f36a..7b8a4cfa33a8e5cacf7ba0301b4e22ff404566e7 100644 (file)
@@ -395,7 +395,8 @@ void BufferView::gotoLabel(string const & label)
 {
        for (Buffer::inset_iterator it = buffer()->inset_iterator_begin();
             it != buffer()->inset_iterator_end(); ++it) {
-               vector<string> labels = it->getLabelList();
+               vector<string> labels;
+               it->getLabelList(labels);
                if (find(labels.begin(),labels.end(),label)
                     != labels.end()) {
                        beforeChange(text);
@@ -660,7 +661,8 @@ bool BufferView::ChangeInsets(Inset::Code code,
 bool BufferView::ChangeRefsIfUnique(string const & from, string const & to)
 {
        // Check if the label 'from' appears more than once
-       vector<string> labels = buffer()->getLabelList();
+       vector<string> labels;
+       buffer()->getLabelList(labels);
 
        if (lyx::count(labels.begin(), labels.end(), from) > 1)
                return false;
index cff5d2016392e6d5cf6bbe9d63559ccd0dc71068..fb04b213caa56a388bdb9b7dc66f47c5e511b355 100644 (file)
@@ -1,3 +1,11 @@
+2003-06-16  André Pönitz  <poenitz@gmx.net>
+
+       * BufferView.C:
+       * buffer.C:
+       * buffer.h:
+       * paragraph.C:
+       * tabular.[Ch]: IU of clone() and getLabelList();
+
 2003-06-13  André Pönitz  <poenitz@gmx.net>
 
        * tabular.h: compactification
index 24b8d16677e2a15ee08b6e7f7e81d1e7692eb551..04e7e1ef14b42603a3208eaa173a8147cbec7a6e 100644 (file)
@@ -2012,24 +2012,23 @@ void Buffer::validate(LaTeXFeatures & features) const
 }
 
 
-vector<string> const Buffer::getLabelList() const
+void Buffer::getLabelList(std::vector<string> & list) const
 {
        /// if this is a child document and the parent is already loaded
        /// Use the parent's list instead  [ale990407]
        if (!params.parentname.empty()
            && bufferlist.exists(params.parentname)) {
                Buffer const * tmp = bufferlist.getBuffer(params.parentname);
-               if (tmp)
-                       return tmp->getLabelList();
+               if (tmp) {
+                       tmp->getLabelList(list);
+                       return;
+               }
        }
 
-       vector<string> label_list;
        for (inset_iterator it = inset_const_iterator_begin();
             it != inset_const_iterator_end(); ++it) {
-               vector<string> const l = it->getLabelList();
-               label_list.insert(label_list.end(), l.begin(), l.end());
+               it->getLabelList(list);
        }
-       return label_list;
 }
 
 
index d5e1f08b365c382a6ed8d2e7547af0c14b8a59f3..06e26a6919048a042d7cf3cbf0d4fbbff6b07060 100644 (file)
@@ -256,7 +256,7 @@ public:
        /// return all bibkeys from buffer and its childs
        void fillWithBibKeys(std::vector<std::pair<string, string> > & keys) const;
        ///
-       std::vector<string> const getLabelList() const;
+       void getLabelList(std::vector<string> &) const;
 
        /** This will clearly have to change later. Later we can have more
            than one user per buffer. */
index b311e90624a3fcbcf7a941a21c96a0e6081057f8..c47722477ae19fd8db7df4b9eb7c5c8449492399 100644 (file)
@@ -34,7 +34,9 @@ vector<string> const ControlRef::getLabelList(string const & name) const
        Buffer const * buf = bufferlist.getBuffer(MakeAbsPath(name));
        if (!buf)
                buf = kernel().buffer();
-       return buf->getLabelList();
+       vector<string> list;
+       buf->getLabelList(list);
+       return list;
 }
 
 
index f1da486e3205b53dd0eb05313e413cb3e62cde3f..9cc27c1b7b794c89ab44d43ebe704fe04c8ab91d 100644 (file)
@@ -1,4 +1,11 @@
 
+2003-06-16  André Pönitz  <poenitz@gmx.net>
+
+       * insetbase.h: new virtual base function clone()
+
+       * *inset*.[Ch]: IU of clone() and getLabelList (i.e. essentially
+         Inset * clone()  ->  InsetBase * clone()
+
 2003-06-13  André Pönitz  <poenitz@gmx.net>
 
        * insettabular.[Ch]: make tabular a proper member
index 29b18c534b0a147aad3009da489eebc0300ec045..ff45c5eced180452ca01d5a30a2501cbff7bdb80 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef INSET_H
 #define INSET_H
 
-#include "LString.h"
 #include "LColor.h"
 #include "insetbase.h"
 #include "support/types.h"
@@ -194,13 +193,6 @@ public:
        /// returns LyX code associated with the inset. Used for TOC, ...)
        virtual Inset::Code lyxCode() const { return NO_CODE; }
 
-       virtual std::vector<string> const getLabelList() const {
-               return std::vector<string>();
-       }
-
-       ///
-       virtual Inset * clone() const = 0;
-
        /// returns true to override begin and end inset in file
        virtual bool directWrite() const;
 
index 51ba1a981a674fb68b9c1c8360d600079b1401d3..d52f770e15455c1f15070419c5636f85f65808fc 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef INSETBASE_H
 #define INSETBASE_H
 
+#include "LString.h"
+
 #include <vector>
 
 class BufferView;
@@ -64,6 +66,11 @@ public:
        /// type for column numbers
        typedef size_t  col_type;
 
+       /// virtual base class destructor
+       virtual ~InsetBase() {}
+       /// replicate ourselves
+       virtual InsetBase * clone() const = 0;
+
        // the real dispatcher
        virtual dispatch_result dispatch
                (FuncRequest const & cmd, idx_type & idx, pos_type & pos);
@@ -75,15 +82,14 @@ public:
        /// draw inset and update (xo, yo)-cache
        virtual void draw(PainterInfo & pi, int x, int y) const = 0;
 
-       ///
-       virtual ~InsetBase() {}
-
        /// Methods to cache and retrieve a cached BufferView.
        virtual void cache(BufferView *) const {}
        ///
        virtual BufferView * view() const { return 0; }
        /// request "external features"
        virtual void validate(LaTeXFeatures &) const {}
+       /// fill in all labels in the inset
+       virtual void getLabelList(std::vector<string> &) const {}
 };
 
 #endif
index 24da31f2d5b28a2ccf5324059a43fb22f8524736..17fcbc7eddf6a8f40561e13cd89dd9f063f3d106 100644 (file)
@@ -43,7 +43,7 @@ InsetBibitem::~InsetBibitem()
 }
 
 
-Inset * InsetBibitem::clone() const
+InsetBase * InsetBibitem::clone() const
 {
        InsetBibitem * b = new InsetBibitem(params());
        b->setCounter(counter);
index 03a6406883a9d18ce3e8b0557eb7bbd105212df5..7dd1a172df2102b4d0abfbcdfa586fa1e5dc2001 100644 (file)
@@ -29,7 +29,7 @@ public:
        ///
        ~InsetBibitem();
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        virtual dispatch_result localDispatch(FuncRequest const & cmd);
        /** Currently \bibitem is used as a LyX2.x command,
index e618f43b4a4be22486afd6bd2f1fb310134f37e2..f7827f668835d15096dbdbb4eb4138495bd96ce7 100644 (file)
@@ -27,7 +27,7 @@ public:
        ///
        ~InsetBibtex();
        ///
-       Inset * clone() const {
+       InsetBase * clone() const {
                return new InsetBibtex(params());
        }
        /// small wrapper for the time being
index 5618e282b91793060b939501fbda2572e2197355..0e58a66267ac28774d5316e5243db17e186910b3 100644 (file)
@@ -25,7 +25,7 @@ public:
        ///
        ~InsetCitation();
        ///
-       Inset * clone() const {
+       InsetBase * clone() const {
                return new InsetCitation(params());
        }
        ///
index facf2f5f362fd3f6cfcfd26aa19105deab1eaa21..9b1d4235d5d412b918be11c8f80b2a7d0bd4609c 100644 (file)
@@ -481,9 +481,9 @@ void InsetCollapsable::resizeLyXText(BufferView * bv, bool force) const
 }
 
 
-vector<string> const InsetCollapsable::getLabelList() const
+void InsetCollapsable::getLabelList(std::vector<string> & list) const
 {
-       return inset.getLabelList();
+       inset.getLabelList(list);
 }
 
 
index f6b8c70cd3a5f8642dbf1c823936e64c9bc1e8f7..02c261e13a8dc968311d23924b69e6fc1e593744 100644 (file)
@@ -117,7 +117,7 @@ public:
        ///
        void resizeLyXText(BufferView *, bool force = false) const;
        ///
-       std::vector<string> const getLabelList() const;
+       void getLabelList(std::vector<string> &) const;
        ///
        bool nodraw() const;
        ///
index 1158b1a1d0edb1975fc1dd7749ff25b4c2633b3c..9b9dc1f62560b1261a0082666d8aab3d067c70e4 100644 (file)
@@ -40,7 +40,7 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
 {}
 
 
-Inset * InsetEnvironment::clone() const
+InsetBase * InsetEnvironment::clone() const
 {
        return new InsetEnvironment(*this);
 }
index 248f92107e21f258123a42f1308a623bd231cca2..83fd5faf544920fbc229a45c9ed632cb9f7c0a77 100644 (file)
@@ -26,7 +26,7 @@ public:
        ///
        void read(Buffer const * buf, LyXLex & lex);
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; }
        ///
index bbc787631d985bbe84c5281ef77151e57548cf43..8799c8b20846e66cb611bcb43cec0a7b710c491b 100644 (file)
@@ -54,7 +54,7 @@ public:
        ///
        EDITABLE editable() const { return IS_EDITABLE; }
        ///
-       Inset * clone() const {
+       InsetBase * clone() const {
                return new InsetError(contents);
        }
        ///
index 4a6888091f1e5aca24a0a23463045ef511755fdb..842ba5df07a795d0219da39039452c1dbf032516 100644 (file)
@@ -70,7 +70,7 @@ InsetERT::InsetERT(InsetERT const & in)
 }
 
 
-Inset * InsetERT::clone() const
+InsetBase * InsetERT::clone() const
 {
        return new InsetERT(*this);
 }
index 7d793bd95e27a2a0f8ababaf8ec5bc0371400491..86811b6ac35a578839ea69a83fe3f98da6512a6a 100644 (file)
@@ -40,7 +40,7 @@ public:
        ///
        InsetERT(InsetERT const &);
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        InsetERT(BufferParams const &,
                 Language const *, string const & contents, bool collapsed);
index 749860818fc626702b3e4a420904b2a0dbd0e2c0..7bd70495750288936a99b447316ffe6cb5b6a255 100644 (file)
@@ -99,7 +99,7 @@ InsetExternal::InsetExternal(InsetExternal const & other)
 }
 
 
-Inset * InsetExternal::clone() const
+InsetBase * InsetExternal::clone() const
 {
        InsetExternal * inset = new InsetExternal(*this);
        return inset;
index a3f3f38ce8e44df9f9349b1c77b6d47488ce0e8b..c23267fa589f3d17b159bf2193ef87d87acc9f44 100644 (file)
@@ -83,7 +83,7 @@ public:
        virtual Inset::Code lyxCode() const { return EXTERNAL_CODE; }
 
        ///
-       virtual Inset * clone() const;
+       virtual InsetBase * clone() const;
 
        /// Set the inset parameters.
        virtual void setParams(Params const &, string const & filepath);
index e4b7c9944f82b8fa77d55836bd8b13af1567e321..cb84cd73863ca140e45accdfdb4f3f00c3954659 100644 (file)
@@ -259,7 +259,7 @@ void InsetFloat::validate(LaTeXFeatures & features) const
 }
 
 
-Inset * InsetFloat::clone() const
+InsetBase * InsetFloat::clone() const
 {
        return new InsetFloat(*this);
 }
index 2b83382bc3317e6f3136dbbc3c2ac9298c4ef361..552dca6d7dbf44009c0c512707ad6aa63d45f2b0 100644 (file)
@@ -53,7 +53,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
        ///
index ab0177cc43c274867563e4a533e7105ce03df500..61d2ac0d1c3a6b8ca61ecdb43927f5c6d35ffc6a 100644 (file)
@@ -26,7 +26,7 @@ public:
        ///
        ~InsetFloatList();
        ///
-       Inset * clone() const {
+       InsetBase * clone() const {
                return new InsetFloatList(getCmdName());
        }
        ///
index e53a1db8769033fc5c4a03e1ef0898fdbf0b4c56..4d0094d49eefeba0e2a7512c1020ab002aa84409 100644 (file)
@@ -46,7 +46,7 @@ InsetFoot::InsetFoot(InsetFoot const & in)
 }
 
 
-Inset * InsetFoot::clone() const
+InsetBase * InsetFoot::clone() const
 {
        return new InsetFoot(*this);
 }
index b154412b4e27cb88cfd8d471032310dfc4b356bf..3e47b9682d8dc03b1d01ca53a84e69d49414b28a 100644 (file)
@@ -27,7 +27,7 @@ public:
        ///
        InsetFoot(InsetFoot const &);
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
        ///
index 782b954033aed0a16c9bd0b28c11a6ab36996587..23bc48e92e5e5e7e50e87da6f9723c6af16a76d5 100644 (file)
@@ -151,7 +151,7 @@ InsetGraphics::InsetGraphics(InsetGraphics const & ig)
 }
 
 
-Inset * InsetGraphics::clone() const
+InsetBase * InsetGraphics::clone() const
 {
        return new InsetGraphics(*this);
 }
index 4e1e59b88e6c20a7954254284d583ac2e89c0c6b..c90733520eb7e01f854424e6f3787e04d9b375d6 100644 (file)
@@ -68,7 +68,7 @@ public:
        Inset::Code lyxCode() const { return Inset::GRAPHICS_CODE; }
 
        ///
-       virtual Inset * clone() const;
+       virtual InsetBase * clone() const;
 
        /** Set the inset parameters, used by the GUIndependent dialog.
            Return true of new params are different from what was so far.
index 93974e6b5083cedeb5cae2b47823f6fc1c76f0ca..023d7cc0c735aeaef1462a3c27c0902b249f2063 100644 (file)
@@ -20,7 +20,7 @@ public:
        ///
        InsetHFill();
        ///
-       virtual Inset * clone() const {
+       virtual InsetBase * clone() const {
                return new InsetHFill;
        }
        ///
index 57c7db620484c9f557e3361261080360720f0c5c..4a1a773adeca30ea747aeb81a6bd03aabe681abc 100644 (file)
@@ -203,7 +203,7 @@ void InsetInclude::set(Params const & p)
 }
 
 
-Inset * InsetInclude::clone() const
+InsetBase * InsetInclude::clone() const
 {
        //Params p(params_);
        //p.masterFilename_ = buffer.fileName();
@@ -489,18 +489,14 @@ void InsetInclude::validate(LaTeXFeatures & features) const
 }
 
 
-vector<string> const InsetInclude::getLabelList() const
+void InsetInclude::getLabelList(std::vector<string> & list) const
 {
-       vector<string> l;
-
        if (loadIfNeeded()) {
                Buffer * tmp = bufferlist.getBuffer(getFileName());
                tmp->setParentName("");
-               l = tmp->getLabelList();
+               tmp->getLabelList(list);
                tmp->setParentName(getMasterFilename());
        }
-
-       return l;
 }
 
 
index 47d767e5f39b45a4919a8685c7b39845f29c6516..a4b4c83e8911cd2aa1d3bc91ea02996790100241 100644 (file)
@@ -74,11 +74,11 @@ public:
        void set(Params const & params);
 
        ///
-       virtual Inset * clone() const;
+       virtual InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; }
        /// This returns the list of labels on the child buffer
-       std::vector<string> const getLabelList() const;
+       void getLabelList(std::vector<string> &) const;
        /// This returns the list of bibkeys on the child buffer
        void fillWithBibKeys(std::vector<std::pair<string,string> > & keys) const;
        ///
index e3b4caa7fbf89e5703ba13c3b1b468513ab3585f..5ead498423faf49c68350ffe3021acc097b93a39 100644 (file)
@@ -26,7 +26,7 @@ public:
        ///
        ~InsetIndex();
        ///
-       virtual Inset * clone() const {
+       virtual InsetBase * clone() const {
                return new InsetIndex(params());
        }
        ///
@@ -49,7 +49,7 @@ public:
        ///
        ~InsetPrintIndex();
        ///
-       Inset * clone() const {
+       InsetBase * clone() const {
                return new InsetPrintIndex(params());
        }
        ///
index fcab20f0258f40be57694eea103113bed21d03ab..5f11669a593ed2034f2e7fbc278585b16568b0c1 100644 (file)
@@ -39,14 +39,13 @@ InsetLabel::InsetLabel(InsetCommandParams const & p)
 
 InsetLabel::~InsetLabel()
 {
-       InsetCommandMailer mailer("label", *this);
-       mailer.hideDialog();
+       InsetCommandMailer("label", *this).hideDialog();
 }
 
 
-vector<string> const InsetLabel::getLabelList() const
+void InsetLabel::getLabelList(std::vector<string> & list) const
 {
-       return vector<string>(1, getContents());
+       list.push_back(getContents());
 }
 
 
index 10013a0da60eb3706138c7410f3e79025f530222..bfea5b611f46dd7aaff96217e370653b451d968d 100644 (file)
@@ -22,7 +22,7 @@ public:
        ///
        ~InsetLabel();
        ///
-       virtual Inset * clone() const {
+       virtual InsetBase * clone() const {
                return new InsetLabel(params());
        }
        ///
@@ -34,7 +34,7 @@ public:
        ///
        Inset::Code lyxCode() const { return Inset::LABEL_CODE; }
        ///
-       std::vector<string> const getLabelList() const;
+       void getLabelList(std::vector<string> &) const;
        ///
        int latex(Buffer const *, std::ostream &,
                  LatexRunParams const &) const;
index 62af3e8be67e55b7f8049c196e465ab9068cb6b4..ef1f473f52d8bbf968ac1c187e00e5965f5b15ee 100644 (file)
@@ -647,7 +647,7 @@ bool InsetLatexAccent::directWrite() const
 }
 
 
-Inset * InsetLatexAccent::clone() const
+InsetBase * InsetLatexAccent::clone() const
 {
        return new InsetLatexAccent(contents);
 }
index 707b0853f5446f9689ede2c3285bf8e0b96ec477..2aaab8dbb9979364abb5a2d887a45446941642e6 100644 (file)
@@ -57,7 +57,7 @@ public:
        ///
        bool directWrite() const;
        ///
-       virtual Inset * clone() const;
+       virtual InsetBase * clone() const;
        ///
        Inset::Code lyxCode()const;
        ///
index b5d140741af1abf2b6bfd7af04ee775abfd21045..f5c62a92dcb5857776de623c155640147c3197a7 100644 (file)
@@ -41,7 +41,7 @@ InsetMarginal::InsetMarginal(InsetMarginal const & in)
 }
 
 
-Inset * InsetMarginal::clone() const
+InsetBase * InsetMarginal::clone() const
 {
        return new InsetMarginal(*this);
 }
index 8414bdc2a4771434daaef0f130e4281b124d30c4..8a934f820a49300e8b500144fdc726f97f663a62 100644 (file)
@@ -26,7 +26,7 @@ public:
        ///
        InsetMarginal(InsetMarginal const &);
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::MARGIN_CODE; }
        ///
index f7cd3b4e7b3c30a45212dcd35158244ebfae049d..a346f5f60d28f7fedb81f9111f9edb9d5f61725f 100644 (file)
@@ -93,7 +93,7 @@ InsetMinipage::InsetMinipage(InsetMinipage const & in)
 {}
 
 
-Inset * InsetMinipage::clone() const
+InsetBase * InsetMinipage::clone() const
 {
        return new InsetMinipage(*this);
 }
index 9ba55571e516af1458b0278936bd3d5f13d04fd6..b4665cc3dc3835e2bed1fe0a6a052c59fc52f1ae 100644 (file)
@@ -66,7 +66,7 @@ public:
        ///
        void read(Buffer const * buf, LyXLex & lex);
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
index 01597abf6d6445c5412b2fcd161936db43f5355b..b1cb532a87aa159ac0aa8f8a150a02ad29e12461 100644 (file)
@@ -20,7 +20,7 @@ public:
 
        InsetNewline() {}
 
-       virtual Inset * clone() const {
+       virtual InsetBase * clone() const {
                return new InsetNewline;
        }
 
index 0fb0fb64709ff8fd868fdf1e596e25e46ecde18a..07c78db449d07d8d091d8a76bf613842034ca18e 100644 (file)
@@ -53,7 +53,7 @@ InsetNote::InsetNote(InsetNote const & in)
 }
 
 
-Inset * InsetNote::clone() const
+InsetBase * InsetNote::clone() const
 {
        return new InsetNote(*this);
 }
index e6bf5f4dff83ec2385bc94b5753021f0a1b70db3..13b5fca6f2732f9691028fa802024eef60235a98 100644 (file)
@@ -25,7 +25,7 @@ public:
        ///
        InsetNote(InsetNote const &);
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        string const editMessage() const;
        ///
index eb3268b89f0953980719a47cead4c938f4e6696e..dac9f4fb592c6db297e3973c2a96cd3d5774dc0b 100644 (file)
@@ -47,7 +47,7 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in)
 }
 
 
-Inset * InsetOptArg::clone() const
+InsetBase * InsetOptArg::clone() const
 {
        return new InsetOptArg(*this);
 }
index 4c3fec130615e77d727b1300a6d1301c646d315b..ef43a8e2d926ab61fd33df01a6c10a4db8e4f15e 100644 (file)
@@ -27,7 +27,7 @@ public:
 
        InsetOptArg(InsetOptArg const &);
        /// make a duplicate of this inset
-       Inset * clone() const;
+       InsetBase * clone() const;
        /// this inset is editable
        EDITABLE editable() const { return IS_EDITABLE; }
        /// code of the inset
index 3d7d57b42c54e4c6646db4de87e1238a031f1d66..22eafe7cb0aa51601210322f57d220e9ec20ee8e 100644 (file)
@@ -351,7 +351,7 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
 }
 
 
-Inset * InsetQuotes::clone() const
+InsetBase * InsetQuotes::clone() const
 {
        return new InsetQuotes(language_, side_, times_);
 }
index b0cb73ca94dde3616bf6487eb814e96aa7b8d7d6..d9c7379879075e73c5096fad1223f620fadbf224 100644 (file)
@@ -68,7 +68,7 @@ public:
        /// Create the right quote inset after character c
        InsetQuotes(char c, BufferParams const & params);
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
index 41ac981dadebadf8119642a1006a785d71019ecd..c17df7b8464121026e26737bf05e745a30cae502 100644 (file)
@@ -42,7 +42,7 @@ public:
 
        ~InsetRef();
        ///
-       virtual Inset * clone() const {
+       virtual InsetBase * clone() const {
                return new InsetRef(*this);
        }
        ///
index ced4160a901102d9a55a7ce7a5b65440b1779b98..5cee67dcd423d3ad7412a1bdc2f772568d7b48b0 100644 (file)
@@ -250,7 +250,7 @@ int InsetSpace::docbook(Buffer const *, ostream & os, bool) const
 }
 
 
-Inset * InsetSpace::clone() const
+InsetBase * InsetSpace::clone() const
 {
        return new InsetSpace(kind_);
 }
index 8ff805ea3d692d5efb9c507f792bb60e2979c35d..3b7f8c159da32e68d8f8a35f6aee4cc931091a5b 100644 (file)
@@ -71,7 +71,7 @@ public:
        ///
        int docbook(Buffer const *, std::ostream &, bool mixcont) const;
        ///
-       virtual Inset * clone() const;
+       virtual InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::SPACE_CODE; }
        /// We don't need \begin_inset and \end_inset
index e1da4d2e3760f58049226c5ebe6d18d6bf754306..194d2d5e9d3fe743cfb5cf1a8857c7b79c5c6271 100644 (file)
@@ -238,7 +238,7 @@ int InsetSpecialChar::docbook(Buffer const *, ostream & os, bool) const
 }
 
 
-Inset * InsetSpecialChar::clone() const
+InsetBase * InsetSpecialChar::clone() const
 {
        return new InsetSpecialChar(kind_);
 }
index 6fe2ecc4ecaeadc6b8e77012fa76888ca77db427..a70c4a28152837b48c717ec0770855b2f52e1cb1 100644 (file)
@@ -63,7 +63,7 @@ public:
        ///
        int docbook(Buffer const *, std::ostream &, bool mixcont) const;
        ///
-       virtual Inset * clone() const;
+       virtual InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; }
        /// We don't need \begin_inset and \end_inset
index e79d8a906b3f0b5b6049096e2ac460861ae1e66c..f840db1a97e721c3221eab09f3de114c0ace7063 100644 (file)
@@ -196,7 +196,7 @@ InsetTabular::~InsetTabular()
 }
 
 
-Inset * InsetTabular::clone() const
+InsetBase * InsetTabular::clone() const
 {
        return new InsetTabular(*this);
 }
@@ -2351,9 +2351,9 @@ FuncStatus InsetTabular::getStatus(string const & what) const
 }
 
 
-vector<string> const InsetTabular::getLabelList() const
+void InsetTabular::getLabelList(std::vector<string> & list) const
 {
-       return tabular.getLabelList();
+       tabular.getLabelList(list);
 }
 
 
index 810239eca9fe7df149f9ca352633796bdfd29a56..2ab5d2eb9ce57f193acd739f2e04683624808949 100644 (file)
@@ -77,7 +77,7 @@ public:
        ///
        ~InsetTabular();
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        void read(Buffer const *, LyXLex &);
        ///
@@ -164,7 +164,7 @@ public:
        ///
        FuncStatus getStatus(string const & argument) const;
        ///
-       std::vector<string> const getLabelList() const;
+       void getLabelList(std::vector<string> &) const;
        ///
        void nodraw(bool b) const {
                UpdatableInset::nodraw(b);
index d13ead97c16267b2df8f63debfe2b316b9bcac6c..897fe7ec615bc957d5e3a5ba0c34d5d94d96cad0 100644 (file)
@@ -193,12 +193,6 @@ void InsetText::init(InsetText const * ins)
 }
 
 
-InsetText::~InsetText()
-{
-       paragraphs.clear();
-}
-
-
 void InsetText::clear(bool just_mark_erased)
 {
        if (just_mark_erased) {
@@ -224,7 +218,7 @@ void InsetText::clear(bool just_mark_erased)
 }
 
 
-Inset * InsetText::clone() const
+InsetBase * InsetText::clone() const
 {
        return new InsetText(*this);
 }
@@ -1809,21 +1803,16 @@ bool InsetText::showInsetDialog(BufferView * bv) const
 }
 
 
-vector<string> const InsetText::getLabelList() const
+void InsetText::getLabelList(std::vector<string> & list) const
 {
-       vector<string> label_list;
-
        ParagraphList::const_iterator pit = paragraphs.begin();
        ParagraphList::const_iterator pend = paragraphs.end();
        for (; pit != pend; ++pit) {
                InsetList::const_iterator beg = pit->insetlist.begin();
                InsetList::const_iterator end = pit->insetlist.end();
-               for (; beg != end; ++beg) {
-                       vector<string> const l = beg->inset->getLabelList();
-                       label_list.insert(label_list.end(), l.begin(), l.end());
-               }
+               for (; beg != end; ++beg)
+                       beg->inset->getLabelList(list);
        }
-       return label_list;
 }
 
 
index 52f76e7e2c9c7f05b2a8360c47f0d6f72aa02d49..e295000924118b54e230dc618a2d5aa2030a6bad 100644 (file)
@@ -72,12 +72,9 @@ public:
        ///
        InsetText(BufferParams const &);
        ///
-       explicit
-       InsetText(InsetText const &);
+       explicit InsetText(InsetText const &);
        ///
-       ~InsetText();
-       ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        InsetText & operator=(InsetText const & it);
        /// empty inset to empty par, or just mark as erased
@@ -172,7 +169,7 @@ public:
        ///
        bool showInsetDialog(BufferView *) const;
        ///
-       std::vector<string> const getLabelList() const;
+       void getLabelList(std::vector<string> &) const;
        ///
        bool nodraw() const;
        ///
index a121bb19a0b08fc4594ce241c97f6834d5f9662d..ad02764ea8277da4b5fc928ec2fdc922f5e62320 100644 (file)
@@ -53,7 +53,7 @@ void InsetTheorem::write(Buffer const * buf, ostream & os) const
 }
 
 
-Inset * InsetTheorem::clone() const
+InsetBase * InsetTheorem::clone() const
 {
 #ifdef WITH_WARNINGS
 #warning Is this inset used? If YES this is WRONG!!! (Jug)
index 53ba5267c6fab20c6c9c6f264110d92304366851..e03ea0525670558d5147bc118cd7b69da35c6199 100644 (file)
@@ -25,7 +25,7 @@ public:
        ///
        void write(Buffer const * buf, std::ostream & os) const;
        ///
-       virtual Inset * clone() const;
+       virtual InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::THEOREM_CODE; }
        ///
index bb3b5ca00312a66069270ec69679279b6e371806..1d2b34e938dde8278184ebc20c943eac35c626f0 100644 (file)
@@ -24,7 +24,7 @@ public:
        ///
        ~InsetTOC();
        ///
-       virtual Inset * clone() const {
+       virtual InsetBase * clone() const {
                return new InsetTOC(params());
        }
        ///
index e2a16a5a58f087e20f5a06804bcb6aa6894715ea..b6f69c0b58c9b5431610dbdd398eb65d90c04fe7 100644 (file)
@@ -27,7 +27,7 @@ public:
        ///
        ~InsetUrl();
        ///
-       virtual Inset * clone() const {
+       virtual InsetBase * clone() const {
                return new InsetUrl(params());
        }
        ///
index 864225d9c137bcec89a8bc8ca1f0adce09a9d202..2e0140ba28722900a811bc05162d25a1a42b238c 100644 (file)
@@ -167,7 +167,7 @@ void InsetWrap::validate(LaTeXFeatures & features) const
 }
 
 
-Inset * InsetWrap::clone() const
+InsetBase * InsetWrap::clone() const
 {
        return new InsetWrap(*this);
 }
index 45324e926953fc6076623958f6cf9fe5f1e046b2..ab6721bde397f678c934ea25a53a0a281a935790 100644 (file)
@@ -49,7 +49,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
        ///
-       Inset * clone() const;
+       InsetBase * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
        ///
index fdf5f29afb3e7af864df62973fa4a5b0d22032cc..be5e2bfd17fc8632bc05cbeea9df52dba9dfbdee 100644 (file)
@@ -1,24 +1,10 @@
-2003-06-11  Angus Leeming  <leeming@lyx.org>
 
-       * button_inset.[Ch]: removed.
-       * Makefile.am: remove button_inset.[Ch].
+2003-06-16  André Pönitz  <poenitz@gmx.net>
 
-       * command_inset.[Ch]: no longer derived from ButtonInset.
-       Instead has a ButtonRenderer member variable.
+       * math_*inset.[Ch]: IU of clone()
 
-       * ref_inset.[Ch]: associated changes.
-       
-2003-06-03  John Levon  <levon@movementarian.org>
-
-       * formula.[Ch]:
-       * formulabase.h:
-       * formulamacro.[Ch]: clone() doesn't take a Buffer anymore
-
-2003-06-02  André Pönitz  <poenitz@gmx.net>
-
-       * math_*.[Ch]: finish unified two-stage drawing
-
-       * math_inset.h: move validate to insetbase.h
+       * math_cursorpos.[Ch]:
+       * math_cursor.[Ch]: rename MathCursorPos -> CursorPos, par_ -> inset_
 
 2003-05-28  André Pönitz  <poenitz@gmx.net>
 
index 4c397d6c87a90cc3a9efcbb35d12a150542e93e6..77570665d6d14f7857d04a1a6ac2ab2fde0e0ce7 100644 (file)
@@ -14,7 +14,7 @@ CommandInset::CommandInset(string const & name)
 }
 
 
-MathInset * CommandInset::clone() const
+InsetBase * CommandInset::clone() const
 {
        return new CommandInset(*this);
 }
index 6844a6119078e19355f679d9d449a53a3558a722..a7107202c91ba433fb91723feabfc2df6dd78293 100644 (file)
@@ -25,7 +25,7 @@ public:
        ///
        explicit CommandInset(string const & name);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 7691765360d3166940c364b13c26ccdcee6f0d3f..3f7f7f0af0014645c0399604fbe1521da81e9c25 100644 (file)
@@ -122,7 +122,7 @@ void InsetFormulaBase::handleFont
        // this whole function is a hack and won't work for incremental font
        // changes...
        bv->lockedInsetStoreUndo(Undo::EDIT);
-       if (mathcursor->par()->name() == font)
+       if (mathcursor->inset()->name() == font)
                mathcursor->handleFont(font);
        else {
                mathcursor->handleNest(createMathInset(font));
index ea64089128381d69bf76af12c7755a3432513bdc..64ae7399348b4a9617a55ed2c7f1a20f62c63074 100644 (file)
@@ -18,7 +18,7 @@ MathAMSArrayInset::MathAMSArrayInset(string const & name)
 {}
 
 
-MathInset * MathAMSArrayInset::clone() const
+InsetBase * MathAMSArrayInset::clone() const
 {
        return new MathAMSArrayInset(*this);
 }
index c7896421e48235eecde6869203b8d583b013e9cd..04288ea5dd71278c4663bf2e4b8a7678836f3b12 100644 (file)
@@ -20,7 +20,7 @@ public:
        ///
        MathAMSArrayInset(string const & name);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index ec78e036a33cb486241b4abe2ba0d7753a1ee899..a8e2cabea99a5990b43a94f18f6e4d4be8bd19b7 100644 (file)
@@ -57,7 +57,7 @@ MathArrayInset::MathArrayInset(string const & name, string const & str)
 }
 
 
-MathInset * MathArrayInset::clone() const
+InsetBase * MathArrayInset::clone() const
 {
        return new MathArrayInset(*this);
 }
index ee3f7545fbaf4f941b8ddc69f8d17718f5fdae7d..58c873d626ac1734ad7f84c9af82bccc1f958ebd 100644 (file)
@@ -25,7 +25,7 @@ public:
        /// convienience constructor from whitespace/newline seperated data
        MathArrayInset(string const &, string const & str);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index bbc127517920824510c783c6c9089723f7fdda4f..b727dac0f8cdb2bee1ef2c58af340818a7e26dfc 100644 (file)
@@ -14,9 +14,9 @@
 
 #include <config.h>
 
-
 #include "math_atom.h"
 #include "math_inset.h"
+#include "insets/insetbase.h"
 
 #include <utility>
 
@@ -26,13 +26,13 @@ MathAtom::MathAtom()
 {}
 
 
-MathAtom::MathAtom(MathInset * p)
-       : nucleus_(p)
+MathAtom::MathAtom(InsetBase * p)
+       : nucleus_(static_cast<MathInset *>(p))
 {}
 
 
 MathAtom::MathAtom(MathAtom const & at)
-       : nucleus_(at.nucleus_ ? at.nucleus_->clone() : 0)
+       : nucleus_(at.nucleus_ ? static_cast<MathInset *>(at.nucleus_->clone()) : 0)
 {}
 
 
index c251cdc1a250b71f4cf6b93fb11c35aab30fcaa8..286b41ea76d060894d22af1ac8e2af0943ea1313 100644 (file)
@@ -35,6 +35,7 @@ Andre'
 
 */
 
+class InsetBase;
 class MathInset;
 
 class MathAtom {
@@ -43,7 +44,7 @@ public:
        // std::containers
        MathAtom();
        /// the "real constructor"
-       explicit MathAtom(MathInset * p);
+       explicit MathAtom(InsetBase * p);
        /// copy constructor, invokes nucleus_->clone()
        MathAtom(MathAtom const &);
        /// we really need to clean up
index bc56b011d41ec4de2d71e7b6f9cf6526ef19f943..3f0e11ca463a3cc1258bce1d15d532613c9c83fc 100644 (file)
@@ -12,7 +12,7 @@ MathBigInset::MathBigInset(string const & name, string const & delim)
 {}
 
 
-MathInset * MathBigInset::clone() const
+InsetBase * MathBigInset::clone() const
 {
        return new MathBigInset(*this);
 }
index e88b518c0643c631a1ba6f33a725110756a2ebb6..accc21ee592c316949443288f4d0db8646242751 100644 (file)
@@ -24,7 +24,7 @@ public:
        ///
        MathBigInset(string const & name, string const & delim);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index dd801913d0b02fd2a064bb6cecf02afcadd071c9..b8d05a6b5f500bbf207555b8618ac1555faea8a1 100644 (file)
@@ -16,7 +16,7 @@ MathBinaryOpInset::MathBinaryOpInset(char op)
 {}
 
 
-MathInset * MathBinaryOpInset::clone() const
+InsetBase * MathBinaryOpInset::clone() const
 {
        return new MathBinaryOpInset(*this);
 }
index 1a736a396e580d2a38e1d650585d712403b5e663..319336f4f45633c2d7f68eb4104b42928c6cad85 100644 (file)
@@ -16,7 +16,7 @@ public:
        ///
        explicit MathBinaryOpInset(char op);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void draw(PainterInfo &, int x, int y) const;
        ///
index fd7aa7ad73fecadfabc696af88467d0438555371..a77872fb021701bcda09805b1b80f48966436929 100644 (file)
@@ -14,7 +14,7 @@ MathBinomInset::MathBinomInset(bool choose)
 {}
 
 
-MathInset * MathBinomInset::clone() const
+InsetBase * MathBinomInset::clone() const
 {
        return new MathBinomInset(*this);
 }
index 3b7225561447b12c12ab0716c6dc2ea502134e9d..c583c46099eb678c5f387d25afed5539c018a993 100644 (file)
@@ -13,7 +13,7 @@ public:
        ///
        explicit MathBinomInset(bool choose = false);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void write(WriteStream & os) const;
        ///
index 1729cd4ba84810e320f621fcb668f7a3796d2bca..6a292bb5cbda4a86f373a011b6208c3c74b4495f 100644 (file)
@@ -12,7 +12,7 @@ MathBoxInset::MathBoxInset(string const & name)
 {}
 
 
-MathInset * MathBoxInset::clone() const
+InsetBase * MathBoxInset::clone() const
 {
        return new MathBoxInset(*this);
 }
index 8358b99b65e3fbaf255e9bf391cc448b14bd0615..47d6ce89979f7cb44ea3777d906b061e6550ccf2 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        explicit MathBoxInset(string const & name);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        mode_type currentMode() const { return TEXT_MODE; }
        ///
index b3fe85761085ac305e7d722b77bd01f04d768d0c..e6470f9ef2e37f4a495dbcdf72b7d586010a60f5 100644 (file)
@@ -21,7 +21,7 @@ MathBraceInset::MathBraceInset(MathArray const & ar)
 }
 
 
-MathInset * MathBraceInset::clone() const
+InsetBase * MathBraceInset::clone() const
 {
        return new MathBraceInset(*this);
 }
index 2fc685ba758bd1afd0f95e425436aa2ae18bf195..357f9b9a9773942fc84d64a264b840c3c20f5358 100644 (file)
@@ -18,7 +18,7 @@ public:
        ///
        MathBraceInset(MathArray const & ar);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        /// we write extra braces in any case...
        bool extraBraces() const { return true; }
        ///
index 1c093bd738b3dce82e6cd611ba4c5cbb64f50312..ef90f1fdec92bce8dc3e24744b03197e6424dea9 100644 (file)
@@ -14,7 +14,7 @@ MathCasesInset::MathCasesInset(row_type n)
 {}
 
 
-MathInset * MathCasesInset::clone() const
+InsetBase * MathCasesInset::clone() const
 {
        return new MathCasesInset(*this);
 }
index 6864325c1eac9b6d00273555b814833de49c0e85..c1846b5b7801b82f6ce3ec9048a245159c7ef25c 100644 (file)
@@ -12,7 +12,7 @@ public:
        ///
        explicit MathCasesInset(row_type rows = 1u);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 9884a2efe2f864768e38f574e8abd8ad0cd4845b..b1b2a333283fd80e7bddb26ced6560b23f459f0f 100644 (file)
@@ -49,7 +49,7 @@ MathCharInset::MathCharInset(char c)
 
 
 
-MathInset * MathCharInset::clone() const
+InsetBase * MathCharInset::clone() const
 {
        return new MathCharInset(*this);
 }
index 4e49f34038dc61fed3439a28815e924e9e06ce0e..5f43951534cc3bb257a50c29d05c7009efe7804f 100644 (file)
@@ -16,7 +16,7 @@ public:
        ///
        explicit MathCharInset(char c);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 11e5e6f3af1603029daf23d13433862a1a81e32f..1113671d0cfb9851bbcd685baa81eebb9f463eb4 100644 (file)
@@ -21,7 +21,7 @@ MathCommentInset::MathCommentInset(string const & str)
 }
 
 
-MathInset * MathCommentInset::clone() const
+InsetBase * MathCommentInset::clone() const
 {
        return new MathCommentInset(*this);
 }
index c324482b6b37ad08f973c40f588074d855ebaea9..4a1286b3df6bbd823c2a5b9f085b4a7ccbeb3e18 100644 (file)
@@ -20,7 +20,7 @@ public:
        ///
        explicit MathCommentInset(string const &);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 3e146f460aa6bf3970bbe285569a4a3a32372f65..450d16614f6cbe7e9f3cee0d6463b72f36bdcf43 100644 (file)
@@ -80,7 +80,7 @@ MathCursor::~MathCursor()
 
 void MathCursor::push(MathAtom & t)
 {
-       Cursor_.push_back(MathCursorPos(t.nucleus()));
+       Cursor_.push_back(CursorPos(t.nucleus()));
 }
 
 
@@ -106,10 +106,10 @@ bool MathCursor::popLeft()
        //lyxerr << "Leaving atom to the left\n";
        if (depth() <= 1) {
                if (depth() == 1)
-                       par()->notifyCursorLeaves(idx());
+                       inset()->notifyCursorLeaves(idx());
                return false;
        }
-       par()->notifyCursorLeaves(idx());
+       inset()->notifyCursorLeaves(idx());
        Cursor_.pop_back();
        return true;
 }
@@ -117,13 +117,13 @@ bool MathCursor::popLeft()
 
 bool MathCursor::popRight()
 {
-       //lyxerr << "Leaving atom "; par()->write(cerr, false); cerr << " right\n";
+       //lyxerr << "Leaving atom "; inset()->write(cerr, false); cerr << " right\n";
        if (depth() <= 1) {
                if (depth() == 1)
-                       par()->notifyCursorLeaves(idx());
+                       inset()->notifyCursorLeaves(idx());
                return false;
        }
-       par()->notifyCursorLeaves(idx());
+       inset()->notifyCursorLeaves(idx());
        Cursor_.pop_back();
        posRight();
        return true;
@@ -151,7 +151,7 @@ bool MathCursor::popRight()
 bool MathCursor::isInside(MathInset const * p) const
 {
        for (unsigned i = 0; i < depth(); ++i)
-               if (Cursor_[i].par_ == p)
+               if (Cursor_[i].inset_ == p)
                        return true;
        return false;
 }
@@ -169,7 +169,7 @@ bool MathCursor::openable(MathAtom const & t, bool sel) const
                // we can't move into anything new during selection
                if (depth() == Anchor_.size())
                        return false;
-               if (t.operator->() != Anchor_[depth()].par_)
+               if (t.operator->() != Anchor_[depth()].inset_)
                        return false;
        }
        return true;
@@ -178,7 +178,7 @@ bool MathCursor::openable(MathAtom const & t, bool sel) const
 
 bool MathCursor::inNucleus() const
 {
-       return par()->asScriptInset() && idx() == 2;
+       return inset()->asScriptInset() && idx() == 2;
 }
 
 
@@ -244,7 +244,7 @@ void MathCursor::first()
 {
        Cursor_.clear();
        push(formula_->par());
-       par()->idxFirst(idx(), pos());
+       inset()->idxFirst(idx(), pos());
 }
 
 
@@ -252,7 +252,7 @@ void MathCursor::last()
 {
        Cursor_.clear();
        push(formula_->par());
-       par()->idxLast(idx(), pos());
+       inset()->idxLast(idx(), pos());
 }
 
 
@@ -265,7 +265,7 @@ bool positionable
 
        // anchor might be deeper, should have same path then
        for (MathIterator::size_type i = 0; i < cursor.size(); ++i)
-               if (cursor[i].par_ != anchor[i].par_)
+               if (cursor[i].inset_ != anchor[i].inset_)
                        return false;
 
        // position should be ok.
@@ -296,7 +296,7 @@ bool MathCursor::home(bool sel)
        autocorrect_ = false;
        selHandle(sel);
        macroModeClose();
-       if (!par()->idxHome(idx(), pos()))
+       if (!inset()->idxHome(idx(), pos()))
                return popLeft();
        dump("home 2");
        targetx_ = -1; // "no target"
@@ -310,7 +310,7 @@ bool MathCursor::end(bool sel)
        autocorrect_ = false;
        selHandle(sel);
        macroModeClose();
-       if (!par()->idxEnd(idx(), pos()))
+       if (!inset()->idxEnd(idx(), pos()))
                return popRight();
        dump("end 2");
        targetx_ = -1; // "no target"
@@ -430,8 +430,8 @@ bool MathCursor::backspace()
        }
 
        if (pos() == 0) {
-               if (par()->ncols() == 1 &&
-                         par()->nrows() == 1 &&
+               if (inset()->ncols() == 1 &&
+                         inset()->nrows() == 1 &&
                          depth() == 1 &&
                          size() == 0)
                        return false;
@@ -466,15 +466,15 @@ bool MathCursor::erase()
 
        // delete empty cells if possible
        if (array().empty())
-               if (par()->idxDelete(idx()))
+               if (inset()->idxDelete(idx()))
                        return true;
 
        // old behaviour when in last position of cell
        if (pos() == size()) {
-               if (par()->ncols() == 1 && par()->nrows() == 1 && depth() == 1 && size() == 0)
+               if (inset()->ncols() == 1 && inset()->nrows() == 1 && depth() == 1 && size() == 0)
                        return false;
                else{
-                       par()->idxGlue(idx());
+                       inset()->idxGlue(idx());
                        return true;
                }
        }
@@ -623,10 +623,10 @@ void MathCursor::drawSelection(PainterInfo & pi) const
 {
        if (!selection_)
                return;
-       MathCursorPos i1;
-       MathCursorPos i2;
+       CursorPos i1;
+       CursorPos i2;
        getSelection(i1, i2);
-       i1.par_->drawSelection(pi, i1.idx_, i1.pos_, i2.idx_, i2.pos_);
+       i1.inset_->drawSelection(pi, i1.idx_, i1.pos_, i2.idx_, i2.pos_);
 }
 
 
@@ -641,7 +641,7 @@ void MathCursor::handleNest(MathAtom const & a)
 
 void MathCursor::getPos(int & x, int & y) const
 {
-       par()->getPos(idx(), pos(), x, y);
+       inset()->getPos(idx(), pos(), x, y);
 }
 
 
@@ -655,9 +655,9 @@ int MathCursor::targetX() const
 }
 
 
-MathInset * MathCursor::par() const
+MathInset * MathCursor::inset() const
 {
-       return cursor().par_;
+       return cursor().inset_;
 }
 
 
@@ -739,7 +739,7 @@ bool MathCursor::selection() const
 MathGridInset * MathCursor::enclosingGrid(MathCursor::idx_type & idx) const
 {
        for (MathInset::difference_type i = depth() - 1; i >= 0; --i) {
-               MathGridInset * p = Cursor_[i].par_->asGridInset();
+               MathGridInset * p = Cursor_[i].inset_->asGridInset();
                if (p) {
                        idx = Cursor_[i].idx_;
                        return p;
@@ -751,21 +751,21 @@ MathGridInset * MathCursor::enclosingGrid(MathCursor::idx_type & idx) const
 
 void MathCursor::popToHere(MathInset const * p)
 {
-       while (depth() && Cursor_.back().par_ != p)
+       while (depth() && Cursor_.back().inset_ != p)
                Cursor_.pop_back();
 }
 
 
 void MathCursor::popToEnclosingGrid()
 {
-       while (depth() && !Cursor_.back().par_->asGridInset())
+       while (depth() && !Cursor_.back().inset_->asGridInset())
                Cursor_.pop_back();
 }
 
 
 void MathCursor::popToEnclosingHull()
 {
-       while (depth() && !Cursor_.back().par_->asHullInset())
+       while (depth() && !Cursor_.back().inset_->asHullInset())
                Cursor_.pop_back();
 }
 
@@ -795,20 +795,20 @@ void MathCursor::touch()
 
 void MathCursor::normalize()
 {
-       if (idx() >= par()->nargs()) {
+       if (idx() >= inset()->nargs()) {
                lyxerr << "this should not really happen - 1: "
-                      << idx() << ' ' << par()->nargs()
-                      << " in: " << par() << endl;
+                      << idx() << ' ' << inset()->nargs()
+                      << " in: " << inset() << endl;
                dump("error 2");
        }
-       idx() = min(idx(), par()->nargs() - 1);
+       idx() = min(idx(), inset()->nargs() - 1);
 
        if (pos() > size()) {
                lyxerr << "this should not really happen - 2: "
                        << pos() << ' ' << size() <<  " in idx: " << idx()
                       << " in atom: '";
                WriteStream wi(lyxerr, false, true);
-               par()->write(wi);
+               inset()->write(wi);
                lyxerr << endl;
                dump("error 4");
        }
@@ -866,7 +866,7 @@ MathArray & MathCursor::array() const
 {
        static MathArray dummy;
 
-       if (idx() >= par()->nargs()) {
+       if (idx() >= inset()->nargs()) {
                lyxerr << "############  idx_ " << idx() << " not valid\n";
                return dummy;
        }
@@ -882,13 +882,13 @@ MathArray & MathCursor::array() const
 
 void MathCursor::idxNext()
 {
-       par()->idxNext(idx(), pos());
+       inset()->idxNext(idx(), pos());
 }
 
 
 void MathCursor::idxPrev()
 {
-       par()->idxPrev(idx(), pos());
+       inset()->idxPrev(idx(), pos());
 }
 
 
@@ -908,9 +908,9 @@ char MathCursor::halign() const
 }
 
 
-void MathCursor::getSelection(MathCursorPos & i1, MathCursorPos & i2) const
+void MathCursor::getSelection(CursorPos & i1, CursorPos & i2) const
 {
-       MathCursorPos anc = normalAnchor();
+       CursorPos anc = normalAnchor();
        if (anc < cursor()) {
                i1 = anc;
                i2 = cursor();
@@ -921,14 +921,14 @@ void MathCursor::getSelection(MathCursorPos & i1, MathCursorPos & i2) const
 }
 
 
-MathCursorPos & MathCursor::cursor()
+CursorPos & MathCursor::cursor()
 {
        lyx::Assert(depth());
        return Cursor_.back();
 }
 
 
-MathCursorPos const & MathCursor::cursor() const
+CursorPos const & MathCursor::cursor() const
 {
        lyx::Assert(depth());
        return Cursor_.back();
@@ -977,7 +977,7 @@ bool MathCursor::goUpDown(bool up)
        }
 
        // try current cell for e.g. text insets
-       if (par()->idxUpDown2(idx(), pos(), up, targetx_))
+       if (inset()->idxUpDown2(idx(), pos(), up, targetx_))
                return true;
 
        //xarray().boundingBox(xlow, xhigh, ylow, yhigh);
@@ -992,9 +992,9 @@ bool MathCursor::goUpDown(bool up)
 
        // try to find an inset that knows better then we
        while (1) {
-               ///lyxerr << "updown: We are in " << *par() << " idx: " << idx() << '\n';
+               ///lyxerr << "updown: We are in " << *inset() << " idx: " << idx() << '\n';
                // ask inset first
-               if (par()->idxUpDown(idx(), pos(), up, targetx_)) {
+               if (inset()->idxUpDown(idx(), pos(), up, targetx_)) {
                        // try to find best position within this inset
                        if (!selection())
                                bruteFind2(xo, yo);
@@ -1085,21 +1085,21 @@ void MathCursor::bruteFind2(int x, int y)
 
 bool MathCursor::idxLineLast()
 {
-       idx() -= idx() % par()->ncols();
-       idx() += par()->ncols() - 1;
+       idx() -= idx() % inset()->ncols();
+       idx() += inset()->ncols() - 1;
        pos() = size();
        return true;
 }
 
 bool MathCursor::idxLeft()
 {
-       return par()->idxLeft(idx(), pos());
+       return inset()->idxLeft(idx(), pos());
 }
 
 
 bool MathCursor::idxRight()
 {
-       return par()->idxRight(idx(), pos());
+       return inset()->idxRight(idx(), pos());
 }
 
 
@@ -1118,7 +1118,7 @@ bool MathCursor::script(bool up)
        string safe = grabAndEraseSelection();
        if (inNucleus()) {
                // we are in a nucleus of a script inset, move to _our_ script
-               par()->asScriptInset()->ensure(up);
+               inset()->asScriptInset()->ensure(up);
                idx() = up;
                pos() = 0;
        } else if (hasPrevAtom() && prevAtom()->asScriptInset()) {
@@ -1298,7 +1298,7 @@ string MathCursor::info() const
        ostringstream os;
        os << "Math editor mode.  ";
        for (int i = 0, n = depth(); i < n; ++i) {
-               Cursor_[i].par_->infoize(os);
+               Cursor_[i].inset_->infoize(os);
                os << "  ";
        }
        if (hasPrevAtom())
@@ -1318,11 +1318,11 @@ unsigned MathCursor::depth() const
 
 namespace {
 
-void region(MathCursorPos const & i1, MathCursorPos const & i2,
+void region(CursorPos const & i1, CursorPos const & i2,
        MathInset::row_type & r1, MathInset::row_type & r2,
        MathInset::col_type & c1, MathInset::col_type & c2)
 {
-       MathInset * p = i1.par_;
+       MathInset * p = i1.inset_;
        c1 = p->col(i1.idx_);
        c2 = p->col(i2.idx_);
        if (c1 > c2)
@@ -1341,8 +1341,8 @@ string MathCursor::grabSelection() const
        if (!selection_)
                return string();
 
-       MathCursorPos i1;
-       MathCursorPos i2;
+       CursorPos i1;
+       CursorPos i2;
        getSelection(i1, i2);
 
        if (i1.idx_ == i2.idx_) {
@@ -1361,7 +1361,7 @@ string MathCursor::grabSelection() const
                for (col_type col = c1; col <= c2; ++col) {
                        if (col > c1)
                                data += '&';
-                       data += asString(i1.par_->cell(i1.par_->index(row, col)));
+                       data += asString(i1.inset_->cell(i1.inset_->index(row, col)));
                }
        }
        return data;
@@ -1370,13 +1370,13 @@ string MathCursor::grabSelection() const
 
 void MathCursor::eraseSelection()
 {
-       MathCursorPos i1;
-       MathCursorPos i2;
+       CursorPos i1;
+       CursorPos i2;
        getSelection(i1, i2);
        if (i1.idx_ == i2.idx_)
                i1.cell().erase(i1.pos_, i2.pos_);
        else {
-               MathInset * p = i1.par_;
+               MathInset * p = i1.inset_;
                row_type r1, r2;
                col_type c1, c2;
                region(i1, i2, r1, r2, c1, c2);
@@ -1399,7 +1399,7 @@ string MathCursor::grabAndEraseSelection()
 }
 
 
-MathCursorPos MathCursor::normalAnchor() const
+CursorPos MathCursor::normalAnchor() const
 {
        if (Anchor_.size() < depth()) {
                Anchor_ = Cursor_;
@@ -1407,7 +1407,7 @@ MathCursorPos MathCursor::normalAnchor() const
        }
        //lyx::Assert(Anchor_.size() >= cursor.depth());
        // use Anchor on the same level as Cursor
-       MathCursorPos normal = Anchor_[depth() - 1];
+       CursorPos normal = Anchor_[depth() - 1];
        if (depth() < Anchor_.size() && !(normal < cursor())) {
                // anchor is behind cursor -> move anchor behind the inset
                ++normal.pos_;
@@ -1425,7 +1425,7 @@ dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
                case LFUN_MOUSE_MOTION:
                case LFUN_MOUSE_RELEASE:
                case LFUN_MOUSE_DOUBLE: {
-                       MathCursorPos & pos = Cursor_.back();
+                       CursorPos & pos = Cursor_.back();
                        dispatch_result res = UNDISPATCHED;
                        int x = 0, y = 0;
                        getPos(x, y);
@@ -1445,8 +1445,8 @@ dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
        }
 
        for (int i = Cursor_.size() - 1; i >= 0; --i) {
-               MathCursorPos & pos = Cursor_[i];
-               dispatch_result res = pos.par_->dispatch(cmd, pos.idx_, pos.pos_);
+               CursorPos & pos = Cursor_[i];
+               dispatch_result res = pos.inset_->dispatch(cmd, pos.idx_, pos.pos_);
                if (res != UNDISPATCHED) {
                        if (res == DISPATCHED_POP) {
                                Cursor_.shrink(i + 1);
@@ -1462,7 +1462,7 @@ dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
 MathInset::mode_type MathCursor::currentMode() const
 {
        for (int i = Cursor_.size() - 1; i >= 0; --i) {
-               MathInset::mode_type res = Cursor_[i].par_->currentMode();
+               MathInset::mode_type res = Cursor_[i].inset_->currentMode();
                if (res != MathInset::UNDECIDED_MODE)
                        return res;
        }
index 7d30ae57e1e132f4f7b4080b7b4dad9d7a05c640..08a019d0ae927beda9f40190d38415c99de48e9e 100644 (file)
@@ -32,7 +32,7 @@ class MathUnknownInset;
 [Have a look at math_inset.h first]
 
 The MathCursor is different from the kind of cursor used in the Outer
-World. It contains a stack of MathCursorPos, each of which is made
+World. It contains a stack of CursorPos, each of which is made
 up of a inset pointer, an index and a position offset, marking a path from
 this formula's MathHullInset to the current position.
 
@@ -106,7 +106,7 @@ public:
        /// in pixels from left of screen
        int targetX() const;
        /// current inset
-       MathInset * par() const;
+       MathInset * inset() const;
        /// return the next enclosing grid inset and the cursor's index in it
        MathGridInset * enclosingGrid(idx_type & idx) const;
        /// go up to enclosing grid
@@ -208,14 +208,14 @@ public:
        MathAtom & nextAtom();
 
        /// returns the selection
-       void getSelection(MathCursorPos &, MathCursorPos &) const;
+       void getSelection(CursorPos &, CursorPos &) const;
        /// returns the normalized anchor of the selection
-       MathCursorPos normalAnchor() const;
+       CursorPos normalAnchor() const;
 
        /// reference to the last item of the path, i.e. "The Cursor"
-       MathCursorPos & cursor();
+       CursorPos & cursor();
        /// reference to the last item of the path, i.e. "The Cursor"
-       MathCursorPos const & cursor() const;
+       CursorPos const & cursor() const;
        /// how deep are we nested?
        unsigned depth() const;
 
index 5f37628eb54cded008b3182365f89115fcd40740..ade970313557ce3323e2cf6f0204b58db7dc20cb 100644 (file)
@@ -14,7 +14,7 @@ MathDecorationInset::MathDecorationInset(latexkeys const * key)
 {}
 
 
-MathInset * MathDecorationInset::clone() const
+InsetBase * MathDecorationInset::clone() const
 {
        return new MathDecorationInset(*this);
 }
index e84488b1bc2b9b15c88ded3c581f6c07bb60aabb..8fc07ad1ebb7d89058ebae05ab9abecc9965a4e3 100644 (file)
@@ -19,7 +19,7 @@ public:
        ///
        explicit MathDecorationInset(latexkeys const * key);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void draw(PainterInfo &, int x, int y) const;
        ///
index 6fd65e3da4ae562cd94da369421eccceff30f15f..8c522d7317380d733efe2024ebaa887f06154848 100644 (file)
@@ -52,7 +52,7 @@ MathDelimInset::MathDelimInset
 }
 
 
-MathInset * MathDelimInset::clone() const
+InsetBase * MathDelimInset::clone() const
 {
        return new MathDelimInset(*this);
 }
index bedd04f55b2aa835555d6e4fcf64f80b69bf1c8f..84a3ac14512f335c30d27bacf0c212aac351f103 100644 (file)
@@ -19,7 +19,7 @@ public:
        ///
        MathDelimInset(string const & left, string const & right, MathArray const &);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        MathDelimInset * asDelimInset() { return this; }
        ///
index 5f0f202db41bebf3bce3bf6e0a54314bbca8d777..a5d2ef4bcee45b97e9014195cc9e91e1850886bd 100644 (file)
@@ -11,7 +11,7 @@ MathDiffInset::MathDiffInset()
 {}
 
 
-MathInset * MathDiffInset::clone() const
+InsetBase * MathDiffInset::clone() const
 {
        return new MathDiffInset(*this);
 }
index 17436c8da54996530b48ba30491867491cb5b628..84a867aec613411ba58455c10f7c9464a89b319e 100644 (file)
@@ -13,7 +13,7 @@ public:
        ///
        explicit MathDiffInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void addDer(MathArray const & der);
        ///
index 51bd28a74dbf11b65910e6788e870d29d1dcbb2d..c437d428739de797a19ff9d2bf6e3f2df3f67e08 100644 (file)
@@ -12,7 +12,7 @@ MathDotsInset::MathDotsInset(latexkeys const * key)
 {}
 
 
-MathInset * MathDotsInset::clone() const
+InsetBase * MathDotsInset::clone() const
 {
        return new MathDotsInset(*this);
 }
index 22d87e076ab88219b66d6bd8f8665321422d8799..542a1082eb6d6e26d2458ca308e4782bf601e490 100644 (file)
@@ -13,7 +13,7 @@ public:
        ///
        explicit MathDotsInset(latexkeys const * l);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index a7da4500ff3b7371700386e01515820741267f21..42b9dac39ee2d226e25c1359f474b0f7f3062a89 100644 (file)
@@ -11,7 +11,7 @@ MathEnvInset::MathEnvInset(string const & name)
 {}
 
 
-MathInset * MathEnvInset::clone() const
+InsetBase * MathEnvInset::clone() const
 {
        return new MathEnvInset(*this);
 }
index c13a17c0991d8d83e43677743301186adef50726..083273880f7abcac7b7eb42b9478996e0095fc10 100644 (file)
@@ -17,7 +17,7 @@ public:
        ///
        MathEnvInset(string const & name_);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void draw(PainterInfo &, int x, int y) const;
        ///
index 64dfbeca7438983ca88ee95e77b6399b7c1586b1..b82344947d11c9ed5af1cacc6ddd851038979606 100644 (file)
@@ -6,7 +6,7 @@
 #include "support/LOstream.h"
 
 
-MathInset * MathErtInset::clone() const
+InsetBase * MathErtInset::clone() const
 {
        return new MathErtInset(*this);
 }
index d72b58d907e18d0582e6d9d89d0c6b7990e13169..afc2bdf961af62d1b860d54d858815952ce809af 100644 (file)
@@ -11,7 +11,7 @@ public:
        ///
        MathErtInset() {}
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        mode_type currentMode() const { return TEXT_MODE; }
        ///
index 7912da47a1bd4aff9a6d2d9672a07b8a0b9bc501..6033db4a6c03199cbb52aab286928481c81f3015 100644 (file)
@@ -19,7 +19,7 @@ MathExFuncInset::MathExFuncInset(string const & name, MathArray const & ar)
 }
 
 
-MathInset * MathExFuncInset::clone() const
+InsetBase * MathExFuncInset::clone() const
 {
        return new MathExFuncInset(*this);
 }
index 98b08b192ef337966c375f0f9f7370ba6ae3b631..a68ab7636126c457979fbafe672e2e2c27810c7d 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        MathExFuncInset(string const & name, MathArray const & ar);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index b4b1204365f2627b1c29af1694a3f6c55a9b3cd0..8ff4679ec44c998138ad553977a9dec2f6706def 100644 (file)
@@ -21,7 +21,7 @@ MathExIntInset::MathExIntInset(string const & name)
 // 3 - upper
 
 
-MathInset * MathExIntInset::clone() const
+InsetBase * MathExIntInset::clone() const
 {
        return new MathExIntInset(*this);
 }
index 05e209c36a052a2153705781613a343011c7afd2..c0c68034ac600d415dac885440cd022f60899b91 100644 (file)
@@ -14,7 +14,7 @@ public:
        ///
        explicit MathExIntInset(string const & name_);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void symbol(string const &);
        ///
index 3383a3f97c0bc14370936d2dedb61462f0037aac..f8e5889348b91466c97060614f7f90d01621712e 100644 (file)
@@ -14,7 +14,7 @@ MathFboxInset::MathFboxInset(latexkeys const * key)
 {}
 
 
-MathInset * MathFboxInset::clone() const
+InsetBase * MathFboxInset::clone() const
 {
        return new MathFboxInset(*this);
 }
index c0e9fc85c746a7d363453b6b3653c41a5f893a18..c65eaae8e546e94fac607bc8f9ad3883f21f7352 100644 (file)
@@ -19,7 +19,7 @@ public:
        ///
        MathFboxInset(latexkeys const * key);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        mode_type currentMode() const;
        ///
index 1873c831a6877f175741d4b7ea6cf0e47ba44556..c8669f4f5013b9d5b3efdfbf86e12c62a923631c 100644 (file)
@@ -16,7 +16,7 @@ MathFontInset::MathFontInset(latexkeys const * key)
 {}
 
 
-MathInset * MathFontInset::clone() const
+InsetBase * MathFontInset::clone() const
 {
        return new MathFontInset(*this);
 }
index 69ae8bbc215b0230640bbfdb85305ab08e7d92c8..96c47573f38219af79193aff916ac83487782d82 100644 (file)
@@ -18,7 +18,7 @@ public:
        ///
        explicit MathFontInset(latexkeys const * key);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        MathFontInset * asFontInset() { return this; }
        ///
index c6b3c2b299e0e053549ccd4a351ec97817f5aaf5..da27886ffa548a196ff870ad2f1f62c34a2c3026 100644 (file)
@@ -19,7 +19,7 @@ MathFontOldInset::MathFontOldInset(latexkeys const * key)
 }
 
 
-MathInset * MathFontOldInset::clone() const
+InsetBase * MathFontOldInset::clone() const
 {
        return new MathFontOldInset(*this);
 }
index dc168e50a9bb0f2992526d40988714ec77d59ac6..dc820348b5876e1314d63d14761250e9015a7cd8 100644 (file)
@@ -18,7 +18,7 @@ public:
        ///
        explicit MathFontOldInset(latexkeys const * key);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        /// we are in text mode.
        mode_type currentMode() const { return TEXT_MODE; }
        /// we write extra braces in any case...
index be4b75d496680321e8382a7b9a273be47360e0cc..86342f3c66f2c6055986cbfbb9844179e0613d66 100644 (file)
@@ -14,7 +14,7 @@ MathFracInset::MathFracInset(bool atop)
 {}
 
 
-MathInset * MathFracInset::clone() const
+InsetBase * MathFracInset::clone() const
 {
        return new MathFracInset(*this);
 }
index 61d4dcbeb2e3758e6c670b6ede293bccbc074a08..7ae5ddeb4da21945c83601f1e59710f56cf40eea 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        explicit MathFracInset(bool atop = false);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 26b42aff950626ff5b488fc2fdbf39bc5a522753..30b386fd2d9b83af6edb839e817288e8dacb42ac 100644 (file)
@@ -12,7 +12,7 @@ MathFrameboxInset::MathFrameboxInset()
 {}
 
 
-MathInset * MathFrameboxInset::clone() const
+InsetBase * MathFrameboxInset::clone() const
 {
        return new MathFrameboxInset(*this);
 }
index 11b3b8ea8a4f4c280c942611cb2dcf1b4c0c245c..e05462c3c6771c42ad2d7aa651e9ccd7fdd2c70b 100644 (file)
@@ -16,7 +16,7 @@ public:
        ///
        MathFrameboxInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 4201aef6e52a6f86491bc3c784d7e99c2c032239..eaa2e26a445efabeb9161454cc5e7bf122276fe6 100644 (file)
@@ -160,7 +160,7 @@ MathGridInset::~MathGridInset()
 }
 
 
-MathInset * MathGridInset::clone() const
+InsetBase * MathGridInset::clone() const
 {
        return new MathGridInset(*this);
 }
index 6177c9be827efd6dd5c516935bd56b6de35e502d..00e324f676b90eefe2def93b74bb5e0ce7c09c90 100644 (file)
@@ -90,7 +90,7 @@ public:
        /// Ensures that the dialog is closed.
        ~MathGridInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi) const;
        ///
index a0309b100fc57750a84e10471361821bd2603289..77927933372228dfc863c0539c2149178ee3e989 100644 (file)
@@ -104,7 +104,7 @@ MathHullInset::MathHullInset(string const & type)
 }
 
 
-MathInset * MathHullInset::clone() const
+InsetBase * MathHullInset::clone() const
 {
        return new MathHullInset(*this);
 }
index c0a1c6ca546d8f1fed6ddf0d8a8c79c33cb5c82a..21533847372632a54ef3e44ddf142d9ac70e88c1 100644 (file)
@@ -20,7 +20,7 @@ public:
        ///
        explicit MathHullInset(string const & type);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        mode_type currentMode() const;
        ///
index 7a6da9a3c9d1e0be9d114d5318eb6b4c8821fa8d..08ea890e281695467185b928a52de07359aa6c2a 100644 (file)
@@ -11,7 +11,7 @@ MathInferInset::MathInferInset()
 {}
 
 
-MathInset * MathInferInset::clone() const
+InsetBase * MathInferInset::clone() const
 {
        return new MathInferInset(*this);
 }
index 582a85a17dcc8ea6572198ac31c362fbce534b42..350d02ae14de10ba9f31f4ed01f859c447f92c7c 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        explicit MathInferInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index eac36dd7da0d04c14ca70be325f43c338e4d584b..b5e5d20f6ae6ca7025f80bfbd1ba45028aa21b7a 100644 (file)
@@ -87,8 +87,6 @@ public:
        /// our members behave nicely...
        MathInset() {}
 
-       /// reproduce itself
-       virtual MathInset * clone() const = 0;
        /// substitutes macro arguments if necessary
        virtual void substitute(MathMacro const & macro);
        /// draw selection between two positions
@@ -255,9 +253,6 @@ public:
        /// dump content to stderr for debugging
        virtual void dump() const;
 
-       /// LyXInset stuff
-       /// write labels into a list
-       virtual void getLabelList(std::vector<string> &) const {}
        /// LyXInset stuff
        virtual bool numberedType() const { return false; }
        /// hull type
index eb73b1a3a38b310e8573728d91f5c815b97e4e3c..bf207171816772bd13d4ac4560b5f2f43374269e 100644 (file)
@@ -17,22 +17,22 @@ MathIterator::MathIterator(MathInset * p)
 }
 
 
-MathInset const * MathIterator::par() const
+MathInset const * MathIterator::inset() const
 {
-       return back().par_;
+       return back().inset_;
 }
 
 
-MathInset * MathIterator::par()
+MathInset * MathIterator::inset()
 {
-       return back().par_;
+       return back().inset_;
 }
 
 
 MathArray const & MathIterator::cell() const
 {
-       MathCursorPos const & top = back();
-       return top.par_->cell(top.idx_);
+       CursorPos const & top = back();
+       return top.inset_->cell(top.idx_);
 }
 
 
@@ -40,7 +40,7 @@ MathArray const & MathIterator::cell() const
 void MathIterator::push(MathInset * p)
 {
        //lyxerr << "push: " << p << endl;
-       push_back(MathCursorPos(p));
+       push_back(CursorPos(p));
 }
 
 
@@ -52,13 +52,13 @@ void MathIterator::pop()
 }
 
 
-MathCursorPos const & MathIterator::operator*() const
+CursorPos const & MathIterator::operator*() const
 {
        return back();
 }
 
 
-MathCursorPos const & MathIterator::operator->() const
+CursorPos const & MathIterator::operator->() const
 {
        return back();
 }
@@ -66,16 +66,16 @@ MathCursorPos const & MathIterator::operator->() const
 
 void MathIterator::goEnd()
 {
-       MathCursorPos & top = back();
-       top.idx_ = top.par_->nargs() - 1;
+       CursorPos & top = back();
+       top.idx_ = top.inset_->nargs() - 1;
        top.pos_ = cell().size();
 }
 
 
 void MathIterator::operator++()
 {
-       MathCursorPos & top = back();
-       MathArray     & ar  = top.par_->cell(top.idx_);
+       CursorPos & top = back();
+       MathArray     & ar  = top.inset_->cell(top.idx_);
 
        // move into the current inset if possible
        // it is impossible for pos() == size()!
@@ -95,10 +95,10 @@ void MathIterator::operator++()
        }
 
        // otherwise try to move on one cell if possible
-       while (top.idx_ + 1 < top.par_->nargs()) {
+       while (top.idx_ + 1 < top.inset_->nargs()) {
                // idx() == nargs() is _not_ valid!
                ++top.idx_;
-               if (top.par_->validCell(top.idx_)) {
+               if (top.inset_->validCell(top.idx_)) {
                        top.pos_ = 0;
                        return;
                }
index 5c76edc6db9be0ae7fd77e61f71770078a8e5a53..91c39d4db1a082df157497d1964249bd0dda6452 100644 (file)
@@ -2,16 +2,17 @@
 #ifndef MATH_ITERATOR_H
 #define MATH_ITERATOR_H
 
-
 #include "math_pos.h"
+
 #include <vector>
 
+
 // this is used for traversing math insets
 
-class MathIterator : private std::vector<MathCursorPos> {
+class MathIterator : private std::vector<CursorPos> {
 public:
        // re-use inherited stuff
-       typedef std::vector<MathCursorPos> base_type;
+       typedef std::vector<CursorPos> base_type;
        using base_type::clear;
        using base_type::size;
        using base_type::push_back;
@@ -32,17 +33,17 @@ public:
        /// start with given inset
        explicit MathIterator(MathInset * p);
        ///
-       MathCursorPos const & operator*() const;
+       CursorPos const & operator*() const;
        ///
-       MathCursorPos const & operator->() const;
+       CursorPos const & operator->() const;
        /// move on one step
        void operator++();
        /// move on several steps
        void jump(difference_type);
        /// read access to top most inset
-       MathInset const * par() const;
+       MathInset const * inset() const;
        /// read access to top most inset
-       MathInset * par();
+       MathInset * inset();
        /// helper for iend
        void goEnd();
        /// read access to top most item
index 735df272c3dd1810168475f51e53150884761522..88e5fff4e9b6b43e6bd2918f11f3ae328294063c 100644 (file)
@@ -22,7 +22,7 @@ MathKernInset::MathKernInset(string const & s)
 {}
 
 
-MathInset * MathKernInset::clone() const
+InsetBase * MathKernInset::clone() const
 {
        return new MathKernInset(*this);
 }
index 956a5415e49da510a8d4765babaad35acec47a8f..3503607c82b2d28d377c4ebea0356a43cdf32c12 100644 (file)
@@ -20,7 +20,7 @@ public:
        ///
        explicit MathKernInset(string const & wid);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index af2037187504544907c8f89f4fb8871973ef130c..d80f437671f5d827bc1a8983c3b8bc7a609d8c02 100644 (file)
@@ -9,7 +9,7 @@ MathLefteqnInset::MathLefteqnInset()
 {}
 
 
-MathInset * MathLefteqnInset::clone() const
+InsetBase * MathLefteqnInset::clone() const
 {
        return new MathLefteqnInset(*this);
 }
index fea4ee53815ed26ab9634374efc4cf00d638e240..a59cd9de161fc2d8405addbb127b259f9040b925 100644 (file)
@@ -12,7 +12,7 @@ public:
        ///
        MathLefteqnInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        string name() const;
        ///
index 0b854fa9a86bd0c281f6028078063bf750fb7956..84468e523464be26d6bfcc0a93859298c1a66743 100644 (file)
@@ -16,7 +16,7 @@ MathLimInset::MathLimInset
 }
 
 
-MathInset * MathLimInset::clone() const
+InsetBase * MathLimInset::clone() const
 {
        return new MathLimInset(*this);
 }
index 18817748f0d3bb92b097ff64429f877dd787e42c..87469aff517186783536c54cfd3acd0a850e6bbc 100644 (file)
@@ -13,7 +13,7 @@ public:
        ///
        MathLimInset(MathArray const & f, MathArray const & x, MathArray const & x0);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 8d07cf8e79756fad8e5ac94d89e0a6623d31bb21..7ec87a11fcdb6e285c359119b1821b7f305c88e6 100644 (file)
@@ -44,7 +44,7 @@ MathMacro::MathMacro(MathMacro const & m)
 
 
 
-MathInset * MathMacro::clone() const
+InsetBase * MathMacro::clone() const
 {
        return new MathMacro(*this);
 }
index ec22720880b016a83f3e57f7388b82a9633bee50..94395953a9001c0af93cff2d3f48186e2d95d812 100644 (file)
@@ -43,7 +43,7 @@ public:
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void dump() const;
 
index 0e3ea48aadbbd01e48619f204c741786bf9ce5b0..58b0c76e48d1e0987fc0f084c3000d7753a3520c 100644 (file)
@@ -21,7 +21,7 @@ MathMacroArgument::MathMacroArgument(int n)
 }
 
 
-MathInset * MathMacroArgument::clone() const
+InsetBase * MathMacroArgument::clone() const
 {
        return new MathMacroArgument(*this);
 }
index c8f446959242d3b837fa5f82a532ea30fa036c1f..f04f6572394759a0d3a8d3a78929f3017f6208fd 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        explicit MathMacroArgument(int);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        bool isActive() const { return false; }
        ///
index f5ff5995ad8fe03b4fa52fd8172eec6953b48259..3f03eeeb8a3b1265b0d7f49fcb62728ef5aaac70 100644 (file)
@@ -37,7 +37,7 @@ MathMacroTemplate::MathMacroTemplate(std::istream & is)
 }
 
 
-MathInset * MathMacroTemplate::clone() const
+InsetBase * MathMacroTemplate::clone() const
 {
        //lyxerr << "cloning MacroTemplate!\n";
        return new MathMacroTemplate(*this);
index 4e0677a4783752d78508006e7a4f88bb1e2dce1f..405eeb331172e24ade293c1d44c44dfd69455dc3 100644 (file)
@@ -25,7 +25,7 @@ public:
        ///
        explicit MathMacroTemplate(std::istream & is);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void write(WriteStream & os) const;
        /// Number of arguments
index 9e57932be767cf9de47a11fa577e77e077d5c90f..40bf9557bde42f45a2e6841329a8a1aa86e86236 100644 (file)
@@ -17,7 +17,7 @@ MathMakeboxInset::MathMakeboxInset()
 {}
 
 
-MathInset * MathMakeboxInset::clone() const
+InsetBase * MathMakeboxInset::clone() const
 {
        return new MathMakeboxInset(*this);
 }
index 805bdd4960d7f222b031895b27b0d07837a42a0a..6b308bb606ca5bab4885dc7e3bf57773a1fe6aa8 100644 (file)
@@ -21,7 +21,7 @@ public:
        ///
        MathMakeboxInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 37db699ed6aef57bdc8c23ebd4a8defab5be2f13..d515da77d2d3ec526683de3b76a41d07175eff8f 100644 (file)
@@ -10,7 +10,7 @@ MathMatrixInset::MathMatrixInset(MathGridInset const & p)
 {}
 
 
-MathInset * MathMatrixInset::clone() const
+InsetBase * MathMatrixInset::clone() const
 {
        return new MathMatrixInset(*this);
 }
index 30ba7b5f9d04ce58b0fb737c948f05e7c8a3ff59..08c27545c2530674bab3082676e4683b323499a0 100644 (file)
@@ -14,7 +14,7 @@ public:
        ///
        MathMatrixInset(string const & str);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        /// identifies MatrixInsets
        MathMatrixInset const * asMatrixInset() const { return this; }
 
index 669a84bf4ef6350fa945bde6b07e5fc8be725127..423912308f4f5bdafc88871ff514c0bd8ab1cf52 100644 (file)
@@ -13,7 +13,7 @@ MathNumberInset::MathNumberInset(string const & s)
 {}
 
 
-MathInset * MathNumberInset::clone() const
+InsetBase * MathNumberInset::clone() const
 {
        return new MathNumberInset(*this);
 }
index 68a4cd5b4b3039925b1db914ed17ef3086036e75..93a6e49fb25ab3440fd799b376ec54488ed70f34 100644 (file)
@@ -17,7 +17,7 @@ public:
        ///
        explicit MathNumberInset(string const & s);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 5f41f1fa8bd9d53715a8117cc02afbfb68333e7c..65b6a17b83fa12dde32ac58479f8432e3fcaeaef 100644 (file)
@@ -13,7 +13,7 @@ MathParboxInset::MathParboxInset()
 }
 
 
-MathInset * MathParboxInset::clone() const
+InsetBase * MathParboxInset::clone() const
 {
        return new MathParboxInset(*this);
 }
index dc8e0d4d8a213d5c9c97b37905cc9db1c4e3b9b5..4fcacc9e794bca09d5840221d2083847cb14857f 100644 (file)
@@ -13,7 +13,7 @@ public:
        ///
        MathParboxInset * asParboxInset() { return this; }
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        mode_type currentMode() const { return TEXT_MODE; }
        ///
index 3ed162d8b801c412cd8e800ed08a528d2178d27b..a49bfa1a248153a069c6ed92deafddb32468622b 100644 (file)
@@ -7,67 +7,67 @@
 #include "support/LOstream.h"
 
 
-MathCursorPos::MathCursorPos()
-       : par_(0), idx_(0), pos_(0)
+CursorPos::CursorPos()
+       : inset_(0), idx_(0), pos_(0)
 {}
 
 
-MathCursorPos::MathCursorPos(MathInset * p)
-       : par_(p), idx_(0), pos_(0)
+CursorPos::CursorPos(MathInset * p)
+       : inset_(p), idx_(0), pos_(0)
 {
-       lyx::Assert(par_);
+       lyx::Assert(inset_);
 }
 
 
 
-MathArray & MathCursorPos::cell(MathArray::idx_type idx) const
+MathArray & CursorPos::cell(MathArray::idx_type idx) const
 {
-       lyx::Assert(par_);
-       return par_->cell(idx);
+       lyx::Assert(inset_);
+       return inset_->cell(idx);
 }
 
 
-MathArray & MathCursorPos::cell() const
+MathArray & CursorPos::cell() const
 {
-       lyx::Assert(par_);
-       return par_->cell(idx_);
+       lyx::Assert(inset_);
+       return inset_->cell(idx_);
 }
 
 
-void MathCursorPos::getPos(int & x, int & y) const
+void CursorPos::getPos(int & x, int & y) const
 {
-       par_->getPos(idx_, pos_, x, y);
+       inset_->getPos(idx_, pos_, x, y);
 }
 
 
-void MathCursorPos::setPos(MathArray::pos_type pos)
+void CursorPos::setPos(MathArray::pos_type pos)
 {
        pos_ = pos;
 }
 
 
-std::ostream & operator<<(std::ostream & os, MathCursorPos const & p)
+std::ostream & operator<<(std::ostream & os, CursorPos const & p)
 {
-       os << "(par: " << p.par_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ')';
+       os << "(par: " << p.inset_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ')';
        return os;
 }
 
 
-bool operator==(MathCursorPos const & p, MathCursorPos const & q)
+bool operator==(CursorPos const & p, CursorPos const & q)
 {
-       return p.par_ == q.par_ && p.idx_ == q.idx_ && p.pos_ == q.pos_;
+       return p.inset_ == q.inset_ && p.idx_ == q.idx_ && p.pos_ == q.pos_;
 }
 
 
-bool operator!=(MathCursorPos const & p, MathCursorPos const & q)
+bool operator!=(CursorPos const & p, CursorPos const & q)
 {
-       return p.par_ != q.par_ || p.idx_ != q.idx_ || p.pos_ != q.pos_;
+       return p.inset_ != q.inset_ || p.idx_ != q.idx_ || p.pos_ != q.pos_;
 }
 
 
-bool operator<(MathCursorPos const & p, MathCursorPos const & q)
+bool operator<(CursorPos const & p, CursorPos const & q)
 {
-       if (p.par_ != q.par_) {
+       if (p.inset_ != q.inset_) {
                lyxerr << "can't compare cursor and anchor in different insets\n";
                return true;
        }
index 85198c782f1ddf43a32deb2e3b5ee5f69a1f97ec..4c79faa3cc2af8fac5808fab77ab8eda65ade688 100644 (file)
@@ -7,12 +7,12 @@
 
 
 /// Description of a position
-class MathCursorPos {
+class CursorPos {
 public:
        ///
-       MathCursorPos();
+       CursorPos();
        ///
-       explicit MathCursorPos(MathInset *);
+       explicit CursorPos(MathInset *);
 
        /// returns cell corresponding to this position
        MathArray & cell() const;
@@ -25,7 +25,7 @@ public:
 
 public:
        /// pointer to an inset
-       MathInset * par_;
+       MathInset * inset_;
        /// cell index of a position in this inset
        MathArray::idx_type idx_;
        /// position in this cell
@@ -33,12 +33,12 @@ public:
 };
 
 /// test for equality
-bool operator==(MathCursorPos const &, MathCursorPos const &);
+bool operator==(CursorPos const &, CursorPos const &);
 /// test for inequality
-bool operator!=(MathCursorPos const &, MathCursorPos const &);
+bool operator!=(CursorPos const &, CursorPos const &);
 /// test for order
-bool operator<(MathCursorPos const &, MathCursorPos const &);
+bool operator<(CursorPos const &, CursorPos const &);
 /// output
-std::ostream & operator<<(std::ostream &, MathCursorPos const &);
+std::ostream & operator<<(std::ostream &, CursorPos const &);
 
 #endif
index 18aafd84f0fec18b1a124eceed55d003bc56022d..c0530c6ba3054fdf22705141d9b427ebb12c1d9f 100644 (file)
@@ -25,7 +25,7 @@ MathRootInset::MathRootInset()
 {}
 
 
-MathInset * MathRootInset::clone() const
+InsetBase * MathRootInset::clone() const
 {
        return new MathRootInset(*this);
 }
index d72db051c313b51540cf1bb2bdd55922b17f1c1f..08402f54aaa547046a870d0280ef891ca8f26468 100644 (file)
@@ -29,7 +29,7 @@ public:
        ///
        MathRootInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        bool idxUpDown(idx_type & idx, pos_type & pos, bool up, int targetx) const;
        ///
index 67de4997107fa172c27475da3022218f2cf4c0df..83d7c79896f66c722ea934fb435ffd9d781cfbef 100644 (file)
@@ -37,7 +37,7 @@ MathScriptInset::MathScriptInset(MathAtom const & at, bool up)
 
 
 
-MathInset * MathScriptInset::clone() const
+InsetBase * MathScriptInset::clone() const
 {
        return new MathScriptInset(*this);
 }
index 5a411e71e1a39827c320b7592842dcd2c201356f..c7d4ddb28e39b81b19a0859396766ced71390cb8 100644 (file)
@@ -20,7 +20,7 @@ public:
        /// create inset with single script and given nucleus
        MathScriptInset(MathAtom const & at, bool up);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 4d77161c464fee40f836faf4092b7b334ab1da6e..f6e472a108b23ebfd2a547bc543fbadce7ee34aa 100644 (file)
@@ -15,7 +15,7 @@ MathSizeInset::MathSizeInset(latexkeys const * l)
 {}
 
 
-MathInset * MathSizeInset::clone() const
+InsetBase * MathSizeInset::clone() const
 {
        return new MathSizeInset(*this);
 }
index 05bc74d236d6a5e97c3556a5db839daafbcfabe9..6954884829ddbb8ea6c0894204d3cc7e26780edc 100644 (file)
@@ -19,7 +19,7 @@ public:
        ///
        explicit MathSizeInset(latexkeys const * l);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        /// we write extra braces in any case...
        bool extraBraces() const { return true; }
        ///
index 0d2ee4e7cc6d42129e73c0b345092b31044da58f..677394fef74bb4aa9a497cb3a660250bfa423350 100644 (file)
@@ -32,7 +32,7 @@ MathSpaceInset::MathSpaceInset(string const & name)
 }
 
 
-MathInset * MathSpaceInset::clone() const
+InsetBase * MathSpaceInset::clone() const
 {
        return new MathSpaceInset(*this);
 }
index 75c8fbe8bdbb3f9db7d5a7cc9f970f2ae00a51f9..4098ebfe0512a2314933bb6ab48edf219d7f31c4 100644 (file)
@@ -13,7 +13,7 @@ public:
        ///
        explicit MathSpaceInset(string const & name);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        MathSpaceInset const * asSpaceInset() const { return this; }
        ///
index 36be6878a1efdbe75d1da850262d267247f914f9..34e36889478483ec5a0e0744fcb98e07caf1afe2 100644 (file)
@@ -11,7 +11,7 @@ MathSplitInset::MathSplitInset(string const & name)
 }
 
 
-MathInset * MathSplitInset::clone() const
+InsetBase * MathSplitInset::clone() const
 {
        return new MathSplitInset(*this);
 }
index 6ae28c861ac681a9bc24bcb8b22e82037d22ec37..2d89f264a0762f944045d70146dd829bd4415126 100644 (file)
@@ -12,7 +12,7 @@ public:
        ///
        explicit MathSplitInset(string const & name);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void write(WriteStream & os) const;
        ///
index b1bcb84d8f2879b8b63a0d8c78e1eb2d00501f9f..bc642c06a8dd23244472fb580d3c34b286081b86 100644 (file)
@@ -11,7 +11,7 @@ MathSqrtInset::MathSqrtInset()
 {}
 
 
-MathInset * MathSqrtInset::clone() const
+InsetBase * MathSqrtInset::clone() const
 {
        return new MathSqrtInset(*this);
 }
index 40aa6e8b35f28539b5eff37295172b140759c62e..74c9901d7bdaa9597a4d8994d9ef36a6b0b359a0 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        MathSqrtInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void draw(PainterInfo &, int x, int y) const;
        ///
index 4e03e7258b706d6bc7954cae2cbc3a6123049f41..39b8ee61e29ce9c1d0bc6ced79ab2e64073456a3 100644 (file)
@@ -11,7 +11,7 @@ MathStackrelInset::MathStackrelInset()
 {}
 
 
-MathInset * MathStackrelInset::clone() const
+InsetBase * MathStackrelInset::clone() const
 {
        return new MathStackrelInset(*this);
 }
index 2474c4929c94795e1ac459c38e9c758e0ff424f8..b7dbb9eab94b4be970878afd641df9019efe5675 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        MathStackrelInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 915c7d3b1a3155463b70a215b153c7aecc182fdc..6899b3108934cd26b273c6c47f39ba0bb5d45bbc 100644 (file)
@@ -13,7 +13,7 @@ MathStringInset::MathStringInset(string const & s)
 {}
 
 
-MathInset * MathStringInset::clone() const
+InsetBase * MathStringInset::clone() const
 {
        return new MathStringInset(*this);
 }
index a449a99fde7bbc7ec77c795754c3d54e3ebb515f..1b36519b132bd5df0ac520b307729e4e9423dfc7 100644 (file)
@@ -17,7 +17,7 @@ public:
        ///
        explicit MathStringInset(string const & s);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 5da53cb4bf78cdb41df82ee9380a06f84c10089a..3f31105a583b163d861962c359fc07db2855fd30 100644 (file)
@@ -11,7 +11,7 @@ MathSubstackInset::MathSubstackInset()
 {}
 
 
-MathInset * MathSubstackInset::clone() const
+InsetBase * MathSubstackInset::clone() const
 {
        return new MathSubstackInset(*this);
 }
index 4d7b8fabf687a85556c8a7e92132c5bd3a07cb69..93e2f552eae13a3bc24a59c7d6660d151e3837ac 100644 (file)
@@ -12,7 +12,7 @@ public:
        ///
        MathSubstackInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index de090d83ab999bb5122a0b324d38c067d68f30bf..85df4b3723d62a6c70363f5e995d146ad5a8c119 100644 (file)
@@ -28,7 +28,7 @@ MathSymbolInset::MathSymbolInset(string const & name)
 
 
 
-MathInset * MathSymbolInset::clone() const
+InsetBase * MathSymbolInset::clone() const
 {
        return new MathSymbolInset(*this);
 }
index f33def2b1c51470bd8072ec8e6995c9954d01307..cb5a9d5915df2c425d557f35cdaec0ebd127dd5e 100644 (file)
@@ -19,7 +19,7 @@ public:
        ///
        explicit MathSymbolInset(string const &);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 7f506bc040754acac176109121a70d01cdafb8cd..31d24f176fafcfd74584edab771701ac82bddfd8 100644 (file)
@@ -33,7 +33,7 @@ MathTabularInset::MathTabularInset(string const & name, char valign,
 {}
 
 
-MathInset * MathTabularInset::clone() const
+InsetBase * MathTabularInset::clone() const
 {
        return new MathTabularInset(*this);
 }
index 62fa37fbaf230b90b4219bb5af16b2199480e2aa..acf619078f4a4fb8e4c9fd758769f20fddba820e 100644 (file)
@@ -23,7 +23,7 @@ public:
        ///
        MathTabularInset(string const &, char valign, string const & halign);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index bc7c9a74f5e5794cad315f163ba85507bcb0d211..e376f93b9ccfb9b1dc0d1281486e920cd4ebb788 100644 (file)
@@ -9,7 +9,7 @@ MathTextInset::MathTextInset()
 {}
 
 
-MathInset * MathTextInset::clone() const
+InsetBase * MathTextInset::clone() const
 {
        return new MathTextInset(*this);
 }
index d276d16f70b25afc2ac4774ee5d700999f222417..dca293bbda9d28f6b0d2db0006d07c73111ab5a5 100644 (file)
@@ -11,7 +11,7 @@ public:
        ///
        MathTextInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        /// get cursor position
        void getPos(idx_type idx, pos_type pos, int & x, int & y) const;
        /// this stores metrics information in cache_
index 93335d3e1649429dc3bdcd1ef7922377e1497d70..03441d8f97458a504dff89c36dc4d5bf7d971259 100644 (file)
@@ -11,7 +11,7 @@ MathUndersetInset::MathUndersetInset()
 {}
 
 
-MathInset * MathUndersetInset::clone() const
+InsetBase * MathUndersetInset::clone() const
 {
        return new MathUndersetInset(*this);
 }
index c4004af554e9837ecd0628b29af109630286c314..3f248fd5b5ae353777950eaf02e48452759e89d6 100644 (file)
@@ -18,7 +18,7 @@ public:
        ///
        MathUndersetInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index bda6e8d7bf08e8129221e482f977b87b74c1e576..26fdbafa6bf29f669e16294cbc4c1837ad3faf6c 100644 (file)
@@ -12,7 +12,7 @@ MathUnknownInset::MathUnknownInset(string const & nm, bool final, bool black)
 {}
 
 
-MathInset * MathUnknownInset::clone() const
+InsetBase * MathUnknownInset::clone() const
 {
        return new MathUnknownInset(*this);
 }
index 6270cdcaebd49f81c51b928d8acd549d52b336ef..49742422dd0b2ede65485941ae03e6f3795f9a39 100644 (file)
@@ -13,7 +13,7 @@ public:
        explicit MathUnknownInset(string const & name,
                bool final = true, bool black = false);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
index 7add8d271571013cc4bccabf6f215e828d897364..4db1538125e6170befe3a135994b8efba7e20734 100644 (file)
@@ -12,7 +12,7 @@ MathXArrowInset::MathXArrowInset(string const & name)
 {}
 
 
-MathInset * MathXArrowInset::clone() const
+InsetBase * MathXArrowInset::clone() const
 {
        return new MathXArrowInset(*this);
 }
index 21d1fcece1564d9f1c90b51cafac6b371e43f169..6039b9d18cb98c2bd51ae5ca3897de47ddfa07ab 100644 (file)
@@ -17,7 +17,7 @@ public:
        ///
        explicit MathXArrowInset(string const & name);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
index 3f812214da977b5b07399dfa60a4894639634738..2935ff3d6267380a13e47b4aedca5ed89c590d16 100644 (file)
@@ -18,7 +18,7 @@ MathXYArrowInset::MathXYArrowInset()
 {}
 
 
-MathInset * MathXYArrowInset::clone() const
+InsetBase * MathXYArrowInset::clone() const
 {
        return new MathXYArrowInset(*this);
 }
index 950db5540b05d5a38798c0aa2aae51945c5d86f3..5bff4211f09c99a4b6c58ceddadaee1c0a5de766 100644 (file)
@@ -15,7 +15,7 @@ public:
        ///
        MathXYArrowInset();
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        void metrics(MetricsInfo & mi) const;
        ///
index 77009c80babf3614ee27e365071078d89cc222a6..aacc6c34eb765e210d5326efd2f89db61e3ff0e8 100644 (file)
@@ -27,7 +27,7 @@ RefInset::RefInset(string const & data)
 {}
 
 
-MathInset * RefInset::clone() const
+InsetBase * RefInset::clone() const
 {
        return new RefInset(*this);
 }
index 7bd24ac4dc0bbf20c9b5dfe46383d7c3303d46e4..c9deda5eb296cd00240e523b36295e96ff8868a0 100644 (file)
@@ -12,7 +12,7 @@ public:
        ///
        explicit RefInset(string const & data);
        ///
-       MathInset * clone() const;
+       InsetBase * clone() const;
        ///
        //void write(WriteStream & os) const;
        ///
index 5d711ee3c0dcdc552a56f14c005e7a92e58bf678..ceb72f684731ee8b78698c20d3b4dc9481bace3b 100644 (file)
@@ -90,7 +90,8 @@ Paragraph::Paragraph(Paragraph const & lp)
        InsetList::iterator it = insetlist.begin();
        InsetList::iterator end = insetlist.end();
        for (; it != end; ++it) {
-               it->inset = it->inset->clone();
+               // currently we hold Inset*, not InsetBase*
+               it->inset = static_cast<Inset*>(it->inset->clone());
                // tell the new inset who is the boss now
                it->inset->parOwner(this);
        }
@@ -117,7 +118,7 @@ void Paragraph::operator=(Paragraph const & lp)
        InsetList::iterator it = insetlist.begin();
        InsetList::iterator end = insetlist.end();
        for (; it != end; ++it) {
-               it->inset = it->inset->clone();
+               it->inset = static_cast<Inset*>(it->inset->clone());
                // tell the new inset who is the boss now
                it->inset->parOwner(this);
        }
@@ -256,7 +257,7 @@ void Paragraph::copyIntoMinibuffer(Buffer const & buffer, pos_type pos) const
        minibuffer_inset = 0;
        if (minibuffer_char == Paragraph::META_INSET) {
                if (getInset(pos)) {
-                       minibuffer_inset = getInset(pos)->clone();
+                       minibuffer_inset = static_cast<Inset *>(getInset(pos)->clone());
                } else {
                        minibuffer_inset = 0;
                        minibuffer_char = ' ';
index 0bba523a1d4a1b13644a7711b518b15636da6a63..b2a60adc34d5b715bd6cec8fa9d54a0d483ffed1 100644 (file)
@@ -2514,17 +2514,11 @@ void LyXTabular::validate(LaTeXFeatures & features) const
 }
 
 
-vector<string> const LyXTabular::getLabelList() const
+void LyXTabular::getLabelList(std::vector<string> & list) const
 {
-       vector<string> label_list;
        for (int i = 0; i < rows_; ++i)
-               for (int j = 0; j < columns_; ++j) {
-                       vector<string> const l =
-                               getCellInset(i, j)->getLabelList();
-                       label_list.insert(label_list.end(),
-                                         l.begin(), l.end());
-               }
-       return label_list;
+               for (int j = 0; j < columns_; ++j)
+                       getCellInset(i, j)->getLabelList(list);
 }
 
 
index aee7edc487236110f5eb4195caacf6e83061de56..47008152d798f8b297c5165f105c63b5093ef1c4 100644 (file)
@@ -382,7 +382,7 @@ public:
        ///
        void validate(LaTeXFeatures &) const;
        ///
-       std::vector<string> const getLabelList() const;
+       void getLabelList(std::vector<string> &) const;
        ///
        /// recalculate the widths/heights only!
        void reinit();