]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLabel.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetLabel.cpp
index d1ad08336ceb9fbc1d62ca37efb114c4ed67416e..b1adabbf7937a21b0e802a5ef015f7713e919472 100644 (file)
 
 #include "InsetLabel.h"
 
-#include "buffer.h"
+#include "Buffer.h"
 #include "BufferView.h"
-#include "dispatchresult.h"
-#include "funcrequest.h"
-#include "InsetList.h"
-#include "lyxtext.h"
-#include "paragraph.h"
-#include "pariterator.h"
+#include "DispatchResult.h"
+#include "FuncRequest.h"
+#include "Text.h"
 #include "sgml.h"
 
 #include "support/lstrings.h"
 #include "support/lyxalgo.h"
-#include "support/std_ostream.h"
 
 
 namespace lyx {
 
-using support::escape;
-
-using std::string;
-using std::ostream;
-using std::vector;
-
 
 InsetLabel::InsetLabel(InsetCommandParams const & p)
        : InsetCommand(p, "label")
 {}
 
 
-std::auto_ptr<InsetBase> InsetLabel::doClone() const
+Inset * InsetLabel::clone() const
 {
-       return std::auto_ptr<InsetBase>(new InsetLabel(params()));
+       return new InsetLabel(params());
 }
 
 
@@ -59,7 +49,7 @@ docstring const InsetLabel::getScreenLabel(Buffer const &) const
 }
 
 
-void InsetLabel::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
 
@@ -72,8 +62,8 @@ void InsetLabel::doDispatch(LCursor & cur, FuncRequest & cmd)
                        break;
                }
                if (p["name"] != params()["name"])
-                       cur.bv().buffer()->changeRefsIfUnique(params()["name"],
-                                       p["name"], InsetBase::REF_CODE);
+                       cur.bv().buffer().changeRefsIfUnique(params()["name"],
+                                       p["name"], Inset::REF_CODE);
                setParams(p);
                break;
        }
@@ -86,15 +76,15 @@ void InsetLabel::doDispatch(LCursor & cur, FuncRequest & cmd)
 
 
 int InsetLabel::latex(Buffer const &, odocstream & os,
-                      OutputParams const &) const
+                     OutputParams const &) const
 {
-       os << escape(getCommand());
+       os << support::escape(getCommand());
        return 0;
 }
 
 
 int InsetLabel::plaintext(Buffer const &, odocstream & os,
-                          OutputParams const &) const
+                         OutputParams const &) const
 {
        docstring const str = getParam("name");
        os << '<' << str << '>';
@@ -103,11 +93,11 @@ int InsetLabel::plaintext(Buffer const &, odocstream & os,
 
 
 int InsetLabel::docbook(Buffer const & buf, odocstream & os,
-                        OutputParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        os << "<!-- anchor id=\""
-           << sgml::cleanID(buf, runparams, getParam("name"))
-           << "\" -->";
+          << sgml::cleanID(buf, runparams, getParam("name"))
+          << "\" -->";
        return 0;
 }