X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathBrace.cpp;h=8b06f6d546d06c9095814b75dd12c8209b764d61;hb=c9d9309c1ecffa218dee04ce4f7991ed4fc0c9bb;hp=82797359feb79d93efb4c0ddc1215c3db488de2b;hpb=9daf07588f49b52eb5e2fd5e8e8a58705e2e447e;p=lyx.git diff --git a/src/mathed/InsetMathBrace.cpp b/src/mathed/InsetMathBrace.cpp index 82797359fe..8b06f6d546 100644 --- a/src/mathed/InsetMathBrace.cpp +++ b/src/mathed/InsetMathBrace.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. */ @@ -21,17 +21,19 @@ #include "frontends/Painter.h" #include +#include +using namespace std; namespace lyx { -InsetMathBrace::InsetMathBrace() - : InsetMathNest(1) +InsetMathBrace::InsetMathBrace(Buffer * buf) + : InsetMathNest(buf, 1) {} InsetMathBrace::InsetMathBrace(MathData const & ar) - : InsetMathNest(1) + : InsetMathNest(const_cast(ar.buffer()), 1) { cell(0) = ar; } @@ -47,19 +49,21 @@ void InsetMathBrace::metrics(MetricsInfo & mi, Dimension & dim) const { Dimension dim0; cell(0).metrics(mi, dim0); - Dimension t = theFontMetrics(mi.base.font).dimension('{'); - dim.asc = std::max(dim0.asc, t.asc); - dim.des = std::max(dim0.des, t.des); + FontInfo font = mi.base.font; + augmentFont(font, from_ascii("mathnormal")); + Dimension t = theFontMetrics(font).dimension('{'); + dim.asc = max(dim0.asc, t.asc); + dim.des = max(dim0.des, t.des); dim.wid = dim0.width() + 2 * t.wid; metricsMarkers(dim); - // Cache the inset dimension. - setDimCache(mi, dim); } void InsetMathBrace::draw(PainterInfo & pi, int x, int y) const { FontInfo font = pi.base.font; + augmentFont(font, from_ascii("mathnormal")); + font.setShape(UP_SHAPE); font.setColor(Color_latex); Dimension t = theFontMetrics(font).dimension('{'); pi.pain.text(x, y, '{', font); @@ -100,6 +104,12 @@ void InsetMathBrace::mathmlize(MathStream & os) const } +void InsetMathBrace::htmlize(HtmlStream & os) const +{ + os << cell(0); +} + + void InsetMathBrace::mathematica(MathematicaStream & os) const { os << cell(0);