]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathRef.cpp
fix off-by-two drawing error
[lyx.git] / src / mathed / InsetMathRef.cpp
index a9c115fcf527dc7a8f02ea8d8d6adfa0347c98ab..8ba745fdc4dc1b6062a93d4c282951fa281e7300 100644 (file)
@@ -36,12 +36,12 @@ using namespace std;
 namespace lyx {
 
 InsetMathRef::InsetMathRef()
-       : CommandInset(from_ascii("ref"))
+       : CommandInset(from_ascii("ref"), false)
 {}
 
 
 InsetMathRef::InsetMathRef(docstring const & data)
-       : CommandInset(data)
+       : CommandInset(data, false)
 {}
 
 
@@ -114,7 +114,7 @@ bool InsetMathRef::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_MOUSE_RELEASE:
        case LFUN_MOUSE_PRESS:
        case LFUN_MOUSE_MOTION:
-               status.enabled(true);
+               status.setEnabled(true);
                return true;
        default:
                return CommandInset::getStatus(cur, cmd, status);
@@ -147,22 +147,23 @@ void InsetMathRef::validate(LaTeXFeatures & features) const
                features.require("varioref");
        else if (commandname() == "prettyref")
                features.require("prettyref");
+       else if (commandname() == "eqref")
+               features.require("amsmath");
 }
 
 
-int InsetMathRef::docbook(Buffer const & buf, odocstream & os,
-                     OutputParams const & runparams) const
+int InsetMathRef::docbook(odocstream & os, OutputParams const & runparams) const
 {
        if (cell(1).empty()) {
                os << "<xref linkend=\""
-                  << sgml::cleanID(buf, runparams, asString(cell(0)));
+                  << sgml::cleanID(buffer(), runparams, asString(cell(0)));
                if (runparams.flavor == OutputParams::XML)
                        os << "\"/>";
                else
                        os << "\">";
        } else {
                os << "<link linkend=\""
-                  << sgml::cleanID(buf, runparams, asString(cell(0)))
+                  << sgml::cleanID(buffer(), runparams, asString(cell(0)))
                   << "\">"
                   << asString(cell(1))
                   << "</link>";
@@ -178,12 +179,12 @@ string const InsetMathRef::createDialogStr(string const & name) const
        icp["reference"] = asString(cell(0));
        if (!cell(1).empty())
                icp["name"] = asString(cell(1));
-       return InsetCommandMailer::params2string(name, icp);
+       return InsetCommand::params2string(name, icp);
 }
 
 
 InsetMathRef::ref_type_info InsetMathRef::types[] = {
-       { from_ascii("ref"),       from_ascii(N_("Standard[[mathref]]")),              from_ascii(N_("Ref: "))},
+       { from_ascii("ref"),       from_ascii(N_("Standard[[mathref]]")),   from_ascii(N_("Ref: "))},
        { from_ascii("eqref"),     from_ascii(N_("Equation")),              from_ascii(N_("EqRef: "))},
        { from_ascii("pageref"),   from_ascii(N_("Page Number")),           from_ascii(N_("Page: "))},
        { from_ascii("vpageref"),  from_ascii(N_("Textual Page Number")),   from_ascii(N_("TextPage: "))},