#include "InsetNote.h"
+#include "Buffer.h"
#include "BufferView.h"
#include "Cursor.h"
#include "debug.h"
void InsetNote::init()
{
- setInsetName(from_ascii("Note"));
setButtonLabel();
}
}
-auto_ptr<InsetBase> InsetNote::doClone() const
+auto_ptr<Inset> InsetNote::doClone() const
{
- return auto_ptr<InsetBase>(new InsetNote(*this));
+ return auto_ptr<Inset>(new InsetNote(*this));
}
}
+Inset::DisplayType InsetNote::display() const
+{
+ switch (params_.type) {
+ case InsetNoteParams::Framed:
+ case InsetNoteParams::Shaded:
+ return AlignLeft;
+ default:
+ return Inline;
+ }
+}
+
+
void InsetNote::write(Buffer const & buf, ostream & os) const
{
params_.write(os);
docstring const label = notetranslator_loc().find(params_.type);
setLabel(label);
- LyXFont font(LyXFont::ALL_SANE);
+ Font font(Font::ALL_SANE);
font.decSize();
font.decSize();
int InsetNote::plaintext(Buffer const & buf, odocstream & os,
- OutputParams const & runparams_in) const
+ OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
// Ignore files that are exported inside a comment
runparams.exportdata.reset(new ExportData);
}
- os << '[' << _("note") << ":\n";
+ os << '[' << buf.B_("note") << ":\n";
InsetText::plaintext(buf, os, runparams);
os << "\n]";
int InsetNote::docbook(Buffer const & buf, odocstream & os,
- OutputParams const & runparams_in) const
+ OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
// Return how many newlines we issued.
//return int(count(str.begin(), str.end(), '\n'));
- return n + 1 + 2;
+ return n + 1 + 2;
}
return print_mailer_error("InsetNoteMailer", in, 1, name_);
// This is part of the inset proper that is usually swallowed
- // by LyXText::readInset
+ // by Text::readInset
string id;
lex >> id;
if (!lex || id != "Note")