*
* \author Lars Gullik Bjønnes
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
}
-string const InsetTOC::getScreenLabel(Buffer const *) const
+string const InsetTOC::getScreenLabel(Buffer const &) const
{
string const cmdname(getCmdName());
}
+void InsetTOC::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+ InsetCommand::metrics(mi, dim);
+ center_indent_ = (mi.base.textwidth - dim.wid) / 2;
+ dim.wid = mi.base.textwidth;
+ dim_ = dim;
+}
+
+
+void InsetTOC::draw(PainterInfo & pi, int x, int y) const
+{
+ InsetCommand::draw(pi, x + center_indent_, y);
+}
+
+
dispatch_result InsetTOC::localDispatch(FuncRequest const & cmd)
{
switch (cmd.action) {
}
-int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
+int InsetTOC::ascii(Buffer const & buffer, ostream & os, int) const
{
os << getScreenLabel(buffer) << "\n\n";
}
-int InsetTOC::linuxdoc(Buffer const *, ostream & os) const
+int InsetTOC::linuxdoc(Buffer const &, ostream & os) const
{
if (getCmdName() == "tableofcontents")
os << "<toc>";
}
-int InsetTOC::docbook(Buffer const *, ostream & os, bool) const
+int InsetTOC::docbook(Buffer const &, ostream & os, bool) const
{
if (getCmdName() == "tableofcontents")
os << "<toc></toc>";