From 4029fc8836d114b29e5c688001163b7617d8cbc2 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Wed, 23 Feb 2005 12:01:50 +0000 Subject: [PATCH] implement missing doClone methods git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9670 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 4 ++++ src/insets/insetcaption.C | 9 ++++++++- src/insets/insetcaption.h | 3 +++ src/mathed/ChangeLog | 6 ++++++ src/mathed/math_parinset.C | 9 +++++++++ src/mathed/math_parinset.h | 3 +++ src/mathed/ref_inset.C | 2 +- src/mathed/ref_inset.h | 5 +++-- 8 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 5d6f61a7d0..0cf481f7e6 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2005-02-23 Georg Baum + + * insetcaption.[Ch] (doClone): implement + 2005-02-22 Georg Baum * insetgraphics.C (prepareFile): handle non-existing files diff --git a/src/insets/insetcaption.C b/src/insets/insetcaption.C index 72e83e4bff..a3f37890ea 100644 --- a/src/insets/insetcaption.C +++ b/src/insets/insetcaption.C @@ -34,6 +34,7 @@ using lyx::support::bformat; +using std::auto_ptr; using std::endl; using std::string; using std::ostream; @@ -138,7 +139,7 @@ int InsetCaption::latex(Buffer const & buf, ostream & os, int InsetCaption::plaintext(Buffer const & /*buf*/,ostream & /*os*/, OutputParams const & /*runparams*/) const { - // FIX: Implement me! + // FIXME: Implement me! return 0; } @@ -152,3 +153,9 @@ int InsetCaption::docbook(Buffer const & buf, ostream & os, os << "\n"; return ret; } + + +auto_ptr InsetCaption::doClone() const +{ + return auto_ptr(new InsetCaption(*this)); +} diff --git a/src/insets/insetcaption.h b/src/insets/insetcaption.h index 6d81c579f6..c356bc7713 100644 --- a/src/insets/insetcaption.h +++ b/src/insets/insetcaption.h @@ -42,6 +42,9 @@ public: /// int docbook(Buffer const & buf, std::ostream & os, OutputParams const & runparams) const; +private: + /// + virtual std::auto_ptr doClone() const; }; diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 560261bfad..2cd9ed062f 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,9 @@ +2005-02-23 Georg Baum + + * math_parinset.[Ch] (doClone): Implement, avoids triggering the + assert in InsetBase::clone() + * ref_inset.[Ch] (clone): rename to doClone + 2005-02-14 Angus Leeming * math_rootinset.C (idxUpDown): Silence an MSVC compiler warning diff --git a/src/mathed/math_parinset.C b/src/mathed/math_parinset.C index 28e2209f1f..3f2baae0dd 100644 --- a/src/mathed/math_parinset.C +++ b/src/mathed/math_parinset.C @@ -16,6 +16,9 @@ #include "support/std_ostream.h" +using std::auto_ptr; + + MathParInset::MathParInset(MathArray const & ar) { cells_[0] = ar; @@ -48,3 +51,9 @@ void MathParInset::infoize(std::ostream & os) const { os << "Type: Paragraph "; } + + +auto_ptr MathParInset::doClone() const +{ + return auto_ptr(new MathParInset(*this)); +} diff --git a/src/mathed/math_parinset.h b/src/mathed/math_parinset.h index 6be910752d..0c32eb6354 100644 --- a/src/mathed/math_parinset.h +++ b/src/mathed/math_parinset.h @@ -31,6 +31,9 @@ public: void infoize(std::ostream & os) const; /// void write(WriteStream & os) const; +private: + /// + virtual std::auto_ptr doClone() const; }; #endif diff --git a/src/mathed/ref_inset.C b/src/mathed/ref_inset.C index 12d502a153..426ba90187 100644 --- a/src/mathed/ref_inset.C +++ b/src/mathed/ref_inset.C @@ -44,7 +44,7 @@ RefInset::RefInset(string const & data) {} -auto_ptr RefInset::clone() const +auto_ptr RefInset::doClone() const { return auto_ptr(new RefInset(*this)); } diff --git a/src/mathed/ref_inset.h b/src/mathed/ref_inset.h index cdd1780670..5e30a3dfaa 100644 --- a/src/mathed/ref_inset.h +++ b/src/mathed/ref_inset.h @@ -24,8 +24,6 @@ public: /// explicit RefInset(std::string const & data); /// - virtual std::auto_ptr clone() const; - /// //void write(WriteStream & os) const; /// void infoize(std::ostream & os) const; @@ -61,6 +59,9 @@ public: static std::string const & getName(int type); protected: virtual void doDispatch(LCursor & cur, FuncRequest & cmd); +private: + /// + virtual std::auto_ptr doClone() const; }; #endif -- 2.39.2