#include "insets/InsetExternal.h"
#include "insets/InsetFloat.h"
#include "insets/InsetGraphics.h"
#include "insets/InsetExternal.h"
#include "insets/InsetFloat.h"
#include "insets/InsetGraphics.h"
#include "insets/InsetListings.h"
#include "insets/InsetNote.h"
#include "insets/InsetPhantom.h"
#include "insets/InsetListings.h"
#include "insets/InsetNote.h"
#include "insets/InsetPhantom.h"
-InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p,
- string const & mailer_name)
- : Inset(buf), p_(p),
- mailer_name_(mailer_name),
- mouse_hover_()
+InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p)
+ : Inset(buf), p_(p)
{}
// The sole purpose of this copy constructor is to make sure
// that the mouse_hover_ map is not copied and remains empty.
InsetCommand::InsetCommand(InsetCommand const & rhs)
{}
// The sole purpose of this copy constructor is to make sure
// that the mouse_hover_ map is not copied and remains empty.
InsetCommand::InsetCommand(InsetCommand const & rhs)
- if (!mailer_name_.empty())
- hideDialogs(mailer_name_, this);
+ if (p_.code() != NO_CODE)
+ hideDialogs(insetName(p_.code()), this);
+
map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
map<BufferView const *, bool>::iterator end = mouse_hover_.end();
for (; it != end; ++it)
map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
map<BufferView const *, bool>::iterator end = mouse_hover_.end();
for (; it != end; ++it)
button_.metrics(mi, dim);
}
bool InsetCommand::setMouseHover(BufferView const * bv, bool mouse_hover)
button_.metrics(mi, dim);
}
bool InsetCommand::setMouseHover(BufferView const * bv, bool mouse_hover)
-int InsetCommand::plaintext(odocstream & os, OutputParams const &) const
+int InsetCommand::plaintext(odocstringstream & os,
+ OutputParams const &, size_t) const
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
string const newtype = cmd.getArg(1);
status.setEnabled(p_.isCompatibleCommand(p_.code(), newtype));
status.setOnOff(newtype == p_.getCmdName());
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
string const newtype = cmd.getArg(1);
status.setEnabled(p_.isCompatibleCommand(p_.code(), newtype));
status.setOnOff(newtype == p_.getCmdName());
- if (!mailer_name_.empty())
- bv->showDialog(mailer_name_, params2string(mailer_name_, p_),
+ if (p_.code() != NO_CODE)
+ bv->showDialog(insetName(p_.code()), params2string(p_),
-// FIXME This could take an InsetCode instead of a string
-bool InsetCommand::string2params(string const & name, string const & in,
+bool InsetCommand::string2params(string const & data,
-// FIXME This could take an InsetCode instead of a string
-string InsetCommand::params2string(string const & name,
- InsetCommandParams const & params)
+string InsetCommand::params2string(InsetCommandParams const & params)
// default type is requested
data = "include";
InsetCommandParams p(INCLUDE_CODE, data);
// default type is requested
data = "include";
InsetCommandParams p(INCLUDE_CODE, data);