]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetnote.C
Enable the external inset to handle unknown templates gracefully.
[lyx.git] / src / insets / insetnote.C
index f8b3598c7d75cab15801086e1674d488fd988d98..0fb0fb64709ff8fd868fdf1e596e25e46ecde18a 100644 (file)
@@ -1,18 +1,15 @@
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *      
- *          Copyright 1998 The LyX Team.
+/**
+ * \file insetnote.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ======================================================
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "insetnote.h"
 #include "gettext.h"
@@ -33,6 +30,7 @@ void InsetNote::init()
 {
        LyXFont font(LyXFont::ALL_SANE);
        font.decSize();
+       font.decSize();
        font.setColor(LColor::note);
        setLabelFont(font);
        setBackgroundColor(LColor::notebg);
@@ -48,46 +46,26 @@ InsetNote::InsetNote(BufferParams const & bp)
 }
 
 
-InsetNote::InsetNote(InsetNote const & in, bool same_id)
-       : InsetCollapsable(in, same_id)
+InsetNote::InsetNote(InsetNote const & in)
+       : InsetCollapsable(in)
 {
        init();
 }
 
 
-Inset * InsetNote::clone(Buffer const &, bool same_id) const
-{
-       return new InsetNote(*const_cast<InsetNote *>(this), same_id);
-}
-
-
-// This constructor is used for reading old InsetInfo
-InsetNote::InsetNote(Buffer const * buf, string const & contents, 
-                    bool collapsed)
-       : InsetCollapsable(buf->params, collapsed)
+Inset * InsetNote::clone() const
 {
-       init();
-
-       Paragraph * par = inset.paragraph();
-       LyXFont font(LyXFont::ALL_INHERIT, buf->params.language);
-
-       // Since XForms doesn't support RTL, we can assume that old notes
-       // in RTL documents are written in English.
-       if (font.language()->RightToLeft())
-               font.setLanguage(default_language);
-
-       lyx::pos_type pos = 0;
-       buf->insertStringAsLines(par, pos, font, strip(contents, '\n'));
+       return new InsetNote(*this);
 }
 
 
-string const InsetNote::editMessage() const 
+string const InsetNote::editMessage() const
 {
        return _("Opened Note Inset");
 }
 
 
-void InsetNote::write(Buffer const *buf, ostream & os) const
+void InsetNote::write(Buffer const * buf, ostream & os) const
 {
        os << getInsetName() << "\n";
        InsetCollapsable::write(buf, os);