X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathUnknown.cpp;h=926e7dd5d5ced43f457f79a3585bf8d0c866eae9;hb=f1dd80f464b46f6112f6c9a64a70dd3da76cbe7f;hp=50032bf9b5526319c164bf966fdce808f6bf00e3;hpb=ed858d73e57ce7aa89e38c1bc4d799362edb0227;p=lyx.git diff --git a/src/mathed/InsetMathUnknown.cpp b/src/mathed/InsetMathUnknown.cpp index 50032bf9b5..926e7dd5d5 100644 --- a/src/mathed/InsetMathUnknown.cpp +++ b/src/mathed/InsetMathUnknown.cpp @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz + * \author André Pönitz * * Full author contact details are available in file CREDITS. */ @@ -11,23 +11,23 @@ #include #include "InsetMathUnknown.h" + #include "MathSupport.h" #include "MathAtom.h" #include "MathStream.h" -#include "MathStream.h" +#include "MetricsInfo.h" -namespace lyx { +#include "frontends/Painter.h" -InsetMathUnknown::InsetMathUnknown(docstring const & nm, bool final, bool black) - : name_(nm), final_(final), black_(black) -{} +namespace lyx { -Inset * InsetMathUnknown::clone() const -{ - return new InsetMathUnknown(*this); -} +InsetMathUnknown::InsetMathUnknown(docstring const & nm, + docstring const & selection, bool final, bool black) + : name_(nm), final_(final), black_(black), kerning_(0), + selection_(selection) +{} docstring InsetMathUnknown::name() const @@ -48,15 +48,11 @@ void InsetMathUnknown::normalize(NormalStream & os) const } -bool InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const { - mathed_string_dim(mi.base.font, name_, dim); + metricsStrRedBlack(mi, dim, name_); docstring::const_reverse_iterator rit = name_.rbegin(); kerning_ = mathed_char_kerning(mi.base.font, *rit); - if (dim_ == dim) - return false; - dim_ = dim; - return true; } @@ -66,7 +62,6 @@ void InsetMathUnknown::draw(PainterInfo & pi, int x, int y) const drawStrBlack(pi, x, y, name_); else drawStrRed(pi, x, y, name_); - setPosCache(pi, x, y); } @@ -94,9 +89,15 @@ void InsetMathUnknown::mathematica(MathematicaStream & os) const } -void InsetMathUnknown::mathmlize(MathStream & os) const +void InsetMathUnknown::mathmlize(MathStream &) const +{ + throw MathExportException(); +} + + +void InsetMathUnknown::htmlize(HtmlStream &) const { - os << MTag("mi") << name_ << ETag("mi"); + throw MathExportException(); }