mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
d32d0cbb95
inserting characters in insets (forced font change) which does not work as the method seems not to be called. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2366 a592a061-630c-0410-9148-cb99ea01b6c8
86 lines
1.6 KiB
C
86 lines
1.6 KiB
C
/* This file is part of
|
|
* ======================================================
|
|
*
|
|
* LyX, The Document Processor
|
|
*
|
|
* Copyright 1998 The LyX Team.
|
|
*
|
|
* ======================================================
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#ifdef __GNUG__
|
|
#pragma implementation
|
|
#endif
|
|
|
|
#include "insetnote.h"
|
|
#include "gettext.h"
|
|
#include "lyxfont.h"
|
|
#include "buffer.h"
|
|
#include "BufferView.h"
|
|
#include "lyxtext.h"
|
|
#include "insets/insettext.h"
|
|
#include "support/LOstream.h"
|
|
#include "support/lstrings.h"
|
|
#include "debug.h"
|
|
|
|
using std::ostream;
|
|
|
|
void InsetNote::init()
|
|
{
|
|
LyXFont font(LyXFont::ALL_SANE);
|
|
font.decSize();
|
|
font.setColor(LColor::note);
|
|
setLabelFont(font);
|
|
setBackgroundColor(LColor::note);
|
|
setLabel(_("note"));
|
|
setInsetName("Note");
|
|
}
|
|
|
|
|
|
InsetNote::InsetNote()
|
|
: InsetCollapsable()
|
|
{
|
|
init();
|
|
}
|
|
|
|
|
|
InsetNote::InsetNote(InsetNote const & in, bool same_id)
|
|
: InsetCollapsable(in, same_id)
|
|
{
|
|
init();
|
|
}
|
|
|
|
|
|
Inset * InsetNote::clone(Buffer const &, bool same_id) const
|
|
{
|
|
return new InsetNote(*const_cast<InsetNote *>(this), same_id);
|
|
}
|
|
|
|
|
|
InsetNote::InsetNote(Buffer const * buf, string const & contents,
|
|
bool collapsed)
|
|
: InsetCollapsable(collapsed)
|
|
{
|
|
init();
|
|
|
|
Paragraph * par = inset.paragraph();
|
|
Paragraph::size_type pos = 0;
|
|
buf->insertStringAsLines(par, pos, LyXFont(LyXFont::ALL_INHERIT),
|
|
strip(contents, '\n'));
|
|
}
|
|
|
|
|
|
string const InsetNote::editMessage() const
|
|
{
|
|
return _("Opened Note Inset");
|
|
}
|
|
|
|
|
|
void InsetNote::write(Buffer const *buf, ostream & os) const
|
|
{
|
|
os << getInsetName() << "\n";
|
|
InsetCollapsable::write(buf, os);
|
|
}
|