X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFootlike.cpp;h=08cc220374d1f51ab3904aff34a78e4b9d41d0ee;hb=4a1be58591ea5a7431d9426abb27d8b946c634cb;hp=4bb185d60586dceca678758213f2b59a28e43eb5;hpb=ed858d73e57ce7aa89e38c1bc4d799362edb0227;p=lyx.git diff --git a/src/insets/InsetFootlike.cpp b/src/insets/InsetFootlike.cpp index 4bb185d605..08cc220374 100644 --- a/src/insets/InsetFootlike.cpp +++ b/src/insets/InsetFootlike.cpp @@ -17,52 +17,46 @@ #include "BufferParams.h" #include "MetricsInfo.h" +#include -namespace lyx { - +using namespace std; -InsetFootlike::InsetFootlike(BufferParams const & bp) - : InsetCollapsable(bp) -{} +namespace lyx { -InsetFootlike::InsetFootlike(InsetFootlike const & in) - : InsetCollapsable(in) +InsetFootlike::InsetFootlike(Buffer const & buf) + : InsetCollapsable(buf) {} -bool InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const { - Font tmpfont = mi.base.font; - mi.base.font = mi.base.bv->buffer().params().getFont(); + FontInfo tmpfont = mi.base.font; + mi.base.font = mi.base.bv->buffer().params().getFont().fontInfo(); 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(); + FontInfo tmpfont = pi.base.font; + pi.base.font = pi.base.bv->buffer().params().getFont().fontInfo(); 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); + InsetCollapsable::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); }