X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFootlike.cpp;h=36fc9945b8bbf3be8bded8cc4f8156717d7e8bed;hb=8124e6c02ea1fd6779bb6c47ffe2bca2c8bd2d97;hp=77595c56b70c32403a2c7d02bd4830d5307589ff;hpb=237c132c1e6fc720b87f2fea6deb18a8395cbe0a;p=lyx.git diff --git a/src/insets/InsetFootlike.cpp b/src/insets/InsetFootlike.cpp index 77595c56b7..36fc9945b8 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,53 +15,37 @@ #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) + : InsetCollapsible(buf) {} -void 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; -} - - -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); }