]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inseturl.C
Final touch 'inset display()'; fix 'is a bit silly' bug
[lyx.git] / src / insets / inseturl.C
index fd272a4b6011e77e6c08e025ad573b369e6ab759..13a25dd3fa7d8a095cdee4b30a71e6bf0022ae4d 100644 (file)
@@ -5,49 +5,59 @@
  *
  * \author José Matos
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
 #include "inseturl.h"
+
 #include "funcrequest.h"
-#include "BufferView.h"
-#include "LaTeXFeatures.h"
 #include "latexrunparams.h"
-#include "frontends/LyXView.h"
-#include "debug.h"
-#include "frontends/Dialogs.h"
-#include "support/lstrings.h"
+#include "LaTeXFeatures.h"
 #include "gettext.h"
 
+#include "support/lstrings.h"
+
+#include "support/std_ostream.h"
+
+using lyx::support::subst;
+
+using std::string;
 using std::ostream;
 
 
-InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
+InsetUrl::InsetUrl(InsetCommandParams const & p)
                : InsetCommand(p)
 {}
 
 
+// InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
+//             : InsetCommand(p, false)
+// {}
+
+
 InsetUrl::~InsetUrl()
 {
        InsetCommandMailer("url", *this).hideDialog();
 }
 
 
-dispatch_result InsetUrl::localDispatch(FuncRequest const & cmd)
+dispatch_result
+InsetUrl::priv_dispatch(FuncRequest const & cmd,
+                       idx_type & idx, pos_type & pos)
 {
        switch (cmd.action) {
                case LFUN_INSET_EDIT:
                        InsetCommandMailer("url", *this).showDialog(cmd.view());
                        return DISPATCHED;
                default:
-                       return InsetCommand::localDispatch(cmd);
+                       return InsetCommand::priv_dispatch(cmd, idx, pos);
        }
 }
 
 
-string const InsetUrl::getScreenLabel(Buffer const *) const
+string const InsetUrl::getScreenLabel(Buffer const &) const
 {
        string temp;
        if (getCmdName() == "url")
@@ -71,20 +81,19 @@ string const InsetUrl::getScreenLabel(Buffer const *) const
 }
 
 
-int InsetUrl::latex(Buffer const *, ostream & os,
-                   LatexRunParams const & runparams,
-                   bool /*free_spc*/) const
+int InsetUrl::latex(Buffer const &, ostream & os,
+                   LatexRunParams const & runparams) const
 {
        if (!getOptions().empty())
                os << getOptions() + ' ';
-       if (runparams.fragile)
+       if (runparams.moving_arg)
                os << "\\protect";
        os << "\\url{" << getContents() << '}';
        return 0;
 }
 
 
-int InsetUrl::ascii(Buffer const *, ostream & os, int) const
+int InsetUrl::ascii(Buffer const &, ostream & os, int) const
 {
        if (getOptions().empty())
                os << '[' << getContents() << ']';
@@ -94,7 +103,7 @@ int InsetUrl::ascii(Buffer const *, ostream & os, int) const
 }
 
 
-int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
+int InsetUrl::linuxdoc(Buffer const &, ostream & os) const
 {
        os << '<' << getCmdName()
           << " url=\""  << getContents() << "\""
@@ -104,7 +113,7 @@ int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
 }
 
 
-int InsetUrl::docbook(Buffer const *, ostream & os, bool) const
+int InsetUrl::docbook(Buffer const &, ostream & os, bool) const
 {
        os << "<ulink url=\"" << subst(getContents(),"&","&amp;")
           << "\">" << getOptions() << "</ulink>";