X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFootlike.cpp;h=cb92320cdfa048ff5a04c6ed28f6dec3888d7e97;hb=fd5d47d182a70de532225715a04b77fe4155aa18;hp=311af2cb30dd18b7e8f3bbe8893ed31a18fc0ad9;hpb=f7b1c86393d890d5d473279d88e26bb78f8c1275;p=lyx.git diff --git a/src/insets/InsetFootlike.cpp b/src/insets/InsetFootlike.cpp index 311af2cb30..cb92320cdf 100644 --- a/src/insets/InsetFootlike.cpp +++ b/src/insets/InsetFootlike.cpp @@ -3,7 +3,7 @@ * 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. */ @@ -15,26 +15,28 @@ #include "Buffer.h" #include "BufferView.h" #include "BufferParams.h" +#include "Font.h" #include "MetricsInfo.h" +#include "support/lstrings.h" -namespace lyx { +#include +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) + : InsetCollapsable(buf) {} 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; } @@ -42,24 +44,25 @@ void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const 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); + // The layoutName may contain a "InTitle" qualifier + os << to_utf8(token(layoutName(), char_type(':'), 0)) << "\n"; + InsetCollapsable::write(os); } bool InsetFootlike::insetAllowed(InsetCode code) const { - if (code == FOOT_CODE || code == MARGIN_CODE - || code == FLOAT_CODE) + if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE + || code == LISTINGS_CODE) return false; return InsetCollapsable::insetAllowed(code); }