* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
*
* Full author contact details are available in file CREDITS.
*/
#include "Buffer.h"
#include "BufferView.h"
#include "BufferParams.h"
+#include "Font.h"
#include "MetricsInfo.h"
+#include "support/lstrings.h"
-namespace lyx {
+#include <iostream>
+using namespace std;
-InsetFootlike::InsetFootlike(BufferParams const & bp)
- : InsetCollapsable(bp)
-{}
+namespace lyx {
+using support::token;
-InsetFootlike::InsetFootlike(InsetFootlike const & in)
- : InsetCollapsable(in)
+InsetFootlike::InsetFootlike(Buffer * buf)
+ : InsetCollapsible(buf)
{}
-bool InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
-{
- Font tmpfont = mi.base.font;
- mi.base.font = mi.base.bv->buffer().params().getFont();
- InsetCollapsable::metrics(mi, dim);
- mi.base.font = tmpfont;
- bool const changed = dim_ != dim;
- dim_ = dim;
- return changed;
-}
-
-
-void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
-{
- Font tmpfont = pi.base.font;
- pi.base.font = pi.base.bv->buffer().params().getFont();
- InsetCollapsable::draw(pi, x, y);
- pi.base.font = tmpfont;
-}
-
-
-void InsetFootlike::write(Buffer const & buf, std::ostream & os) const
+void InsetFootlike::write(ostream & os) const
{
- os << to_utf8(name()) << "\n";
- InsetCollapsable::write(buf, os);
+ // The layoutName may contain a "InTitle" qualifier
+ os << to_utf8(token(layoutName(), char_type(':'), 0)) << "\n";
+ InsetCollapsible::write(os);
}
-bool InsetFootlike::insetAllowed(Inset::Code code) const
+bool InsetFootlike::insetAllowed(InsetCode code) const
{
- if (code == Inset::FOOT_CODE || code == Inset::MARGIN_CODE
- || code == Inset::FLOAT_CODE)
+ if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
return false;
- return InsetCollapsable::insetAllowed(code);
+ return InsetCollapsible::insetAllowed(code);
}