]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetref.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insetref.C
index 0231e58d7b871d1c9cfa926aaacc17ad6203d070..8edc5ec140bdc678a43a80b9a5753f553d2d59cd 100644 (file)
 #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();
@@ -37,17 +45,17 @@ InsetRef::~InsetRef()
 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);
        }
 }
 
@@ -72,7 +80,7 @@ string const InsetRef::getScreenLabel(Buffer const *) const
 
 
 int InsetRef::latex(Buffer const *, ostream & os,
-                   bool /*fragile*/, bool /*fs*/) const
+                   LatexRunParams const &) const
 {
        if (getOptions().empty())
                os << escape(getCommand());