#include "BufferView.h"
#include "support/lstrings.h"
+using namespace lyx::support;
+
using std::ostream;
-InsetRef::InsetRef(InsetCommandParams const & p, Buffer const & buf, bool)
+InsetRef::InsetRef(InsetCommandParams const & p, Buffer const & buf)
: InsetCommand(p), isLatex(buf.isLatex())
{}
+InsetRef::InsetRef(InsetRef const & ir)
+ : InsetCommand(ir), isLatex(ir.isLatex)
+{
+}
+
+
InsetRef::~InsetRef()
{
InsetCommandMailer("ref", *this).hideDialog();
dispatch_result InsetRef::localDispatch(FuncRequest const & cmd)
{
switch (cmd.action) {
- case LFUN_INSET_EDIT:
+ case LFUN_INSET_EDIT:
// Eventually trigger dialog with button 3 not 1
if (cmd.button() == mouse_button::button3)
cmd.view()->owner()->
dispatch(FuncRequest(LFUN_REF_GOTO, getContents()));
- if (cmd.button() == mouse_button::button1)
+ else
InsetCommandMailer("ref", *this).showDialog(cmd.view());
return DISPATCHED;
-
+
default:
- return UNDISPATCHED;
+ return InsetCommand::localDispatch(cmd);
}
}
}
-int InsetRef::latex(Buffer const *, ostream & os, LatexRunParams const &,
- bool /*fs*/) const
+int InsetRef::latex(Buffer const *, ostream & os,
+ LatexRunParams const &) const
{
if (getOptions().empty())
os << escape(getCommand());