]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetRef.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetRef.cpp
index 5044365eb493fc5650ea65b7cbc41d1195f4c7e0..a1c9f55e41d4a6dd97bc59bebf7f3e7e42cd7c04 100644 (file)
@@ -12,7 +12,7 @@
 #include "InsetRef.h"
 
 #include "Buffer.h"
-#include "LCursor.h"
+#include "Cursor.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "gettext.h"
@@ -42,24 +42,20 @@ InsetRef::InsetRef(InsetRef const & ir)
 {}
 
 
-void InsetRef::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetRef::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
-       case LFUN_MOUSE_PRESS:
+       case LFUN_MOUSE_RELEASE:
                // Eventually trigger dialog with button 3 not 1
                if (cmd.button() == mouse_button::button3)
-                       lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getParam("reference")));
-               else {
-                       InsetCommandMailer("ref", *this).showDialog(&cur.bv());
-                       cur.undispatched();
-               }
-               return;
-
-       case LFUN_MOUSE_RELEASE:
-               return;
+                       lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO,
+                                                 getParam("reference")));
+               else
+                       InsetCommand::doDispatch(cur, cmd);
+               break;
 
        default:
-               return InsetCommand::doDispatch(cur, cmd);
+               InsetCommand::doDispatch(cur, cmd);
        }
 }
 
@@ -84,7 +80,7 @@ docstring const InsetRef::getScreenLabel(Buffer const &) const
 
 
 int InsetRef::latex(Buffer const &, odocstream & os,
-                    OutputParams const &) const
+                   OutputParams const &) const
 {
        // Don't output p_["name"], this is only used in docbook
        InsetCommandParams p(getCmdName());
@@ -95,7 +91,7 @@ int InsetRef::latex(Buffer const &, odocstream & os,
 
 
 int InsetRef::plaintext(Buffer const &, odocstream & os,
-                        OutputParams const &) const
+                       OutputParams const &) const
 {
        docstring const str = getParam("reference");
        os << '[' << str << ']';
@@ -104,23 +100,23 @@ int InsetRef::plaintext(Buffer const &, odocstream & os,
 
 
 int InsetRef::docbook(Buffer const & buf, odocstream & os,
-                      OutputParams const & runparams) const
+                     OutputParams const & runparams) const
 {
        docstring const & name = getParam("name");
        if (name.empty()) {
                if (runparams.flavor == OutputParams::XML) {
-                       os << "<xref linkend=\"" 
-                          << sgml::cleanID(buf, runparams, getParam("reference")) 
+                       os << "<xref linkend=\""
+                          << sgml::cleanID(buf, runparams, getParam("reference"))
                           << "\" />";
                } else {
-                       os << "<xref linkend=\"" 
-                          << sgml::cleanID(buf, runparams, getParam("reference")) 
+                       os << "<xref linkend=\""
+                          << sgml::cleanID(buf, runparams, getParam("reference"))
                           << "\">";
                }
        } else {
-               os << "<link linkend=\"" 
+               os << "<link linkend=\""
                   << sgml::cleanID(buf, runparams, getParam("reference"))
-                  << "\">" 
+                  << "\">"
                   << getParam("name")
                   << "</link>";
        }