]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLabel.cpp
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / InsetLabel.cpp
index 33772da8e8ee121810d2fb06d43397757a6fed67..93ccc40b28abc591ef469875ba958b064e548d60 100644 (file)
@@ -23,6 +23,7 @@
 #include "FuncStatus.h"
 #include "InsetIterator.h"
 #include "LyXFunc.h"
+#include "output_xhtml.h"
 #include "ParIterator.h"
 #include "sgml.h"
 #include "Text.h"
@@ -141,8 +142,8 @@ bool InsetLabel::getStatus(Cursor & cur, FuncRequest const & cmd,
 {
        bool enabled;
        switch (cmd.action) {
-       case LFUN_INSERT_LABEL_AS_REF:
-       case LFUN_COPY_LABEL_AS_REF:
+       case LFUN_LABEL_INSERT_AS_REF:
+       case LFUN_LABEL_COPY_AS_REF:
                enabled = true;
                break;
        default:
@@ -171,15 +172,15 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_COPY_LABEL_AS_REF: {
+       case LFUN_LABEL_COPY_AS_REF: {
                InsetCommandParams p(REF_CODE, "ref");
                p["reference"] = getParam("name");
                cap::clearSelection();
-               cap::copyInset(cur, new InsetRef(*cur.buffer(), p), getParam("name"));
+               cap::copyInset(cur, new InsetRef(buffer(), p), getParam("name"));
                break;
        }
 
-       case LFUN_INSERT_LABEL_AS_REF: {
+       case LFUN_LABEL_INSERT_AS_REF: {
                InsetCommandParams p(REF_CODE, "ref");
                p["reference"] = getParam("name");
                string const data = InsetCommand::params2string("ref", p);
@@ -218,4 +219,10 @@ int InsetLabel::docbook(odocstream & os, OutputParams const & runparams) const
 }
 
 
+docstring InsetLabel::xhtml(odocstream & os, OutputParams const &) const
+{
+       os << "<a name=\"" << html::htmlize(getParam("name")) << "\"></a>";
+       return docstring();
+}
+
 } // namespace lyx