From: Bo Peng Date: Sat, 28 Apr 2007 20:49:56 +0000 (+0000) Subject: Rename class RefInset to InsetMathRef X-Git-Tag: 1.6.10~10004 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d30304cf84533e85e8f1dc312f90dbc9c53f8b95;p=features.git Rename class RefInset to InsetMathRef git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18077 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h index aeaebb9d9a..8bc070ee32 100644 --- a/src/mathed/InsetMath.h +++ b/src/mathed/InsetMath.h @@ -70,7 +70,7 @@ class InsetMathSpace; class InsetMathSymbol; class InsetMathUnknown; -class RefInset; +class InsetMathRef; class NormalStream; class OctaveStream; @@ -142,7 +142,7 @@ public: virtual InsetMathSymbol const * asSymbolInset() const { return 0; } virtual InsetMathUnknown * asUnknownInset() { return 0; } virtual InsetMathUnknown const * asUnknownInset() const { return 0; } - virtual RefInset * asRefInset() { return 0; } + virtual InsetMathRef * asRefInset() { return 0; } /// identifies things that can get scripts virtual bool isScriptable() const { return false; } diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index ddafc5c270..517c045c31 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -967,7 +967,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) docstring const & name = cmd.argument(); string data; if (name == "ref") { - RefInset tmp(name); + InsetMathRef tmp(name); data = tmp.createDialogStr(to_utf8(name)); } cur.bv().showInsetDialog(to_utf8(name), data, 0); diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp index 9945694a68..a944341049 100644 --- a/src/mathed/InsetMathRef.cpp +++ b/src/mathed/InsetMathRef.cpp @@ -36,29 +36,29 @@ using std::auto_ptr; using std::endl; -RefInset::RefInset() +InsetMathRef::InsetMathRef() : CommandInset(from_ascii("ref")) {} -RefInset::RefInset(docstring const & data) +InsetMathRef::InsetMathRef(docstring const & data) : CommandInset(data) {} -auto_ptr RefInset::doClone() const +auto_ptr InsetMathRef::doClone() const { - return auto_ptr(new RefInset(*this)); + return auto_ptr(new InsetMathRef(*this)); } -void RefInset::infoize(odocstream & os) const +void InsetMathRef::infoize(odocstream & os) const { os << "Ref: " << cell(0); } -void RefInset::doDispatch(Cursor & cur, FuncRequest & cmd) +void InsetMathRef::doDispatch(Cursor & cur, FuncRequest & cmd) { switch (cmd.action) { case LFUN_INSET_MODIFY: @@ -105,7 +105,7 @@ void RefInset::doDispatch(Cursor & cur, FuncRequest & cmd) } -bool RefInset::getStatus(Cursor & cur, FuncRequest const & cmd, +bool InsetMathRef::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const { switch (cmd.action) { @@ -123,7 +123,7 @@ bool RefInset::getStatus(Cursor & cur, FuncRequest const & cmd, } -docstring const RefInset::screenLabel() const +docstring const InsetMathRef::screenLabel() const { docstring str; for (int i = 0; !types[i].latex_name.empty(); ++i) { @@ -142,7 +142,7 @@ docstring const RefInset::screenLabel() const } -void RefInset::validate(LaTeXFeatures & features) const +void InsetMathRef::validate(LaTeXFeatures & features) const { if (commandname() == "vref" || commandname() == "vpageref") features.require("varioref"); @@ -151,7 +151,7 @@ void RefInset::validate(LaTeXFeatures & features) const } -int RefInset::docbook(Buffer const & buf, odocstream & os, +int InsetMathRef::docbook(Buffer const & buf, odocstream & os, OutputParams const & runparams) const { if (cell(1).empty()) { @@ -173,7 +173,7 @@ int RefInset::docbook(Buffer const & buf, odocstream & os, } -string const RefInset::createDialogStr(string const & name) const +string const InsetMathRef::createDialogStr(string const & name) const { InsetCommandParams icp(to_ascii(commandname())); icp["reference"] = asString(cell(0)); @@ -183,7 +183,7 @@ string const RefInset::createDialogStr(string const & name) const } -RefInset::ref_type_info RefInset::types[] = { +InsetMathRef::ref_type_info InsetMathRef::types[] = { { from_ascii("ref"), from_ascii(N_("Standard")), from_ascii(N_("Ref: "))}, { from_ascii("eqref"), from_ascii(N_("Equation")), from_ascii(N_("EqRef: "))}, { from_ascii("pageref"), from_ascii(N_("Page Number")), from_ascii(N_("Page: "))}, diff --git a/src/mathed/InsetMathRef.h b/src/mathed/InsetMathRef.h index a0904e3541..fb208d9b96 100644 --- a/src/mathed/InsetMathRef.h +++ b/src/mathed/InsetMathRef.h @@ -20,12 +20,12 @@ namespace lyx { class Buffer; // for \ref -class RefInset : public CommandInset { +class InsetMathRef : public CommandInset { public: /// - RefInset(); + InsetMathRef(); /// - explicit RefInset(docstring const & data); + explicit InsetMathRef(docstring const & data); /// //void write(WriteStream & os) const; /// @@ -35,7 +35,7 @@ public: /// void validate(LaTeXFeatures & features) const; /// - virtual RefInset * asRefInset() { return this; } + virtual InsetMathRef * asRefInset() { return this; } /// docbook output int docbook(Buffer const & buf, odocstream & os, OutputParams const &) const; diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp index 70244a7006..a034542f29 100644 --- a/src/mathed/MathFactory.cpp +++ b/src/mathed/MathFactory.cpp @@ -265,7 +265,7 @@ MathAtom createInsetMath(docstring const & s) docstring const & inset = l->inset; //lyxerr << " found inset: '" << inset << '\'' << endl; if (inset == "ref") - return MathAtom(new RefInset(l->name)); + return MathAtom(new InsetMathRef(l->name)); if (inset == "overset") return MathAtom(new InsetMathOverset); if (inset == "underset") diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 04c69536e7..3ce4770b59 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -1106,7 +1106,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, else if (t.cs() == "ref" || t.cs() == "prettyref" || t.cs() == "pageref" || t.cs() == "vpageref" || t.cs() == "vref") { - cell->push_back(MathAtom(new RefInset(t.cs()))); + cell->push_back(MathAtom(new InsetMathRef(t.cs()))); parse(cell->back().nucleus()->cell(1), FLAG_OPTION, mode); parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); }