]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetnote.C
fix #832
[lyx.git] / src / insets / insetnote.C
index f07462f0f35da9313a80e60c908b04bddc07f860..1a4253d5c846a07c07017019ee670c16469f89cd 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"
 
 using std::ostream;
 
+
 void InsetNote::init()
 {
        LyXFont font(LyXFont::ALL_SANE);
        font.decSize();
+       font.decSize();
        font.setColor(LColor::note);
        setLabelFont(font);
-       setBackgroundColor(LColor::note);
+       setBackgroundColor(LColor::notebg);
        setLabel(_("note"));
        setInsetName("Note");
 }
 
 
-InsetNote::InsetNote()
-       : InsetCollapsable()
+InsetNote::InsetNote(BufferParams const & bp)
+       : InsetCollapsable(bp)
 {
        init();
 }
@@ -60,33 +59,13 @@ Inset * InsetNote::clone(Buffer const &, bool same_id) const
 }
 
 
-// This constructor is used for reading old InsetInfo
-InsetNote::InsetNote(Buffer const * buf, string const & contents, 
-                    bool collapsed)
-       : InsetCollapsable(collapsed)
-{
-       init();
-
-       Paragraph * par = inset.paragraph();
-       Paragraph::pos_type pos = 0;
-       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);
-
-       buf->insertStringAsLines(par, pos, font, strip(contents, '\n'));
-}
-
-
-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);