We really need to make Inset::clone take no arguments, this cleans up stuff and makes other things easier to understand... unfortunately it is not so easy...
This patch does it, the brute force way, and as a result you get a lot of nice crashes. Please have a look if you want to exercise your problem solving abilities. Compiles, links and runs "kindo"...
? src/less ? src/frontends/xforms/lyx_forms.h ? src/frontends/xforms/lyx_xpm.h Index: src/paragraph.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v retrieving revision 1.279 diff -u -p -r1.279 paragraph.C --- src/paragraph.C 29 May 2003 11:19:50 -0000 1.279 +++ src/paragraph.C 29 May 2003 16:23:07 -0000 @@ -91,7 +91,7 @@ Paragraph::Paragraph(Paragraph const & l InsetList::iterator it = insetlist.begin(); InsetList::iterator end = insetlist.end(); for (; it != end; ++it) { - it->inset = it->inset->clone(**buffer_); + it->inset = it->inset->clone(); // tell the new inset who is the boss now it->inset->parOwner(this); } @@ -224,14 +224,14 @@ void Paragraph::validate(LaTeXFeatures & // First few functions needed for cut and paste and paragraph breaking. void Paragraph::copyIntoMinibuffer(Buffer const & buffer, pos_type pos) const { - BufferParams bparams = buffer.params; + BufferParams const & bparams = buffer.params; minibuffer_char = getChar(pos); minibuffer_font = getFontSettings(bparams, pos); minibuffer_inset = 0; if (minibuffer_char == Paragraph::META_INSET) { if (getInset(pos)) { - minibuffer_inset = getInset(pos)->clone(buffer); + minibuffer_inset = getInset(pos)->clone(); } else { minibuffer_inset = 0; minibuffer_char = ' '; Index: src/insets/inset.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v retrieving revision 1.94 diff -u -p -r1.94 inset.h --- src/insets/inset.h 28 May 2003 23:09:14 -0000 1.94 +++ src/insets/inset.h 29 May 2003 16:23:08 -0000 @@ -209,7 +209,7 @@ public: } /// - virtual Inset * clone(Buffer const &) const = 0; + virtual Inset * clone() const = 0; /// returns true to override begin and end inset in file virtual bool directWrite() const; Index: src/insets/insetbibitem.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.C,v retrieving revision 1.14 diff -u -p -r1.14 insetbibitem.C --- src/insets/insetbibitem.C 28 May 2003 06:47:15 -0000 1.14 +++ src/insets/insetbibitem.C 29 May 2003 16:23:08 -0000 @@ -43,20 +43,10 @@ InsetBibitem::~InsetBibitem() } -Inset * InsetBibitem::clone(Buffer const &) const +Inset * InsetBibitem::clone() const { - InsetBibitem * b = new InsetBibitem(params()); - b->setCounter(counter); - return b; + return new InsetBibitem(*this); } - - -// Inset * InsetBibitem::clone(Buffer const &, bool) const -// { -// InsetBibitem * b = new InsetBibitem(params()); -// b->setCounter(counter); -// return b; -// } dispatch_result InsetBibitem::localDispatch(FuncRequest const & cmd) Index: src/insets/insetbibitem.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.h,v retrieving revision 1.7 diff -u -p -r1.7 insetbibitem.h --- src/insets/insetbibitem.h 28 May 2003 23:09:14 -0000 1.7 +++ src/insets/insetbibitem.h 29 May 2003 16:23:08 -0000 @@ -29,7 +29,7 @@ public: /// ~InsetBibitem(); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// virtual dispatch_result localDispatch(FuncRequest const & cmd); /** Currently \bibitem is used as a LyX2.x command, Index: src/insets/insetbibtex.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibtex.h,v retrieving revision 1.9 diff -u -p -r1.9 insetbibtex.h --- src/insets/insetbibtex.h 28 May 2003 23:09:14 -0000 1.9 +++ src/insets/insetbibtex.h 29 May 2003 16:23:08 -0000 @@ -27,7 +27,7 @@ public: /// ~InsetBibtex(); /// - Inset * clone(Buffer const &) const { + Inset * clone() const { return new InsetBibtex(params()); } /// small wrapper for the time being Index: src/insets/insetcite.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.h,v retrieving revision 1.33 diff -u -p -r1.33 insetcite.h --- src/insets/insetcite.h 28 May 2003 23:09:14 -0000 1.33 +++ src/insets/insetcite.h 29 May 2003 16:23:08 -0000 @@ -25,7 +25,7 @@ public: /// ~InsetCitation(); /// - Inset * clone(Buffer const &) const { + Inset * clone() const { return new InsetCitation(params()); } /// Index: src/insets/insetcommand.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.h,v retrieving revision 1.63 diff -u -p -r1.63 insetcommand.h --- src/insets/insetcommand.h 28 May 2003 23:09:14 -0000 1.63 +++ src/insets/insetcommand.h 29 May 2003 16:23:08 -0000 @@ -27,7 +27,7 @@ */ /// -class InsetCommand : public InsetButton, boost::noncopyable { +class InsetCommand : public InsetButton { public: /// explicit Index: src/insets/insetenv.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetenv.C,v retrieving revision 1.10 diff -u -p -r1.10 insetenv.C --- src/insets/insetenv.C 28 May 2003 23:09:14 -0000 1.10 +++ src/insets/insetenv.C 29 May 2003 16:23:08 -0000 @@ -40,7 +40,7 @@ InsetEnvironment::InsetEnvironment(Inset {} -Inset * InsetEnvironment::clone(Buffer const &) const +Inset * InsetEnvironment::clone() const { return new InsetEnvironment(*this); } Index: src/insets/insetenv.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetenv.h,v retrieving revision 1.8 diff -u -p -r1.8 insetenv.h --- src/insets/insetenv.h 28 May 2003 23:09:14 -0000 1.8 +++ src/insets/insetenv.h 29 May 2003 16:23:08 -0000 @@ -26,7 +26,7 @@ public: /// void read(Buffer const * buf, LyXLex & lex); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; } /// Index: src/insets/inseterror.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inseterror.h,v retrieving revision 1.58 diff -u -p -r1.58 inseterror.h --- src/insets/inseterror.h 28 May 2003 23:09:14 -0000 1.58 +++ src/insets/inseterror.h 29 May 2003 16:23:08 -0000 @@ -53,7 +53,7 @@ public: /// EDITABLE editable() const { return IS_EDITABLE; } /// - Inset * clone(Buffer const &) const { + Inset * clone() const { return new InsetError(contents); } /// Index: src/insets/insetert.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v retrieving revision 1.126 diff -u -p -r1.126 insetert.C --- src/insets/insetert.C 28 May 2003 23:09:14 -0000 1.126 +++ src/insets/insetert.C 29 May 2003 16:23:08 -0000 @@ -70,7 +70,7 @@ InsetERT::InsetERT(InsetERT const & in) } -Inset * InsetERT::clone(Buffer const &) const +Inset * InsetERT::clone() const { return new InsetERT(*this); } Index: src/insets/insetert.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.h,v retrieving revision 1.72 diff -u -p -r1.72 insetert.h --- src/insets/insetert.h 28 May 2003 23:09:14 -0000 1.72 +++ src/insets/insetert.h 29 May 2003 16:23:08 -0000 @@ -40,7 +40,7 @@ public: /// InsetERT(InsetERT const &); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// InsetERT(BufferParams const &, Language const *, string const & contents, bool collapsed); Index: src/insets/insetexternal.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.C,v retrieving revision 1.73 diff -u -p -r1.73 insetexternal.C --- src/insets/insetexternal.C 28 May 2003 23:09:14 -0000 1.73 +++ src/insets/insetexternal.C 29 May 2003 16:23:08 -0000 @@ -223,12 +223,9 @@ void InsetExternal::validate(LaTeXFeatur } -Inset * InsetExternal::clone(Buffer const &) const +Inset * InsetExternal::clone() const { - InsetExternal * inset = new InsetExternal; - inset->params_ = params_; - inset->view_ = view_; - return inset; + return new InsetExternal(*this); } Index: src/insets/insetexternal.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.h,v retrieving revision 1.35 diff -u -p -r1.35 insetexternal.h --- src/insets/insetexternal.h 28 May 2003 23:09:14 -0000 1.35 +++ src/insets/insetexternal.h 29 May 2003 16:23:08 -0000 @@ -69,7 +69,7 @@ public: virtual Inset::Code lyxCode() const { return EXTERNAL_CODE; } /// - virtual Inset * clone(Buffer const &) const; + virtual Inset * clone() const; /// returns the text of the button virtual string const getScreenLabel(Buffer const *) const; Index: src/insets/insetfloat.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.C,v retrieving revision 1.81 diff -u -p -r1.81 insetfloat.C --- src/insets/insetfloat.C 28 May 2003 23:09:14 -0000 1.81 +++ src/insets/insetfloat.C 29 May 2003 16:23:08 -0000 @@ -259,7 +259,7 @@ void InsetFloat::validate(LaTeXFeatures } -Inset * InsetFloat::clone(Buffer const &) const +Inset * InsetFloat::clone() const { return new InsetFloat(*this); } Index: src/insets/insetfloat.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.h,v retrieving revision 1.43 diff -u -p -r1.43 insetfloat.h --- src/insets/insetfloat.h 28 May 2003 23:09:14 -0000 1.43 +++ src/insets/insetfloat.h 29 May 2003 16:23:08 -0000 @@ -53,7 +53,7 @@ public: /// void validate(LaTeXFeatures & features) const; /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::FLOAT_CODE; } /// Index: src/insets/insetfloatlist.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloatlist.h,v retrieving revision 1.22 diff -u -p -r1.22 insetfloatlist.h --- src/insets/insetfloatlist.h 26 May 2003 09:13:53 -0000 1.22 +++ src/insets/insetfloatlist.h 29 May 2003 16:23:08 -0000 @@ -26,13 +26,9 @@ public: /// ~InsetFloatList(); /// - Inset * clone(Buffer const &) const { + Inset * clone() const { return new InsetFloatList(getCmdName()); } - /// - //Inset * clone(Buffer const &, bool = false) const { - // return new InsetFloatList(getCmdName()); - //} /// dispatch_result localDispatch(FuncRequest const & cmd); /// Index: src/insets/insetfoot.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfoot.C,v retrieving revision 1.58 diff -u -p -r1.58 insetfoot.C --- src/insets/insetfoot.C 28 May 2003 23:09:14 -0000 1.58 +++ src/insets/insetfoot.C 29 May 2003 16:23:08 -0000 @@ -46,7 +46,7 @@ InsetFoot::InsetFoot(InsetFoot const & i } -Inset * InsetFoot::clone(Buffer const &) const +Inset * InsetFoot::clone() const { return new InsetFoot(*this); } Index: src/insets/insetfoot.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfoot.h,v retrieving revision 1.40 diff -u -p -r1.40 insetfoot.h --- src/insets/insetfoot.h 28 May 2003 23:09:14 -0000 1.40 +++ src/insets/insetfoot.h 29 May 2003 16:23:08 -0000 @@ -27,7 +27,7 @@ public: /// InsetFoot(InsetFoot const &); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::FOOT_CODE; } /// Index: src/insets/insetgraphics.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v retrieving revision 1.176 diff -u -p -r1.176 insetgraphics.C --- src/insets/insetgraphics.C 28 May 2003 23:09:14 -0000 1.176 +++ src/insets/insetgraphics.C 29 May 2003 16:23:08 -0000 @@ -192,6 +192,12 @@ InsetGraphics::InsetGraphics() {} +InsetGraphics::InsetGraphics(InsetGraphics const & ig) + : Inset(ig), boost::signals::trackable(ig), + graphic_label(uniqueID()), cache_(new Cache(*this)) +{} + + InsetGraphics::InsetGraphics(InsetGraphics const & ig, string const & filepath) : Inset(ig), @@ -202,9 +208,9 @@ InsetGraphics::InsetGraphics(InsetGraphi } -Inset * InsetGraphics::clone(Buffer const & buffer) const +Inset * InsetGraphics::clone() const { - return new InsetGraphics(*this, buffer.filePath()); + return new InsetGraphics(*this); } Index: src/insets/insetgraphics.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.h,v retrieving revision 1.68 diff -u -p -r1.68 insetgraphics.h --- src/insets/insetgraphics.h 28 May 2003 23:09:14 -0000 1.68 +++ src/insets/insetgraphics.h 29 May 2003 16:23:09 -0000 @@ -28,6 +28,8 @@ public: /// InsetGraphics(); /// + InsetGraphics(InsetGraphics const &); + /// InsetGraphics(InsetGraphics const &, string const & filepath); /// ~InsetGraphics(); @@ -66,7 +68,7 @@ public: Inset::Code lyxCode() const { return Inset::GRAPHICS_CODE; } /// - virtual Inset * clone(Buffer const &) const; + virtual Inset * clone() const; /** Set the inset parameters, used by the GUIndependent dialog. Return true of new params are different from what was so far. Index: src/insets/insethfill.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insethfill.h,v retrieving revision 1.8 diff -u -p -r1.8 insethfill.h --- src/insets/insethfill.h 28 May 2003 23:09:14 -0000 1.8 +++ src/insets/insethfill.h 29 May 2003 16:23:09 -0000 @@ -20,7 +20,7 @@ public: /// InsetHFill(); /// - virtual Inset * clone(Buffer const &) const { + virtual Inset * clone() const { return new InsetHFill; } /// Index: src/insets/insetinclude.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v retrieving revision 1.118 diff -u -p -r1.118 insetinclude.C --- src/insets/insetinclude.C 28 May 2003 16:36:54 -0000 1.118 +++ src/insets/insetinclude.C 29 May 2003 16:23:09 -0000 @@ -95,6 +95,11 @@ InsetInclude::InsetInclude(Params const {} +InsetInclude::InsetInclude(InsetInclude const & ii) + : InsetButton(ii) +{} + + InsetInclude::InsetInclude(InsetCommandParams const & p, Buffer const & b) : include_label(uniqueID()), preview_(new PreviewImpl(*this)) @@ -191,22 +196,10 @@ void InsetInclude::set(Params const & p) } -Inset * InsetInclude::clone(Buffer const & buffer) const +Inset * InsetInclude::clone() const { - Params p(params_); - p.masterFilename_ = buffer.fileName(); - - return new InsetInclude(p); + return new InsetInclude(*this); } - - -// Inset * InsetInclude::clone(Buffer const & buffer, bool) const -// { -// Params p(params_); -// p.masterFilename_ = buffer.fileName(); - -// return new InsetInclude(p); -// } void InsetInclude::write(Buffer const *, ostream & os) const Index: src/insets/insetinclude.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.h,v retrieving revision 1.66 diff -u -p -r1.66 insetinclude.h --- src/insets/insetinclude.h 28 May 2003 23:09:14 -0000 1.66 +++ src/insets/insetinclude.h 29 May 2003 16:23:09 -0000 @@ -22,7 +22,7 @@ struct LaTeXFeatures; // Created by AAS 970521 /// for including tex/lyx files -class InsetInclude: public InsetButton, boost::noncopyable { +class InsetInclude: public InsetButton { public: /// the type of inclusion enum Flags { @@ -52,6 +52,8 @@ public: /// InsetInclude(Params const &); /// + InsetInclude(InsetInclude const &); + /// InsetInclude(InsetCommandParams const &, Buffer const &); ~InsetInclude(); @@ -74,7 +76,7 @@ public: void set(Params const & params); /// - virtual Inset * clone(Buffer const &) const; + virtual Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; } /// This returns the list of labels on the child buffer Index: src/insets/insetindex.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetindex.h,v retrieving revision 1.36 diff -u -p -r1.36 insetindex.h --- src/insets/insetindex.h 28 May 2003 23:09:14 -0000 1.36 +++ src/insets/insetindex.h 29 May 2003 16:23:09 -0000 @@ -26,7 +26,7 @@ public: /// ~InsetIndex(); /// - virtual Inset * clone(Buffer const &) const { + virtual Inset * clone() const { return new InsetIndex(params()); } /// @@ -49,7 +49,7 @@ public: /// ~InsetPrintIndex(); /// - Inset * clone(Buffer const &) const { + Inset * clone() const { return new InsetPrintIndex(params()); } /// Index: src/insets/insetlabel.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlabel.h,v retrieving revision 1.45 diff -u -p -r1.45 insetlabel.h --- src/insets/insetlabel.h 28 May 2003 23:09:14 -0000 1.45 +++ src/insets/insetlabel.h 29 May 2003 16:23:09 -0000 @@ -22,7 +22,7 @@ public: /// ~InsetLabel(); /// - virtual Inset * clone(Buffer const &) const { + virtual Inset * clone() const { return new InsetLabel(params()); } /// Index: src/insets/insetlatexaccent.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlatexaccent.C,v retrieving revision 1.68 diff -u -p -r1.68 insetlatexaccent.C --- src/insets/insetlatexaccent.C 27 May 2003 13:54:59 -0000 1.68 +++ src/insets/insetlatexaccent.C 29 May 2003 16:23:09 -0000 @@ -656,8 +656,9 @@ bool InsetLatexAccent::directWrite() con } -Inset * InsetLatexAccent::clone(Buffer const &) const +Inset * InsetLatexAccent::clone() const { + #warning FIXME Use copy-constructor here. (Lgb) return new InsetLatexAccent(contents); } Index: src/insets/insetlatexaccent.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlatexaccent.h,v retrieving revision 1.49 diff -u -p -r1.49 insetlatexaccent.h --- src/insets/insetlatexaccent.h 28 May 2003 23:09:14 -0000 1.49 +++ src/insets/insetlatexaccent.h 29 May 2003 16:23:09 -0000 @@ -60,7 +60,7 @@ public: /// bool directWrite() const; /// - virtual Inset * clone(Buffer const &) const; + virtual Inset * clone() const; /// Inset::Code lyxCode()const; /// Index: src/insets/insetmarginal.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetmarginal.C,v retrieving revision 1.27 diff -u -p -r1.27 insetmarginal.C --- src/insets/insetmarginal.C 28 May 2003 23:09:14 -0000 1.27 +++ src/insets/insetmarginal.C 29 May 2003 16:23:09 -0000 @@ -41,7 +41,7 @@ InsetMarginal::InsetMarginal(InsetMargin } -Inset * InsetMarginal::clone(Buffer const &) const +Inset * InsetMarginal::clone() const { return new InsetMarginal(*this); } Index: src/insets/insetmarginal.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetmarginal.h,v retrieving revision 1.22 diff -u -p -r1.22 insetmarginal.h --- src/insets/insetmarginal.h 28 May 2003 23:09:14 -0000 1.22 +++ src/insets/insetmarginal.h 29 May 2003 16:23:09 -0000 @@ -26,7 +26,7 @@ public: /// InsetMarginal(InsetMarginal const &); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::MARGIN_CODE; } /// Index: src/insets/insetminipage.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v retrieving revision 1.75 diff -u -p -r1.75 insetminipage.C --- src/insets/insetminipage.C 28 May 2003 23:09:14 -0000 1.75 +++ src/insets/insetminipage.C 29 May 2003 16:23:09 -0000 @@ -93,7 +93,7 @@ InsetMinipage::InsetMinipage(InsetMinipa {} -Inset * InsetMinipage::clone(Buffer const &) const +Inset * InsetMinipage::clone() const { return new InsetMinipage(*this); } Index: src/insets/insetminipage.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.h,v retrieving revision 1.43 diff -u -p -r1.43 insetminipage.h --- src/insets/insetminipage.h 28 May 2003 23:09:14 -0000 1.43 +++ src/insets/insetminipage.h 29 May 2003 16:23:09 -0000 @@ -66,7 +66,7 @@ public: /// void read(Buffer const * buf, LyXLex & lex); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// void dimension(BufferView *, LyXFont const &, Dimension &) const; /// Index: src/insets/insetnewline.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnewline.h,v retrieving revision 1.8 diff -u -p -r1.8 insetnewline.h --- src/insets/insetnewline.h 28 May 2003 23:09:14 -0000 1.8 +++ src/insets/insetnewline.h 29 May 2003 16:23:09 -0000 @@ -20,7 +20,7 @@ public: InsetNewline() {} - virtual Inset * clone(Buffer const &) const { + virtual Inset * clone() const { return new InsetNewline; } Index: src/insets/insetnote.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.C,v retrieving revision 1.24 diff -u -p -r1.24 insetnote.C --- src/insets/insetnote.C 28 May 2003 23:09:14 -0000 1.24 +++ src/insets/insetnote.C 29 May 2003 16:23:09 -0000 @@ -53,7 +53,7 @@ InsetNote::InsetNote(InsetNote const & i } -Inset * InsetNote::clone(Buffer const &) const +Inset * InsetNote::clone() const { return new InsetNote(*this); } Index: src/insets/insetnote.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.h,v retrieving revision 1.20 diff -u -p -r1.20 insetnote.h --- src/insets/insetnote.h 28 May 2003 23:09:14 -0000 1.20 +++ src/insets/insetnote.h 29 May 2003 16:23:09 -0000 @@ -25,7 +25,7 @@ public: /// InsetNote(InsetNote const &); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// string const editMessage() const; /// Index: src/insets/insetoptarg.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetoptarg.C,v retrieving revision 1.10 diff -u -p -r1.10 insetoptarg.C --- src/insets/insetoptarg.C 28 May 2003 23:09:14 -0000 1.10 +++ src/insets/insetoptarg.C 29 May 2003 16:23:09 -0000 @@ -47,7 +47,7 @@ InsetOptArg::InsetOptArg(InsetOptArg con } -Inset * InsetOptArg::clone(Buffer const &) const +Inset * InsetOptArg::clone() const { return new InsetOptArg(*this); } Index: src/insets/insetoptarg.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetoptarg.h,v retrieving revision 1.11 diff -u -p -r1.11 insetoptarg.h --- src/insets/insetoptarg.h 28 May 2003 23:09:14 -0000 1.11 +++ src/insets/insetoptarg.h 29 May 2003 16:23:09 -0000 @@ -27,7 +27,7 @@ public: InsetOptArg(InsetOptArg const &); /// make a duplicate of this inset - Inset * clone(Buffer const &) const; + Inset * clone() const; /// this inset is editable EDITABLE editable() const { return IS_EDITABLE; } /// code of the inset Index: src/insets/insetparent.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetparent.C,v retrieving revision 1.51 diff -u -p -r1.51 insetparent.C --- src/insets/insetparent.C 28 May 2003 16:36:54 -0000 1.51 +++ src/insets/insetparent.C 29 May 2003 16:23:09 -0000 @@ -35,12 +35,11 @@ InsetParent::InsetParent(InsetCommandPar } -// InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf, bool) -// : InsetCommand(p, false) -// { -// string const fn = p.getContents(); -// setContents(MakeAbsPath(fn, bf.filePath())); -// } +Inset * InsetParent::clone() const +{ +#warning FIXME Use copy-constructor here. (Lgb) + return new InsetParent(*this); +} string const InsetParent::getScreenLabel(Buffer const *) const Index: src/insets/insetparent.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetparent.h,v retrieving revision 1.41 diff -u -p -r1.41 insetparent.h --- src/insets/insetparent.h 28 May 2003 23:09:14 -0000 1.41 +++ src/insets/insetparent.h 29 May 2003 16:23:09 -0000 @@ -27,9 +27,7 @@ public: /// InsetParent(InsetCommandParams const &, Buffer const &); /// - virtual Inset * clone(Buffer const & buffer) const { - return new InsetParent(params(), buffer); - } + virtual Inset * clone() const; /// dispatch_result localDispatch(FuncRequest const & cmd); /// Index: src/insets/insetquotes.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetquotes.C,v retrieving revision 1.90 diff -u -p -r1.90 insetquotes.C --- src/insets/insetquotes.C 27 May 2003 13:54:59 -0000 1.90 +++ src/insets/insetquotes.C 29 May 2003 16:23:09 -0000 @@ -351,8 +351,9 @@ void InsetQuotes::validate(LaTeXFeatures } -Inset * InsetQuotes::clone(Buffer const &) const +Inset * InsetQuotes::clone() const { + #warning FIXME Use copy-constructor here. (Lgb) return new InsetQuotes(language_, side_, times_); } Index: src/insets/insetquotes.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetquotes.h,v retrieving revision 1.48 diff -u -p -r1.48 insetquotes.h --- src/insets/insetquotes.h 28 May 2003 23:09:14 -0000 1.48 +++ src/insets/insetquotes.h 29 May 2003 16:23:09 -0000 @@ -68,7 +68,7 @@ public: /// Create the right quote inset after character c InsetQuotes(char c, BufferParams const & params); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// void dimension(BufferView *, LyXFont const &, Dimension &) const; /// Index: src/insets/insetref.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.C,v retrieving revision 1.65 diff -u -p -r1.65 insetref.C --- src/insets/insetref.C 28 May 2003 16:36:54 -0000 1.65 +++ src/insets/insetref.C 29 May 2003 16:23:09 -0000 @@ -39,6 +39,12 @@ InsetRef::~InsetRef() } +Inset * InsetRef::clone() const +{ + return new InsetRef(*this); +} + + dispatch_result InsetRef::localDispatch(FuncRequest const & cmd) { switch (cmd.action) { Index: src/insets/insetref.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.h,v retrieving revision 1.48 diff -u -p -r1.48 insetref.h --- src/insets/insetref.h 28 May 2003 23:09:14 -0000 1.48 +++ src/insets/insetref.h 29 May 2003 16:23:09 -0000 @@ -40,9 +40,7 @@ public: /// ~InsetRef(); /// - virtual Inset * clone(Buffer const & buffer) const { - return new InsetRef(params(), buffer); - } + virtual Inset * clone() const; /// dispatch_result localDispatch(FuncRequest const & cmd); /// Index: src/insets/insetspace.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspace.C,v retrieving revision 1.7 diff -u -p -r1.7 insetspace.C --- src/insets/insetspace.C 28 May 2003 06:47:15 -0000 1.7 +++ src/insets/insetspace.C 29 May 2003 16:23:09 -0000 @@ -254,8 +254,9 @@ int InsetSpace::docbook(Buffer const *, } -Inset * InsetSpace::clone(Buffer const &) const +Inset * InsetSpace::clone() const { + #warning FIXME Use copy-constructor here. (Lgb) return new InsetSpace(kind_); } Index: src/insets/insetspace.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspace.h,v retrieving revision 1.7 diff -u -p -r1.7 insetspace.h --- src/insets/insetspace.h 28 May 2003 23:09:14 -0000 1.7 +++ src/insets/insetspace.h 29 May 2003 16:23:09 -0000 @@ -71,7 +71,7 @@ public: /// int docbook(Buffer const *, std::ostream &, bool mixcont) const; /// - virtual Inset * clone(Buffer const &) const; + virtual Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::SPACE_CODE; } /// We don't need \begin_inset and \end_inset Index: src/insets/insetspecialchar.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspecialchar.C,v retrieving revision 1.67 diff -u -p -r1.67 insetspecialchar.C --- src/insets/insetspecialchar.C 27 May 2003 13:54:59 -0000 1.67 +++ src/insets/insetspecialchar.C 29 May 2003 16:23:09 -0000 @@ -244,8 +244,9 @@ int InsetSpecialChar::docbook(Buffer con } -Inset * InsetSpecialChar::clone(Buffer const &) const +Inset * InsetSpecialChar::clone() const { +#warning FIXME Use copy-contructor here. (Lgb) return new InsetSpecialChar(kind_); } Index: src/insets/insetspecialchar.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspecialchar.h,v retrieving revision 1.51 diff -u -p -r1.51 insetspecialchar.h --- src/insets/insetspecialchar.h 28 May 2003 23:09:14 -0000 1.51 +++ src/insets/insetspecialchar.h 29 May 2003 16:23:09 -0000 @@ -63,7 +63,7 @@ public: /// int docbook(Buffer const *, std::ostream &, bool mixcont) const; /// - virtual Inset * clone(Buffer const &) const; + virtual Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; } /// We don't need \begin_inset and \end_inset Index: src/insets/insettabular.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v retrieving revision 1.281 diff -u -p -r1.281 insettabular.C --- src/insets/insettabular.C 28 May 2003 23:09:14 -0000 1.281 +++ src/insets/insettabular.C 29 May 2003 16:23:10 -0000 @@ -193,6 +193,23 @@ InsetTabular::InsetTabular(InsetTabular } +InsetTabular::InsetTabular(InsetTabular const & tab) + : UpdatableInset(tab), tabular(new LyXTabular(*tab.tabular)) +{ + the_locking_inset = 0; + old_locking_inset = 0; + locked = false; + oldcell = -1; + actrow = actcell = 0; + clearSelection(); + need_update = INIT; + in_update = false; + in_reset_pos = 0; + inset_x = 0; + inset_y = 0; +} + + InsetTabular::~InsetTabular() { InsetTabularMailer mailer(*this); @@ -200,9 +217,10 @@ InsetTabular::~InsetTabular() } -Inset * InsetTabular::clone(Buffer const & buf) const +Inset * InsetTabular::clone() const { - return new InsetTabular(*this, buf); + #warning FIXME Use copy-constructor here. (Lgb) + return new InsetTabular(*this); } Index: src/insets/insettabular.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.h,v retrieving revision 1.119 diff -u -p -r1.119 insettabular.h --- src/insets/insettabular.h 28 May 2003 23:09:14 -0000 1.119 +++ src/insets/insettabular.h 29 May 2003 16:23:10 -0000 @@ -76,11 +76,13 @@ public: /// InsetTabular(Buffer const &, int rows = 1, int columns = 1); /// + InsetTabular(InsetTabular const &); + /// InsetTabular(InsetTabular const &, Buffer const &); /// ~InsetTabular(); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// void read(Buffer const *, LyXLex &); /// Index: src/insets/insettext.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v retrieving revision 1.402 diff -u -p -r1.402 insettext.C --- src/insets/insettext.C 29 May 2003 01:13:17 -0000 1.402 +++ src/insets/insettext.C 29 May 2003 16:23:11 -0000 @@ -224,7 +224,7 @@ void InsetText::clear(bool just_mark_era } -Inset * InsetText::clone(Buffer const &) const +Inset * InsetText::clone() const { return new InsetText(*this); } Index: src/insets/insettext.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.h,v retrieving revision 1.164 diff -u -p -r1.164 insettext.h --- src/insets/insettext.h 28 May 2003 23:09:15 -0000 1.164 +++ src/insets/insettext.h 29 May 2003 16:23:11 -0000 @@ -77,7 +77,7 @@ public: /// ~InsetText(); /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// InsetText & operator=(InsetText const & it); /// empty inset to empty par, or just mark as erased Index: src/insets/insettheorem.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettheorem.h,v retrieving revision 1.15 diff -u -p -r1.15 insettheorem.h --- src/insets/insettheorem.h 28 May 2003 23:09:16 -0000 1.15 +++ src/insets/insettheorem.h 29 May 2003 16:23:11 -0000 @@ -25,7 +25,7 @@ public: /// void write(Buffer const * buf, std::ostream & os) const; /// - virtual Inset * clone(Buffer const &) const; + virtual Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::THEOREM_CODE; } /// Index: src/insets/insettoc.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettoc.h,v retrieving revision 1.40 diff -u -p -r1.40 insettoc.h --- src/insets/insettoc.h 28 May 2003 23:09:16 -0000 1.40 +++ src/insets/insettoc.h 29 May 2003 16:23:11 -0000 @@ -24,7 +24,7 @@ public: /// ~InsetTOC(); /// - virtual Inset * clone(Buffer const &) const { + virtual Inset * clone() const { return new InsetTOC(params()); } /// Index: src/insets/inseturl.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inseturl.h,v retrieving revision 1.54 diff -u -p -r1.54 inseturl.h --- src/insets/inseturl.h 28 May 2003 23:09:16 -0000 1.54 +++ src/insets/inseturl.h 29 May 2003 16:23:11 -0000 @@ -27,7 +27,7 @@ public: /// ~InsetUrl(); /// - virtual Inset * clone(Buffer const &) const { + virtual Inset * clone() const { return new InsetUrl(params()); } /// Index: src/insets/insetwrap.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetwrap.C,v retrieving revision 1.25 diff -u -p -r1.25 insetwrap.C --- src/insets/insetwrap.C 28 May 2003 23:09:16 -0000 1.25 +++ src/insets/insetwrap.C 29 May 2003 16:23:11 -0000 @@ -180,7 +180,7 @@ void InsetWrap::validate(LaTeXFeatures & } -Inset * InsetWrap::clone(Buffer const &) const +Inset * InsetWrap::clone() const { return new InsetWrap(*this); } Index: src/insets/insetwrap.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetwrap.h,v retrieving revision 1.13 diff -u -p -r1.13 insetwrap.h --- src/insets/insetwrap.h 28 May 2003 23:09:16 -0000 1.13 +++ src/insets/insetwrap.h 29 May 2003 16:23:11 -0000 @@ -51,7 +51,7 @@ public: /// void validate(LaTeXFeatures & features) const; /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// Inset::Code lyxCode() const { return Inset::WRAP_CODE; } /// Index: src/mathed/formula.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formula.C,v retrieving revision 1.265 diff -u -p -r1.265 formula.C --- src/mathed/formula.C 28 May 2003 13:22:33 -0000 1.265 +++ src/mathed/formula.C 29 May 2003 16:23:11 -0000 @@ -113,7 +113,7 @@ InsetFormula::~InsetFormula() {} -Inset * InsetFormula::clone(Buffer const &) const +Inset * InsetFormula::clone() const { return new InsetFormula(*this); } Index: src/mathed/formula.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formula.h,v retrieving revision 1.86 diff -u -p -r1.86 formula.h --- src/mathed/formula.h 28 May 2003 23:09:16 -0000 1.86 +++ src/mathed/formula.h 29 May 2003 16:23:11 -0000 @@ -54,7 +54,7 @@ public: int docbook(Buffer const *, std::ostream &, bool mixcont) const; /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// void validate(LaTeXFeatures & features) const; /// Index: src/mathed/formulabase.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.h,v retrieving revision 1.68 diff -u -p -r1.68 formulabase.h --- src/mathed/formulabase.h 28 May 2003 23:09:16 -0000 1.68 +++ src/mathed/formulabase.h 29 May 2003 16:23:11 -0000 @@ -30,7 +30,7 @@ public: /// InsetFormulaBase(); /// - Inset * clone(Buffer const &) const = 0; + Inset * clone() const = 0; /// virtual void draw(BufferView *,LyXFont const &, int, float &) const = 0; /// lowest x coordinate Index: src/mathed/formulamacro.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.C,v retrieving revision 1.124 diff -u -p -r1.124 formulamacro.C --- src/mathed/formulamacro.C 28 May 2003 13:22:33 -0000 1.124 +++ src/mathed/formulamacro.C 29 May 2003 16:23:11 -0000 @@ -65,7 +65,7 @@ InsetFormulaMacro::InsetFormulaMacro(str } -Inset * InsetFormulaMacro::clone(Buffer const &) const +Inset * InsetFormulaMacro::clone() const { return new InsetFormulaMacro(*this); } Index: src/mathed/formulamacro.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.h,v retrieving revision 1.64 diff -u -p -r1.64 formulamacro.h --- src/mathed/formulamacro.h 28 May 2003 23:09:16 -0000 1.64 +++ src/mathed/formulamacro.h 29 May 2003 16:23:11 -0000 @@ -52,7 +52,7 @@ public: int docbook(Buffer const *, std::ostream &, bool mixcont) const; /// - Inset * clone(Buffer const &) const; + Inset * clone() const; /// Inset::Code lyxCode() const; /// Index: src/mathed/math_exfuncinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_exfuncinset.C,v retrieving revision 1.25 diff -u -p -r1.25 math_exfuncinset.C --- src/mathed/math_exfuncinset.C 28 May 2003 13:22:34 -0000 1.25 +++ src/mathed/math_exfuncinset.C 29 May 2003 16:23:11 -0000 @@ -1,4 +1,3 @@ - #include <config.h> #include "math_exfuncinset.h" @@ -28,6 +27,7 @@ MathInset * MathExFuncInset::clone() con Dimension MathExFuncInset::metrics(MetricsInfo & mi) const { mathed_string_dim(mi.base.font, name_, dim_); +#warning FIXME This is supposed to return what? (Lgb) }
-- Lgb