Remove InsetCommand::mailer_name_.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35893 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-10-29 00:46:21 +00:00
parent aafe985042
commit 2bbf8e5f2d
14 changed files with 23 additions and 27 deletions

View File

@ -52,7 +52,7 @@ docstring const key_prefix = from_ascii("key-");
InsetBibitem::InsetBibitem(Buffer * buf, InsetCommandParams const & p) InsetBibitem::InsetBibitem(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "bibitem") : InsetCommand(buf, p)
{ {
buffer().invalidateBibinfoCache(); buffer().invalidateBibinfoCache();
if (getParam("key").empty()) if (getParam("key").empty())

View File

@ -52,7 +52,7 @@ namespace os = support::os;
InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p) InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "bibtex") : InsetCommand(buf, p)
{ {
buffer().invalidateBibinfoCache(); buffer().invalidateBibinfoCache();
} }

View File

@ -40,7 +40,7 @@ ParamInfo InsetCitation::param_info_;
InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p) InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "citation") : InsetCommand(buf, p)
{} {}

View File

@ -52,23 +52,22 @@ namespace lyx {
// FIXME Would it now be possible to use the InsetCode in // FIXME Would it now be possible to use the InsetCode in
// place of the mailer name and recover that information? // place of the mailer name and recover that information?
InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p, InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p)
string const & mailer_name) : Inset(buf), p_(p)
: Inset(buf), p_(p), mailer_name_(mailer_name)
{} {}
// The sole purpose of this copy constructor is to make sure // The sole purpose of this copy constructor is to make sure
// that the mouse_hover_ map is not copied and remains empty. // that the mouse_hover_ map is not copied and remains empty.
InsetCommand::InsetCommand(InsetCommand const & rhs) InsetCommand::InsetCommand(InsetCommand const & rhs)
: Inset(rhs), p_(rhs.p_), mailer_name_(rhs.mailer_name_) : Inset(rhs), p_(rhs.p_)
{} {}
InsetCommand::~InsetCommand() InsetCommand::~InsetCommand()
{ {
if (!mailer_name_.empty()) if (p_.code() != NO_CODE)
hideDialogs(mailer_name_, this); hideDialogs(insetName(p_.code()), this);
map<BufferView const *, bool>::iterator it = mouse_hover_.begin(); map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
map<BufferView const *, bool>::iterator end = mouse_hover_.end(); map<BufferView const *, bool>::iterator end = mouse_hover_.end();
@ -209,14 +208,14 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
docstring InsetCommand::contextMenu(BufferView const &, int, int) const docstring InsetCommand::contextMenu(BufferView const &, int, int) const
{ {
return from_ascii("context-") + from_ascii(mailer_name_); return from_ascii("context-") + from_ascii(insetName(p_.code()));
} }
bool InsetCommand::showInsetDialog(BufferView * bv) const bool InsetCommand::showInsetDialog(BufferView * bv) const
{ {
if (!mailer_name_.empty()) if (p_.code() != NO_CODE)
bv->showDialog(mailer_name_, params2string(p_), bv->showDialog(insetName(p_.code()), params2string(p_),
const_cast<InsetCommand *>(this)); const_cast<InsetCommand *>(this));
return true; return true;
} }

View File

@ -35,8 +35,7 @@ class InsetCommand : public Inset
{ {
public: public:
/// ///
InsetCommand(Buffer *, InsetCommandParams const &, InsetCommand(Buffer *, InsetCommandParams const &);
std::string const & mailer_name);
/// ///
InsetCommand(InsetCommand const & rhs); InsetCommand(InsetCommand const & rhs);
/// ///
@ -133,8 +132,6 @@ private:
/// ///
InsetCommandParams p_; InsetCommandParams p_;
///
std::string mailer_name_;
/// changes color when mouse enters/leaves this inset /// changes color when mouse enters/leaves this inset
mutable std::map<BufferView const *, bool> mouse_hover_; mutable std::map<BufferView const *, bool> mouse_hover_;
/// ///

View File

@ -38,12 +38,12 @@ namespace lyx {
InsetFloatList::InsetFloatList(Buffer * buf) InsetFloatList::InsetFloatList(Buffer * buf)
: InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE), "floatlist") : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE))
{} {}
InsetFloatList::InsetFloatList(Buffer * buf, string const & type) InsetFloatList::InsetFloatList(Buffer * buf, string const & type)
: InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE), "floatlist") : InsetCommand(buf, InsetCommandParams(FLOAT_LIST_CODE))
{ {
setParam("type", from_ascii(type)); setParam("type", from_ascii(type));
} }

View File

@ -35,7 +35,7 @@ namespace lyx {
InsetHyperlink::InsetHyperlink(Buffer * buf, InsetCommandParams const & p) InsetHyperlink::InsetHyperlink(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "href") : InsetCommand(buf, p)
{} {}

View File

@ -160,7 +160,7 @@ InsetLabel * createLabel(Buffer * buf, docstring const & label_str)
InsetInclude::InsetInclude(Buffer * buf, InsetCommandParams const & p) InsetInclude::InsetInclude(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "include"), include_label(uniqueID()), : InsetCommand(buf, p), include_label(uniqueID()),
preview_(new RenderMonitoredPreview(this)), failedtoload_(false), preview_(new RenderMonitoredPreview(this)), failedtoload_(false),
set_label_(false), label_(0), child_buffer_(0) set_label_(false), label_(0), child_buffer_(0)
{ {

View File

@ -425,7 +425,7 @@ void InsetIndexParams::read(Lexer & lex)
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
InsetPrintIndex::InsetPrintIndex(Buffer * buf, InsetCommandParams const & p) InsetPrintIndex::InsetPrintIndex(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "index_print") : InsetCommand(buf, p)
{} {}

View File

@ -49,7 +49,7 @@ namespace lyx {
InsetLabel::InsetLabel(Buffer * buf, InsetCommandParams const & p) InsetLabel::InsetLabel(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "label") : InsetCommand(buf, p)
{} {}

View File

@ -42,7 +42,7 @@ using frontend::Painter;
InsetLine::InsetLine(Buffer * buf, InsetCommandParams const & p) InsetLine::InsetLine(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "line") : InsetCommand(buf, p)
{} {}

View File

@ -49,7 +49,7 @@ namespace lyx {
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
InsetNomencl::InsetNomencl(Buffer * buf, InsetCommandParams const & p) InsetNomencl::InsetNomencl(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "nomenclature"), : InsetCommand(buf, p),
nomenclature_entry_id(sgml::uniqueID(from_ascii("nomen"))) nomenclature_entry_id(sgml::uniqueID(from_ascii("nomen")))
{} {}
@ -135,7 +135,7 @@ void InsetNomencl::validate(LaTeXFeatures & features) const
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
InsetPrintNomencl::InsetPrintNomencl(Buffer * buf, InsetCommandParams const & p) InsetPrintNomencl::InsetPrintNomencl(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "nomencl_print") : InsetCommand(buf, p)
{} {}

View File

@ -36,7 +36,7 @@ namespace lyx {
InsetRef::InsetRef(Buffer * buf, InsetCommandParams const & p) InsetRef::InsetRef(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "ref") : InsetCommand(buf, p)
{} {}

View File

@ -35,7 +35,7 @@ namespace lyx {
InsetTOC::InsetTOC(Buffer * buf, InsetCommandParams const & p) InsetTOC::InsetTOC(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p, "toc") : InsetCommand(buf, p)
{} {}