]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetoptarg.C
Final touch 'inset display()'; fix 'is a bit silly' bug
[lyx.git] / src / insets / insetoptarg.C
index bc202a9ed83da7e6b1a36e20328a8e9115f4bd62..94da626e58d9e55a3f50c3b5ee8d930d38e69255 100644 (file)
@@ -1,32 +1,27 @@
 /**
  * \file insetoptarg.C
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Martin Vermeer  <martin.vermeer@hut.fi>
+ * \author Martin Vermeer
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include "insetoptarg.h"
 
 #include "debug.h"
-
-#include "insetoptarg.h"
-#include "support/LOstream.h"
-#include "frontends/Alert.h"
-#include "support/lstrings.h" // frontStrip, strip
-#include "lyxtext.h"
-#include "buffer.h"
 #include "gettext.h"
-#include "BufferView.h"
-#include "support/lstrings.h"
+#include "LColor.h"
+#include "paragraph.h"
 
+
+using std::string;
+using std::auto_ptr;
 using std::ostream;
-using std::vector;
-using std::pair;
+
 
 InsetOptArg::InsetOptArg(BufferParams const & ins)
        : InsetCollapsable(ins, true)
@@ -38,8 +33,8 @@ InsetOptArg::InsetOptArg(BufferParams const & ins)
 }
 
 
-InsetOptArg::InsetOptArg(InsetOptArg const & in, bool same_id)
-       : InsetCollapsable(in, same_id)
+InsetOptArg::InsetOptArg(InsetOptArg const & in)
+       : InsetCollapsable(in)
 {
        LyXFont font(LyXFont::ALL_SANE);
        font.setColor(LColor::collapsable);
@@ -48,9 +43,9 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in, bool same_id)
 }
 
 
-Inset * InsetOptArg::clone(Buffer const &, bool same_id) const
+auto_ptr<InsetBase> InsetOptArg::clone() const
 {
-       return new InsetOptArg(*this, same_id);
+       return auto_ptr<InsetBase>(new InsetOptArg(*this));
 }
 
 
@@ -60,24 +55,25 @@ string const InsetOptArg::editMessage() const
 }
 
 
-void InsetOptArg::write(Buffer const * buf, ostream & os) const
+void InsetOptArg::write(Buffer const & buf, ostream & os) const
 {
        os << "OptArg" << "\n";
        InsetCollapsable::write(buf, os);
 }
 
-int InsetOptArg::latex(Buffer const *, ostream &, bool, bool) const
+
+int InsetOptArg::latex(Buffer const &, ostream &,
+                      LatexRunParams const &) const
 {
        return 0;
 }
 
-int InsetOptArg::latexOptional(Buffer const * buf, ostream & os,
-                               bool, bool fp) const
+
+int InsetOptArg::latexOptional(Buffer const & buf, ostream & os,
+                              LatexRunParams const & runparams) const
 {
        os << '[';
-       int const i = inset.latex(buf, os, false, fp);
+       int const i = inset.latex(buf, os, runparams);
        os << ']';
        return i + 2;
 }