]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettheorem.C
fix #832
[lyx.git] / src / insets / insettheorem.C
index 1f4068773dcf4ea414ca8ad3392f0dc4721ff431..c6358e2cc3274e78d850e2f2d96f724cedabcec3 100644 (file)
@@ -1,18 +1,15 @@
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *      
- *          Copyright 1998 The LyX Team.
+/**
+ * \file insettheorem.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ======================================================
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "insettheorem.h"
 #include "gettext.h"
@@ -42,23 +39,28 @@ InsetTheorem::InsetTheorem()
        font.decSize();
        font.setColor(LColor::collapsable);
        setLabelFont(font);
+#if 0
        setAutoCollapse(false);
+#endif
        setInsetName("Theorem");
 }
 
 
-void InsetTheorem::write(Buffer const * buf, ostream & os) const 
+void InsetTheorem::write(Buffer const * buf, ostream & os) const
 {
        os << getInsetName() << "\n";
        InsetCollapsable::write(buf, os);
 }
 
 
-Inset * InsetTheorem::clone(Buffer const &) const
+Inset * InsetTheorem::clone(Buffer const &, bool) const
 {
+#ifdef WITH_WARNINGS
+#warning Is this inset used? If YES this is WRONG!!! (Jug)
+#endif
        InsetTheorem * result = new InsetTheorem;
-       
-       result->collapsed = collapsed;
+
+       result->collapsed_ = collapsed_;
        return result;
 }
 
@@ -73,21 +75,9 @@ int InsetTheorem::latex(Buffer const * buf,
                        ostream & os, bool fragile, bool fp) const
 {
        os << "\\begin{theorem}%\n";
-       
+
        int i = inset.latex(buf, os, fragile, fp);
        os << "\\end{theorem}%\n";
-       
-       return i + 2;
-}
-
 
-bool InsetTheorem::insertInsetAllowed(Inset * inset) const
-{
-       lyxerr << "InsetTheorem::InsertInsetAllowed" << endl;
-       
-       if ((inset->lyxCode() == Inset::FOOT_CODE) ||
-           (inset->lyxCode() == Inset::MARGIN_CODE)) {
-               return false;
-       }
-       return true;
+       return i + 2;
 }