* \author Martin Vermeer
* \author Jürgen Spitzmüller
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "Lsstream.h"
#include "insetnote.h"
+#include "metricsinfo.h"
#include "gettext.h"
#include "lyxfont.h"
#include "language.h"
}
-void InsetNote::write(Buffer const * buf, ostream & os) const
+void InsetNote::write(Buffer const & buf, ostream & os) const
{
params_.write(os);
InsetCollapsable::write(buf, os);
}
-void InsetNote::read(Buffer const * buf, LyXLex & lex)
+void InsetNote::read(Buffer const & buf, LyXLex & lex)
{
InsetCollapsable::read(buf, lex);
setButtonLabel();
}
+void InsetNote::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+ InsetCollapsable::metrics(mi, dim);
+ // Contrary to Greyedout, these cannot be construed as part of the
+ // running text: make them stand on their own
+ if (params_.type == "Note" || params_.type == "Comment")
+ if (!collapsed_)
+ dim.wid = mi.base.textwidth;
+ dim_ = dim;
+}
+
+
bool InsetNote::showInsetDialog(BufferView * bv) const
{
InsetNoteMailer("note", const_cast<InsetNote &>(*this)).showDialog(bv);
InsetNoteMailer::string2params(cmd.argument, params);
params_.type = params.type;
setButtonLabel();
- bv->updateInset();
+ bv->updateInset(this);
return DISPATCHED;
}
}
-int InsetNote::latex(Buffer const * buf, ostream & os,
+int InsetNote::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
string const pt = params_.type;
if (pt == "Comment") {
os << "%\n\\end{comment}\n";
- i += 3;
+ i += 4;
} else if (pt == "Greyedout") {
os << "%\n\\end{lyxgreyedout}\n";
- i += 2;
- }
+ i += 4;
+ }
return i;
}
-int InsetNote::linuxdoc(Buffer const * buf, std::ostream & os) const
+int InsetNote::linuxdoc(Buffer const & buf, std::ostream & os) const
{
string const pt = params_.type;
}
-int InsetNote::docbook(Buffer const * buf, std::ostream & os, bool mixcont) const
+int InsetNote::docbook(Buffer const & buf, std::ostream & os, bool mixcont) const
{
string const pt = params_.type;
}
-int InsetNote::ascii(Buffer const * buf, std::ostream & os, int ll) const
+int InsetNote::ascii(Buffer const & buf, std::ostream & os, int ll) const
{
int i = 0;
string const pt = params_.type;