X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetPhantom.cpp;h=4771cb83ee42899992846295e967d8b67141d664;hb=a6b07608d8e9de24383d3ebaec20b6b265ed9314;hp=78bc55ed82ab993d6b2557f80b8860ad7143f390;hpb=8aaec85c8cc43d2317b684b0977eb47dd686af96;p=features.git diff --git a/src/insets/InsetPhantom.cpp b/src/insets/InsetPhantom.cpp index 78bc55ed82..4771cb83ee 100644 --- a/src/insets/InsetPhantom.cpp +++ b/src/insets/InsetPhantom.cpp @@ -16,7 +16,6 @@ #include "BufferParams.h" #include "BufferView.h" #include "BufferParams.h" -#include "Counters.h" #include "Cursor.h" #include "Dimension.h" #include "DispatchResult.h" @@ -85,7 +84,7 @@ PhantomTranslatorLoc const & phantomtranslator_loc() return translator; } -} // anon +} // namespace InsetPhantomParams::InsetPhantomParams() @@ -116,7 +115,7 @@ void InsetPhantomParams::read(Lexer & lex) ///////////////////////////////////////////////////////////////////// InsetPhantom::InsetPhantom(Buffer * buf, string const & label) - : InsetCollapsable(buf) + : InsetCollapsible(buf) { setDrawFrame(false); params_.type = phantomtranslator().find(label); @@ -135,19 +134,10 @@ docstring InsetPhantom::layoutName() const } -void InsetPhantom::metrics(MetricsInfo & mi, Dimension & dim) const -{ - InsetCollapsable::metrics(mi, dim); - - // cache the inset dimension - setDimCache(mi, dim); -} - - void InsetPhantom::draw(PainterInfo & pi, int x, int y) const { // draw the text - InsetCollapsable::draw(pi, x, y); + InsetCollapsible::draw(pi, x, y); // draw the inset marker drawMarkers(pi, x, y); @@ -204,10 +194,10 @@ void InsetPhantom::draw(PainterInfo & pi, int x, int y) const // | | | | // x1 x2 x3 x4 - x = x + TEXT_TO_INSET_OFFSET; + x += leftOffset(pi.base.bv); int const x1 = x; int const x2 = x + arrow_size; - int const x4 = x + dim.wid - 2 * TEXT_TO_INSET_OFFSET; + int const x4 = x + dim.wid - leftOffset(pi.base.bv) - rightOffset(pi.base.bv); int const x3 = x4 - arrow_size; int const y2 = y + (dim.des - dim.asc) / 2; @@ -231,14 +221,14 @@ void InsetPhantom::draw(PainterInfo & pi, int x, int y) const void InsetPhantom::write(ostream & os) const { params_.write(os); - InsetCollapsable::write(os); + InsetCollapsible::write(os); } void InsetPhantom::read(Lexer & lex) { params_.read(lex); - InsetCollapsable::read(lex); + InsetCollapsible::read(lex); } @@ -273,7 +263,7 @@ void InsetPhantom::doDispatch(Cursor & cur, FuncRequest & cmd) break; default: - InsetCollapsable::doDispatch(cur, cmd); + InsetCollapsible::doDispatch(cur, cmd); break; } } @@ -298,7 +288,7 @@ bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd, return true; default: - return InsetCollapsable::getStatus(cur, cmd, flag); + return InsetCollapsible::getStatus(cur, cmd, flag); } } @@ -329,7 +319,7 @@ void InsetPhantom::latex(otexstream & os, OutputParams const & runparams) const os << "\\phantom{"; break; } - InsetCollapsable::latex(os, runparams); + InsetCollapsible::latex(os, runparams); os << "}"; } @@ -351,7 +341,7 @@ int InsetPhantom::plaintext(odocstringstream & os, os << '[' << buffer().B_("phantom") << ":"; break; } - InsetCollapsable::plaintext(os, runparams, max_length); + InsetCollapsible::plaintext(os, runparams, max_length); os << "]"; return PLAINTEXT_NEWLINE; @@ -370,14 +360,14 @@ int InsetPhantom::docbook(odocstream & os, OutputParams const & runparams) const break; } os << "<" + cmdname + ">"; - int const i = InsetCollapsable::docbook(os, runparams); + int const i = InsetCollapsible::docbook(os, runparams); os << ""; return i; } -docstring InsetPhantom::xhtml(XHTMLStream &, OutputParams const &) const +docstring InsetPhantom::xhtml(XMLStream &, OutputParams const &) const { return docstring(); }