From: Lars Gullik Bjønnes Date: Wed, 28 May 2003 23:09:16 +0000 (+0000) Subject: remove commented same_id functions, and also remove some const_casts X-Git-Tag: 1.6.10~16731 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b2284c1a07a6c2ba08c9e11a1c49c9bc408ec0d5;p=features.git remove commented same_id functions, and also remove some const_casts git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7061 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index ed0d51c2b3..3db57c1dc5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-05-29 Lars Gullik Bjønnes + + * tabular.[Ch]: delete commented same_id functions + 2003-05-28 John Levon * lyxfunc.C: fix LFUN_ESCAPE (bug 1055) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 36f27bd28b..bcec3e7810 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,21 @@ +2003-05-29 Lars Gullik Bjønnes + + * insetwrap.C (clone): remove const_cast + + * insetnote.C (clone): remove const_cast + + * insetminipage.C (clone): remove const_cast + + * insetmarginal.C (clone): remove const_cast + + * insetfoot.C (clone): remove const_cast + + * insetfloat.C (clone): remove const_cast + + * insetert.C (clone): remove const_cast + + * delete commented same_id functions from a lot of files. + 2003-05-28 John Levon * insetcite.C: diff --git a/src/insets/inset.C b/src/insets/inset.C index 700121dc5a..f708b80bd9 100644 --- a/src/insets/inset.C +++ b/src/insets/inset.C @@ -47,18 +47,6 @@ Inset::Inset(Inset const & in) } -// Inset::Inset(Inset const & in, bool same_id) -// : InsetBase(), -// top_x(0), top_baseline(0), scx(0), owner_(0), -// name_(in.name_), background_color_(in.background_color_) -// { -// if (same_id) -// id_ = in.id(); -// else -// id_ = inset_id++; -// } - - bool Inset::directWrite() const { return false; diff --git a/src/insets/inset.h b/src/insets/inset.h index 14a698eebc..4cbf3e4719 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -160,8 +160,6 @@ public: /// Inset(Inset const & in); /// - //Inset(Inset const & in, bool same_id); - /// virtual void dimension(BufferView *, LyXFont const &, Dimension &) const = 0; /// int ascent(BufferView *, LyXFont const &) const; @@ -212,8 +210,6 @@ public: /// virtual Inset * clone(Buffer const &) const = 0; - /// - //virtual Inset * clone(Buffer const &, bool same_ids) const = 0; /// returns true to override begin and end inset in file virtual bool directWrite() const; diff --git a/src/insets/insetbibitem.h b/src/insets/insetbibitem.h index d37c9a07b8..637cd11f33 100644 --- a/src/insets/insetbibitem.h +++ b/src/insets/insetbibitem.h @@ -31,8 +31,6 @@ public: /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// virtual dispatch_result localDispatch(FuncRequest const & cmd); /** Currently \bibitem is used as a LyX2.x command, so we need this method. diff --git a/src/insets/insetbibtex.h b/src/insets/insetbibtex.h index f14428fc2d..247c74a351 100644 --- a/src/insets/insetbibtex.h +++ b/src/insets/insetbibtex.h @@ -25,17 +25,11 @@ public: /// InsetBibtex(InsetCommandParams const &); /// - //InsetBibtex(InsetCommandParams const &, bool same_id); - /// ~InsetBibtex(); /// Inset * clone(Buffer const &) const { return new InsetBibtex(params()); } - /// - //Inset * clone(Buffer const &, bool same_id) const { - // return new InsetBibtex(params(), same_id); - //} /// small wrapper for the time being virtual dispatch_result localDispatch(FuncRequest const & cmd); /// diff --git a/src/insets/insetcite.h b/src/insets/insetcite.h index b9c47ac4a0..2be5f686e2 100644 --- a/src/insets/insetcite.h +++ b/src/insets/insetcite.h @@ -23,18 +23,12 @@ public: /// InsetCitation(InsetCommandParams const &); /// - //InsetCitation(InsetCommandParams const &, bool same_id); - /// ~InsetCitation(); /// Inset * clone(Buffer const &) const { return new InsetCitation(params()); } /// - //Inset * clone(Buffer const &, bool same_id) const { - // return new InsetCitation(params(), same_id); - //} - /// string const getScreenLabel(Buffer const *) const; /// EDITABLE editable() const { return IS_EDITABLE; } diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 89f9a82de3..8d62008e08 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -71,21 +71,6 @@ InsetCollapsable::InsetCollapsable(InsetCollapsable const & in) } -// InsetCollapsable::InsetCollapsable(InsetCollapsable const & in, bool same_id) -// : UpdatableInset(in, same_id), collapsed_(in.collapsed_), -// framecolor(in.framecolor), labelfont(in.labelfont), inset(in.inset), -// button_length(0), button_top_y(0), button_bottom_y(0), -// label(in.label), -// #if 0 -// autocollapse(in.autocollapse), -// #endif -// oldWidth(0), in_update(false), first_after_edit(false) -// { -// inset.init(&(in.inset), same_id); -// inset.setOwner(this); -// } - - bool InsetCollapsable::insertInset(BufferView * bv, Inset * in) { if (!insetAllowed(in->lyxCode())) { diff --git a/src/insets/insetcollapsable.h b/src/insets/insetcollapsable.h index 7691845910..b733d9ec6d 100644 --- a/src/insets/insetcollapsable.h +++ b/src/insets/insetcollapsable.h @@ -41,8 +41,6 @@ public: /// InsetCollapsable(InsetCollapsable const & in); /// - //InsetCollapsable(InsetCollapsable const & in, bool same_id); - /// void read(Buffer const *, LyXLex &); /// void write(Buffer const *, std::ostream &) const; diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index 286cd9736d..be3015e65b 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -33,9 +33,6 @@ public: explicit InsetCommand(InsetCommandParams const &); /// - //explicit - //InsetCommand(InsetCommandParams const &, bool same_id); - /// void write(Buffer const *, std::ostream & os) const { p_.write(os); } /// diff --git a/src/insets/insetenv.C b/src/insets/insetenv.C index aeeb5f07c5..7a5215af55 100644 --- a/src/insets/insetenv.C +++ b/src/insets/insetenv.C @@ -40,23 +40,12 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in) {} -// InsetEnvironment::InsetEnvironment(InsetEnvironment const & in, bool same_id) -// : InsetText(in, same_id), layout_(in.layout_) -// {} - - Inset * InsetEnvironment::clone(Buffer const &) const { return new InsetEnvironment(*this); } -// Inset * InsetEnvironment::clone(Buffer const &, bool same_id) const -// { -// return new InsetEnvironment(*this, same_id); -// } - - void InsetEnvironment::write(Buffer const * buf, ostream & os) const { os << "Environment " << getInsetName() << "\n"; diff --git a/src/insets/insetenv.h b/src/insets/insetenv.h index b8d55a9d4f..fab8a56fd1 100644 --- a/src/insets/insetenv.h +++ b/src/insets/insetenv.h @@ -22,16 +22,12 @@ public: /// InsetEnvironment(InsetEnvironment const &); /// - //InsetEnvironment(InsetEnvironment const &, bool same_id); - /// void write(Buffer const * buf, std::ostream & os) const; /// void read(Buffer const * buf, LyXLex & lex); /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; } /// int latex(Buffer const *, std::ostream &, diff --git a/src/insets/inseterror.h b/src/insets/inseterror.h index 4576837bb6..9dadbee3a3 100644 --- a/src/insets/inseterror.h +++ b/src/insets/inseterror.h @@ -26,9 +26,6 @@ public: explicit InsetError(string const &); /// - //explicit - //InsetError(string const &, bool same_id); - /// ~InsetError(); /// virtual dispatch_result localDispatch(FuncRequest const & cmd); @@ -60,10 +57,6 @@ public: return new InsetError(contents); } /// - //Inset * clone(Buffer const &, bool same_id) const { - // return new InsetError(contents, same_id); - //} - /// Inset::Code lyxCode() const { return Inset::ERROR_CODE; } /// We don't want "begin" and "end inset" in lyx-file bool directWrite() const { return true; }; diff --git a/src/insets/insetert.C b/src/insets/insetert.C index f5abcc230f..c0fa754a42 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -70,25 +70,12 @@ InsetERT::InsetERT(InsetERT const & in) } -// InsetERT::InsetERT(InsetERT const & in, bool same_id) -// : InsetCollapsable(in, same_id), status_(in.status_) -// { -// init(); -// } - - Inset * InsetERT::clone(Buffer const &) const { - return new InsetERT(*const_cast(this)); + return new InsetERT(*this); } -// Inset * InsetERT::clone(Buffer const &, bool same_id) const -// { -// return new InsetERT(*const_cast(this), same_id); -// } - - InsetERT::InsetERT(BufferParams const & bp, Language const * l, string const & contents, bool collapsed) : InsetCollapsable(bp, collapsed) diff --git a/src/insets/insetert.h b/src/insets/insetert.h index 89f211c137..786c6aacb3 100644 --- a/src/insets/insetert.h +++ b/src/insets/insetert.h @@ -40,12 +40,8 @@ public: /// InsetERT(InsetERT const &); /// - //InsetERT(InsetERT const &, bool same_id); - /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// InsetERT(BufferParams const &, Language const *, string const & contents, bool collapsed); /// diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index 0bfbc90c1f..1e0f3f954f 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -232,17 +232,6 @@ Inset * InsetExternal::clone(Buffer const &) const } -// Inset * InsetExternal::clone(Buffer const &, bool same_id) const -// { -// InsetExternal * inset = new InsetExternal; -// inset->params_ = params_; -// inset->view_ = view_; -// if (same_id) -// inset->id_ = id_; -// return inset; -// } - - string const InsetExternal::getScreenLabel(Buffer const *) const { ExternalTemplate const & et = params_.templ; diff --git a/src/insets/insetexternal.h b/src/insets/insetexternal.h index e200b5f1d5..6b0d2cd320 100644 --- a/src/insets/insetexternal.h +++ b/src/insets/insetexternal.h @@ -70,8 +70,6 @@ public: /// virtual Inset * clone(Buffer const &) const; - /// - //virtual Inset * clone(Buffer const &, bool same_id) const; /// returns the text of the button virtual string const getScreenLabel(Buffer const *) const; diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 1512660714..7e08132ef4 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -150,11 +150,6 @@ InsetFloat::InsetFloat(InsetFloat const & in) {} -// InsetFloat::InsetFloat(InsetFloat const & in, bool same_id) -// : InsetCollapsable(in, same_id), params_(in.params_) -// {} - - InsetFloat::~InsetFloat() { InsetFloatMailer mailer(*this); @@ -266,16 +261,10 @@ void InsetFloat::validate(LaTeXFeatures & features) const Inset * InsetFloat::clone(Buffer const &) const { - return new InsetFloat(*const_cast(this)); + return new InsetFloat(*this); } -// Inset * InsetFloat::clone(Buffer const &, bool same_id) const -// { -// return new InsetFloat(*const_cast(this), same_id); -// } - - string const InsetFloat::editMessage() const { return _("Opened Float Inset"); diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index 8b02904acd..6f8e341256 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -43,8 +43,6 @@ public: /// InsetFloat(InsetFloat const &); /// - //InsetFloat(InsetFloat const &, bool same_id); - /// ~InsetFloat(); /// virtual dispatch_result localDispatch(FuncRequest const & cmd); @@ -57,8 +55,6 @@ public: /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::FLOAT_CODE; } /// int latex(Buffer const *, std::ostream &, diff --git a/src/insets/insetfoot.C b/src/insets/insetfoot.C index c020e54845..857d5c0726 100644 --- a/src/insets/insetfoot.C +++ b/src/insets/insetfoot.C @@ -46,26 +46,12 @@ InsetFoot::InsetFoot(InsetFoot const & in) } -// InsetFoot::InsetFoot(InsetFoot const & in, bool same_id) -// : InsetFootlike(in, same_id) -// { -// setLabel(_("foot")); -// setInsetName("Foot"); -// } - - Inset * InsetFoot::clone(Buffer const &) const { - return new InsetFoot(*const_cast(this)); + return new InsetFoot(*this); } -// Inset * InsetFoot::clone(Buffer const &, bool same_id) const -// { -// return new InsetFoot(*const_cast(this), same_id); -// } - - string const InsetFoot::editMessage() const { return _("Opened Footnote Inset"); diff --git a/src/insets/insetfoot.h b/src/insets/insetfoot.h index 81ff5117f9..41410f9a94 100644 --- a/src/insets/insetfoot.h +++ b/src/insets/insetfoot.h @@ -27,12 +27,8 @@ public: /// InsetFoot(InsetFoot const &); /// - //InsetFoot(InsetFoot const &, bool same_id); - /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::FOOT_CODE; } /// int latex(Buffer const *, std::ostream &, diff --git a/src/insets/insetfootlike.C b/src/insets/insetfootlike.C index 604f8465b9..7922e022a6 100644 --- a/src/insets/insetfootlike.C +++ b/src/insets/insetfootlike.C @@ -43,17 +43,6 @@ InsetFootlike::InsetFootlike(InsetFootlike const & in) } -// InsetFootlike::InsetFootlike(InsetFootlike const & in, bool same_id) -// : InsetCollapsable(in, same_id) -// { -// LyXFont font(LyXFont::ALL_SANE); -// font.decSize(); -// font.decSize(); -// font.setColor(LColor::collapsable); -// setLabelFont(font); -// } - - void InsetFootlike::write(Buffer const * buf, ostream & os) const { os << getInsetName() << "\n"; diff --git a/src/insets/insetfootlike.h b/src/insets/insetfootlike.h index 284ab620ab..bea01ff58c 100644 --- a/src/insets/insetfootlike.h +++ b/src/insets/insetfootlike.h @@ -24,8 +24,6 @@ public: /// InsetFootlike(InsetFootlike const &); /// - //InsetFootlike(InsetFootlike const &, bool same_id); - /// void write(Buffer const * buf, std::ostream & os) const; /// bool insetAllowed(Inset::Code) const; diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 11b5945d30..74f94a3a26 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -202,29 +202,12 @@ InsetGraphics::InsetGraphics(InsetGraphics const & ig, } -// InsetGraphics::InsetGraphics(InsetGraphics const & ig, -// string const & filepath, -// bool same_id) -// : Inset(ig, same_id), -// graphic_label(uniqueID()), -// cache_(new Cache(*this)) -// { -// setParams(ig.params(), filepath); -// } - - Inset * InsetGraphics::clone(Buffer const & buffer) const { return new InsetGraphics(*this, buffer.filePath()); } -// Inset * InsetGraphics::clone(Buffer const & buffer, bool same_id) const -// { -// return new InsetGraphics(*this, buffer.filePath(), same_id); -// } - - InsetGraphics::~InsetGraphics() { InsetGraphicsMailer mailer(*this); diff --git a/src/insets/insetgraphics.h b/src/insets/insetgraphics.h index 940f4509a9..7a070d1ca9 100644 --- a/src/insets/insetgraphics.h +++ b/src/insets/insetgraphics.h @@ -30,9 +30,6 @@ public: /// InsetGraphics(InsetGraphics const &, string const & filepath); /// - //InsetGraphics(InsetGraphics const &, string const & filepath, - // bool same_id); - /// ~InsetGraphics(); /// virtual dispatch_result localDispatch(FuncRequest const & cmd); @@ -70,8 +67,6 @@ public: /// virtual Inset * clone(Buffer const &) const; - /// - //virtual Inset * clone(Buffer const &, bool same_id) const; /** Set the inset parameters, used by the GUIndependent dialog. Return true of new params are different from what was so far. diff --git a/src/insets/insethfill.h b/src/insets/insethfill.h index 0db2fc10f0..77eef0a6dc 100644 --- a/src/insets/insethfill.h +++ b/src/insets/insethfill.h @@ -21,13 +21,9 @@ public: InsetHFill(); /// virtual Inset * clone(Buffer const &) const { - return new InsetHFill(); + return new InsetHFill; } /// - //virtual Inset * clone(Buffer const &, bool /*same_id*/) const { - // return new InsetHFill(); - //} - /// string const getScreenLabel(Buffer const *) const { return getContents(); } /// Inset::Code lyxCode() const { return Inset::HFILL_CODE; } diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index 4cde1408b6..a6d197952b 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -76,8 +76,6 @@ public: /// virtual Inset * clone(Buffer const &) const; /// - //virtual Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; } /// This returns the list of labels on the child buffer std::vector const getLabelList() const; diff --git a/src/insets/insetindex.h b/src/insets/insetindex.h index 27bd984bb6..0eac55b403 100644 --- a/src/insets/insetindex.h +++ b/src/insets/insetindex.h @@ -24,18 +24,12 @@ public: /// InsetIndex(InsetCommandParams const &); /// - //InsetIndex(InsetCommandParams const &, bool same_id); - /// ~InsetIndex(); /// virtual Inset * clone(Buffer const &) const { return new InsetIndex(params()); } /// - //virtual Inset * clone(Buffer const &, bool same_id) const { - // return new InsetIndex(params(), same_id); - //} - /// dispatch_result localDispatch(FuncRequest const & cmd); /// string const getScreenLabel(Buffer const *) const; @@ -53,18 +47,12 @@ public: /// InsetPrintIndex(InsetCommandParams const &); /// - //InsetPrintIndex(InsetCommandParams const &, bool same_id); - /// ~InsetPrintIndex(); /// Inset * clone(Buffer const &) const { return new InsetPrintIndex(params()); } /// - //Inset * clone(Buffer const &, bool same_id) const { - // return new InsetPrintIndex(params(), same_id); - //} - /// //dispatch_result localDispatch(FuncRequest const & cmd); /// Updates needed features for this inset. void validate(LaTeXFeatures & features) const; diff --git a/src/insets/insetlabel.h b/src/insets/insetlabel.h index a9eccd3613..6edfda852d 100644 --- a/src/insets/insetlabel.h +++ b/src/insets/insetlabel.h @@ -20,18 +20,12 @@ public: /// InsetLabel(InsetCommandParams const &); /// - //InsetLabel(InsetCommandParams const &, bool same_id); - /// ~InsetLabel(); /// virtual Inset * clone(Buffer const &) const { return new InsetLabel(params()); } /// - //virtual Inset * clone(Buffer const &, bool same_id) const { - // return new InsetLabel(params(), same_id); - //} - /// virtual dispatch_result localDispatch(FuncRequest const & cmd); /// string const getScreenLabel(Buffer const *) const { return getContents(); } diff --git a/src/insets/insetlatexaccent.h b/src/insets/insetlatexaccent.h index 0e0ec4c478..0fe5f86273 100644 --- a/src/insets/insetlatexaccent.h +++ b/src/insets/insetlatexaccent.h @@ -62,8 +62,6 @@ public: /// virtual Inset * clone(Buffer const &) const; /// - //virtual Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode()const; /// inline bool canDisplay(); diff --git a/src/insets/insetmarginal.C b/src/insets/insetmarginal.C index 76ca85581f..6e7a0ad90d 100644 --- a/src/insets/insetmarginal.C +++ b/src/insets/insetmarginal.C @@ -41,26 +41,12 @@ InsetMarginal::InsetMarginal(InsetMarginal const & in) } -// InsetMarginal::InsetMarginal(InsetMarginal const & in, bool same_id) -// : InsetFootlike(in, same_id) -// { -// setLabel(_("margin")); -// setInsetName("Marginal"); -// } - - Inset * InsetMarginal::clone(Buffer const &) const { - return new InsetMarginal(*const_cast(this)); + return new InsetMarginal(*this); } -// Inset * InsetMarginal::clone(Buffer const &, bool same_id) const -// { -// return new InsetMarginal(*const_cast(this), same_id); -// } - - string const InsetMarginal::editMessage() const { return _("Opened Marginal Note Inset"); diff --git a/src/insets/insetmarginal.h b/src/insets/insetmarginal.h index 1ee63aa901..b69950d103 100644 --- a/src/insets/insetmarginal.h +++ b/src/insets/insetmarginal.h @@ -26,12 +26,8 @@ public: /// InsetMarginal(InsetMarginal const &); /// - //InsetMarginal(InsetMarginal const &, bool same_id); - /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::MARGIN_CODE; } /// int latex(Buffer const *, std::ostream &, diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C index 1c108a2c63..6a6f3f16d9 100644 --- a/src/insets/insetminipage.C +++ b/src/insets/insetminipage.C @@ -93,23 +93,12 @@ InsetMinipage::InsetMinipage(InsetMinipage const & in) {} -// InsetMinipage::InsetMinipage(InsetMinipage const & in, bool same_id) -// : InsetCollapsable(in, same_id), params_(in.params_) -// {} - - Inset * InsetMinipage::clone(Buffer const &) const { - return new InsetMinipage(*const_cast(this)); + return new InsetMinipage(*this); } -// Inset * InsetMinipage::clone(Buffer const &, bool same_id) const -// { -// return new InsetMinipage(*const_cast(this), same_id); -// } - - InsetMinipage::~InsetMinipage() { InsetMinipageMailer mailer(*this); diff --git a/src/insets/insetminipage.h b/src/insets/insetminipage.h index c78c769d4e..2db509f111 100644 --- a/src/insets/insetminipage.h +++ b/src/insets/insetminipage.h @@ -58,8 +58,6 @@ public: /// InsetMinipage(InsetMinipage const &); /// - //InsetMinipage(InsetMinipage const &, bool same_id); - /// ~InsetMinipage(); /// virtual dispatch_result localDispatch(FuncRequest const & cmd); @@ -70,8 +68,6 @@ public: /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// void dimension(BufferView *, LyXFont const &, Dimension &) const; /// Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; } diff --git a/src/insets/insetnewline.h b/src/insets/insetnewline.h index b6f20af1ee..60de3b6140 100644 --- a/src/insets/insetnewline.h +++ b/src/insets/insetnewline.h @@ -24,11 +24,6 @@ public: return new InsetNewline; } - - //virtual Inset * clone(Buffer const &, bool same_id) const { - // return new InsetNewline; - //} - Inset::Code lyxCode() const { return Inset::NEWLINE_CODE; } void dimension(BufferView *, LyXFont const &, Dimension &) const; diff --git a/src/insets/insetnote.C b/src/insets/insetnote.C index c09db364ae..457aa1368f 100644 --- a/src/insets/insetnote.C +++ b/src/insets/insetnote.C @@ -53,25 +53,12 @@ InsetNote::InsetNote(InsetNote const & in) } -// InsetNote::InsetNote(InsetNote const & in, bool same_id) -// : InsetCollapsable(in, same_id) -// { -// init(); -// } - - Inset * InsetNote::clone(Buffer const &) const { - return new InsetNote(*const_cast(this)); + return new InsetNote(*this); } -// Inset * InsetNote::clone(Buffer const &, bool same_id) const -// { -// return new InsetNote(*const_cast(this), same_id); -// } - - string const InsetNote::editMessage() const { return _("Opened Note Inset"); diff --git a/src/insets/insetnote.h b/src/insets/insetnote.h index ca173ab6d5..4b5b1d0c4a 100644 --- a/src/insets/insetnote.h +++ b/src/insets/insetnote.h @@ -25,12 +25,8 @@ public: /// InsetNote(InsetNote const &); /// - //InsetNote(InsetNote const &, bool same_id); - /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// string const editMessage() const; /// Inset::Code lyxCode() const { return Inset::NOTE_CODE; } diff --git a/src/insets/insetoptarg.C b/src/insets/insetoptarg.C index 03f000d920..7a08236102 100644 --- a/src/insets/insetoptarg.C +++ b/src/insets/insetoptarg.C @@ -47,28 +47,12 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in) } -// InsetOptArg::InsetOptArg(InsetOptArg const & in, bool same_id) -// : InsetCollapsable(in, same_id) -// { -// LyXFont font(LyXFont::ALL_SANE); -// font.setColor(LColor::collapsable); -// setLabelFont(font); -// setLabel(_("opt")); -// } - - Inset * InsetOptArg::clone(Buffer const &) const { return new InsetOptArg(*this); } -// Inset * InsetOptArg::clone(Buffer const &, bool same_id) const -// { -// return new InsetOptArg(*this, same_id); -// } - - string const InsetOptArg::editMessage() const { return _("Opened Optional Argument Inset"); diff --git a/src/insets/insetoptarg.h b/src/insets/insetoptarg.h index 50ff61cb9e..a4999bdafd 100644 --- a/src/insets/insetoptarg.h +++ b/src/insets/insetoptarg.h @@ -26,13 +26,8 @@ public: InsetOptArg(BufferParams const &); InsetOptArg(InsetOptArg const &); - //InsetOptArg(InsetOptArg const &, bool same_id); - /// make a duplicate of this inset Inset * clone(Buffer const &) const; - /// make a duplicate of this inset - //Inset * clone(Buffer const &, bool same_id) const; - /// this inset is editable EDITABLE editable() const { return IS_EDITABLE; } /// code of the inset diff --git a/src/insets/insetparent.h b/src/insets/insetparent.h index 8fd4691d34..c79b7419f2 100644 --- a/src/insets/insetparent.h +++ b/src/insets/insetparent.h @@ -27,16 +27,10 @@ public: /// InsetParent(InsetCommandParams const &, Buffer const &); /// - //InsetParent(InsetCommandParams const &, Buffer const &, bool same_id); - /// virtual Inset * clone(Buffer const & buffer) const { return new InsetParent(params(), buffer); } /// - //virtual Inset * clone(Buffer const & buffer, bool same_id) const { - // return new InsetParent(params(), buffer, same_id); - //} - /// dispatch_result localDispatch(FuncRequest const & cmd); /// string const getScreenLabel(Buffer const *) const; diff --git a/src/insets/insetquotes.h b/src/insets/insetquotes.h index 12e5e14da2..29875c70a6 100644 --- a/src/insets/insetquotes.h +++ b/src/insets/insetquotes.h @@ -69,9 +69,6 @@ public: InsetQuotes(char c, BufferParams const & params); /// Inset * clone(Buffer const &) const; - /// - //Inset * clone(Buffer const &, bool same_id) const; - /// void dimension(BufferView *, LyXFont const &, Dimension &) const; /// diff --git a/src/insets/insetref.h b/src/insets/insetref.h index 9e1aa204ae..ce78a712f8 100644 --- a/src/insets/insetref.h +++ b/src/insets/insetref.h @@ -38,18 +38,12 @@ public: /// InsetRef(InsetCommandParams const &, Buffer const &); /// - //InsetRef(InsetCommandParams const &, Buffer const &, bool same_id); - /// ~InsetRef(); /// virtual Inset * clone(Buffer const & buffer) const { return new InsetRef(params(), buffer); } /// - //virtual Inset * clone(Buffer const & buffer, bool same_id) const { - // return new InsetRef(params(), buffer, same_id); - //} - /// dispatch_result localDispatch(FuncRequest const & cmd); /// string const getScreenLabel(Buffer const *) const; diff --git a/src/insets/insetspace.h b/src/insets/insetspace.h index 01f8a79c05..9a1a872e11 100644 --- a/src/insets/insetspace.h +++ b/src/insets/insetspace.h @@ -73,8 +73,6 @@ public: /// virtual Inset * clone(Buffer const &) const; /// - //virtual Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::SPACE_CODE; } /// We don't need \begin_inset and \end_inset bool directWrite() const { return true; } diff --git a/src/insets/insetspecialchar.h b/src/insets/insetspecialchar.h index 2bc1cb9b16..bcca7aeab2 100644 --- a/src/insets/insetspecialchar.h +++ b/src/insets/insetspecialchar.h @@ -65,8 +65,6 @@ public: /// virtual Inset * clone(Buffer const &) const; /// - //virtual Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; } /// We don't need \begin_inset and \end_inset bool directWrite() const { return true; } diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index fa971302aa..c5096ba1e3 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -193,26 +193,6 @@ InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf) } -// InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf, -// bool same_id) -// : UpdatableInset(tab, same_id), buffer(&buf) -// { -// tabular.reset(new LyXTabular(buf.params, -// this, *(tab.tabular), same_id)); -// 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); @@ -226,12 +206,6 @@ Inset * InsetTabular::clone(Buffer const & buf) const } -// Inset * InsetTabular::clone(Buffer const & buf, bool same_id) const -// { -// return new InsetTabular(*this, buf, same_id); -// } - - BufferView * InsetTabular::view() const { return buffer->getUser(); diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index 05063aa53a..7fdd0bd107 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -78,14 +78,10 @@ public: /// InsetTabular(InsetTabular const &, Buffer const &); /// - //InsetTabular(InsetTabular const &, Buffer const &, bool same_id); - /// ~InsetTabular(); /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// void read(Buffer const *, LyXLex &); /// void write(Buffer const *, std::ostream &) const; diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 7e073ff945..0b03644572 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -155,14 +155,6 @@ InsetText::InsetText(InsetText const & in) } -// InsetText::InsetText(InsetText const & in, bool same_id) -// : UpdatableInset(in, same_id), lt(0), in_update(false), do_resize(0), -// do_reinit(false) -// { -// init(&in, same_id); -// } - - InsetText & InsetText::operator=(InsetText const & it) { init(&it); @@ -201,39 +193,6 @@ void InsetText::init(InsetText const * ins) } -// void InsetText::init(InsetText const * ins, bool same_id) -// { -// if (ins) { -// setParagraphData(ins->paragraphs, same_id); -// autoBreakRows = ins->autoBreakRows; -// drawFrame_ = ins->drawFrame_; -// frame_color = ins->frame_color; -// if (same_id) -// id_ = ins->id_; -// } else { -// for_each(paragraphs.begin(), paragraphs.end(), -// boost::bind(&Paragraph::setInsetOwner, _1, this)); - -// the_locking_inset = 0; -// drawFrame_ = NEVER; -// frame_color = LColor::insetframe; -// autoBreakRows = false; -// } -// top_y = 0; -// old_max_width = 0; -// no_selection = true; -// need_update = FULL; -// drawTextXOffset = 0; -// drawTextYOffset = 0; -// locked = false; -// old_par = 0; -// last_drawn_width = -1; -// cached_bview = 0; -// sstate.lpar = 0; -// in_insetAllowed = false; -// } - - InsetText::~InsetText() { paragraphs.clear(); @@ -271,12 +230,6 @@ Inset * InsetText::clone(Buffer const &) const } -// Inset * InsetText::clone(Buffer const &, bool same_id) const -// { -// return new InsetText(*this, same_id); -// } - - void InsetText::write(Buffer const * buf, ostream & os) const { os << "Text\n"; @@ -2008,46 +1961,6 @@ void InsetText::setParagraphData(ParagraphList const & plist) } -// void InsetText::setParagraphData(ParagraphList const & plist, bool same_id) -// { -// // we have to unlock any locked inset otherwise we're in troubles -// the_locking_inset = 0; - -// #warning CHECK not adhering to same_id here might wreck havoc (Lgb) -// // But it it makes no difference that is a lot better. -// if (same_id) { -// lyxerr << "Same_id called with 'true'" << endl; -// lyxerr << "Please report this to the list." << endl; - -// paragraphs.clear(); -// ParagraphList::iterator it = plist.begin(); -// ParagraphList::iterator end = plist.end(); -// for (; it != end; ++it) { -// int const id = it->id(); -// paragraphs.push_back(*it); -// Paragraph & tmp = paragraphs.back(); -// tmp.setInsetOwner(this); -// tmp.id(id); -// } -// } else { -// #warning FIXME. -// // See if this can be simplified when std::list is in effect. -// paragraphs.clear(); - -// ParagraphList::iterator it = plist.begin(); -// ParagraphList::iterator end = plist.end(); -// for (; it != end; ++it) { -// paragraphs.push_back(*it); -// Paragraph & tmp = paragraphs.back(); -// tmp.setInsetOwner(this); -// } -// } - -// reinitLyXText(); -// need_update = INIT; -// } - - void InsetText::markNew(bool track_changes) { ParagraphList::iterator pit = paragraphs.begin(); diff --git a/src/insets/insettext.h b/src/insets/insettext.h index e54ec3c309..c37a5588f6 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -75,15 +75,10 @@ public: explicit InsetText(InsetText const &); /// - //explicit - //InsetText(InsetText const &, bool same_id); - /// ~InsetText(); /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// InsetText & operator=(InsetText const & it); /// empty inset to empty par, or just mark as erased void clear(bool just_mark_erased); @@ -154,14 +149,10 @@ public: /// void init(InsetText const * ins); /// - //void init(InsetText const * ins, bool same_id); - /// void writeParagraphData(Buffer const *, std::ostream &) const; /// void setParagraphData(ParagraphList const &); /// - //void setParagraphData(ParagraphList const &, bool same_id); - /// void setText(string const &, LyXFont const &); /// void setAutoBreakRows(bool); diff --git a/src/insets/insettheorem.h b/src/insets/insettheorem.h index e7e457d102..60ea45cee4 100644 --- a/src/insets/insettheorem.h +++ b/src/insets/insettheorem.h @@ -27,8 +27,6 @@ public: /// virtual Inset * clone(Buffer const &) const; /// - //virtual Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::THEOREM_CODE; } /// bool display() const { return true; } diff --git a/src/insets/insettoc.C b/src/insets/insettoc.C index 160a1322af..8e04694825 100644 --- a/src/insets/insettoc.C +++ b/src/insets/insettoc.C @@ -28,11 +28,6 @@ InsetTOC::InsetTOC(InsetCommandParams const & p) {} -// InsetTOC::InsetTOC(InsetCommandParams const & p, bool same_id) -// : InsetCommand(p, same_id) -// {} - - InsetTOC::~InsetTOC() { InsetCommandMailer mailer("toc", *this); diff --git a/src/insets/insettoc.h b/src/insets/insettoc.h index bc4c696cf8..443ab69762 100644 --- a/src/insets/insettoc.h +++ b/src/insets/insettoc.h @@ -22,18 +22,12 @@ public: /// InsetTOC(InsetCommandParams const &); /// - //InsetTOC(InsetCommandParams const &, bool same_id); - /// ~InsetTOC(); /// virtual Inset * clone(Buffer const &) const { return new InsetTOC(params()); } /// - //virtual Inset * clone(Buffer const &, bool same_id) const { - // return new InsetTOC(params(), same_id); - //} - /// dispatch_result localDispatch(FuncRequest const & cmd); /// string const getScreenLabel(Buffer const *) const; diff --git a/src/insets/inseturl.h b/src/insets/inseturl.h index 756ec2402a..8daee16a95 100644 --- a/src/insets/inseturl.h +++ b/src/insets/inseturl.h @@ -25,19 +25,12 @@ public: explicit InsetUrl(InsetCommandParams const &); /// - //explicit - //InsetUrl(InsetCommandParams const &, bool same_id); - /// ~InsetUrl(); /// virtual Inset * clone(Buffer const &) const { return new InsetUrl(params()); } /// - //virtual Inset * clone(Buffer const &, bool same_id) const { - // return new InsetUrl(params(), same_id); - //} - /// dispatch_result localDispatch(FuncRequest const & cmd); /// Inset::Code lyxCode() const { return Inset::URL_CODE; } diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index f1249091e1..8e281d0c9e 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -80,11 +80,6 @@ InsetWrap::InsetWrap(InsetWrap const & in) {} -// InsetWrap::InsetWrap(InsetWrap const & in, bool same_id) -// : InsetCollapsable(in, same_id), params_(in.params_) -// {} - - InsetWrap::~InsetWrap() { InsetWrapMailer mailer(*this); @@ -187,16 +182,10 @@ void InsetWrap::validate(LaTeXFeatures & features) const Inset * InsetWrap::clone(Buffer const &) const { - return new InsetWrap(*const_cast(this)); + return new InsetWrap(*this); } -// Inset * InsetWrap::clone(Buffer const &, bool same_id) const -// { -// return new InsetWrap(*const_cast(this), same_id); -// } - - string const InsetWrap::editMessage() const { return _("Opened Wrap Inset"); diff --git a/src/insets/insetwrap.h b/src/insets/insetwrap.h index bc5b9896e1..fd01ab8533 100644 --- a/src/insets/insetwrap.h +++ b/src/insets/insetwrap.h @@ -41,8 +41,6 @@ public: /// InsetWrap(InsetWrap const &); /// - //InsetWrap(InsetWrap const &, bool same_id); - /// ~InsetWrap(); /// virtual dispatch_result localDispatch(FuncRequest const & cmd); @@ -55,8 +53,6 @@ public: /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const { return Inset::WRAP_CODE; } /// int latex(Buffer const *, std::ostream &, diff --git a/src/insets/updatableinset.C b/src/insets/updatableinset.C index d03c3f4677..a01ec0f3bc 100644 --- a/src/insets/updatableinset.C +++ b/src/insets/updatableinset.C @@ -35,11 +35,6 @@ UpdatableInset::UpdatableInset(UpdatableInset const & in) {} -// UpdatableInset::UpdatableInset(UpdatableInset const & in, bool same_id) -// : Inset(in, same_id), block_drawing_(false) -// {} - - void UpdatableInset::insetUnlock(BufferView *) { lyxerr[Debug::INFO] << "Inset Unlock" << std::endl; diff --git a/src/insets/updatableinset.h b/src/insets/updatableinset.h index 6672ab38e2..f41c02387b 100644 --- a/src/insets/updatableinset.h +++ b/src/insets/updatableinset.h @@ -50,8 +50,6 @@ public: UpdatableInset(); /// UpdatableInset(UpdatableInset const & in); - /// - //UpdatableInset(UpdatableInset const & in, bool same_id); /// check if the font of the char we want inserting is correct /// and modify it if it is not. diff --git a/src/mathed/formula.h b/src/mathed/formula.h index 8074c37f86..bab0e55c3b 100644 --- a/src/mathed/formula.h +++ b/src/mathed/formula.h @@ -56,8 +56,6 @@ public: /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// void validate(LaTeXFeatures & features) const; /// Inset::Code lyxCode() const; diff --git a/src/mathed/formulabase.h b/src/mathed/formulabase.h index e6826e34be..4482822ef7 100644 --- a/src/mathed/formulabase.h +++ b/src/mathed/formulabase.h @@ -32,8 +32,6 @@ public: /// Inset * clone(Buffer const &) const = 0; /// - //Inset * clone(Buffer const &, bool same_id) const = 0; - /// virtual void draw(BufferView *,LyXFont const &, int, float &) const = 0; /// lowest x coordinate virtual int xlow() const; diff --git a/src/mathed/formulamacro.h b/src/mathed/formulamacro.h index a9545decaa..1d8f03027b 100644 --- a/src/mathed/formulamacro.h +++ b/src/mathed/formulamacro.h @@ -54,8 +54,6 @@ public: /// Inset * clone(Buffer const &) const; /// - //Inset * clone(Buffer const &, bool same_id) const; - /// Inset::Code lyxCode() const; /// MathAtom const & par() const; diff --git a/src/tabular.C b/src/tabular.C index a5e498a2f6..023f5406cb 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -131,33 +131,6 @@ LyXTabular::LyXTabular(BufferParams const & bp, } -// LyXTabular::LyXTabular(BufferParams const & bp, -// InsetTabular * inset, LyXTabular const & lt, -// bool same_id) -// { -// owner_ = inset; -// cur_cell = -1; -// Init(bp, lt.rows_, lt.columns_, <); -// // we really should change again to have InsetText as a pointer -// // and allocate it then we would not have to do this stuff all -// // double! -// if (same_id) { -// for (int i = 0; i < rows_; ++i) { -// for (int j = 0; j < columns_; ++j) { -// cell_info[i][j].inset.id(lt.cell_info[i][j].inset.id()); -// cell_info[i][j].inset.setParagraphData(lt.cell_info[i][j].inset.paragraphs, true); -// } -// } -// } -// #if 0 -// #ifdef WITH_WARNINGS -// #warning Jürgen, can you make it the other way round. So that copy assignment depends on the copy constructor and not the other way. (Lgb) -// #endif -// operator=(lt); -// #endif -// } - - LyXTabular::LyXTabular(Buffer const * buf, InsetTabular * inset, LyXLex & lex) { owner_ = inset; @@ -209,24 +182,6 @@ LyXTabular * LyXTabular::clone(BufferParams const & bp, } -// LyXTabular * LyXTabular::clone(BufferParams const & bp, -// InsetTabular * inset, bool same_id) -// { -// LyXTabular * result = new LyXTabular(bp, inset, *this, same_id); -// #if 0 -// // don't know if this is good but I need to Clone also -// // the text-insets here, this is for the Undo-facility! -// for (int i = 0; i < rows_; ++i) { -// for (int j = 0; j < columns_; ++j) { -// result->cell_info[i][j].inset = cell_info[i][j].inset; -// result->cell_info[i][j].inset.setOwner(inset); -// } -// } -// #endif -// return result; -// } - - /* activates all lines and sets all widths to 0 */ void LyXTabular::Init(BufferParams const & bp, int rows_arg, int columns_arg, LyXTabular const * lt) diff --git a/src/tabular.h b/src/tabular.h index 92916cd7a8..8aaee3509e 100644 --- a/src/tabular.h +++ b/src/tabular.h @@ -182,18 +182,12 @@ public: LyXTabular(BufferParams const &, InsetTabular *, LyXTabular const &); /// - //LyXTabular(BufferParams const &, - // InsetTabular *, LyXTabular const &, bool same_id = false); - /// explicit LyXTabular(Buffer const *, InsetTabular *, LyXLex & lex); /// LyXTabular & operator=(LyXTabular const &); /// LyXTabular * clone(BufferParams const &, InsetTabular *); - /// - //LyXTabular * clone(BufferParams const &, - // InsetTabular *, bool same_id = false); /// Returns true if there is a topline, returns false if not bool TopLine(int cell, bool onlycolumn = false) const;