X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathSpace.cpp;h=fcef36c1a1ca50eb829661e2ac099e66f8f063ed;hb=d9082639080b9de993742bd352f92e5183058cf5;hp=0adce6ff28e3458b21813ee0c558903c9d102703;hpb=86d9abeea7f9a0c0c7b63540ea20c41264cde991;p=lyx.git diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp index 0adce6ff28..fcef36c1a1 100644 --- a/src/mathed/InsetMathSpace.cpp +++ b/src/mathed/InsetMathSpace.cpp @@ -75,7 +75,7 @@ SpaceInfo space_info[] = { int const nSpace = sizeof(space_info)/sizeof(SpaceInfo); int const defaultSpace = 4; -} // anon namespace +} // namespace InsetMathSpace::InsetMathSpace() : space_(defaultSpace) @@ -125,7 +125,7 @@ void InsetMathSpace::metrics(MetricsInfo & mi, Dimension & dim) const dim.asc = 4; dim.des = 0; if (space_info[space_].custom) - dim.wid = abs(length_.inPixels(mi.base)); + dim.wid = abs(mi.base.inPixels(length_)); else dim.wid = space_info[space_].width; } @@ -195,7 +195,7 @@ void InsetMathSpace::octave(OctaveStream & os) const } -void InsetMathSpace::mathmlize(MathStream & ms) const +void InsetMathSpace::mathmlize(MathMLStream & ms) const { SpaceInfo const & si = space_info[space_]; if (si.negative || !si.visible) @@ -208,14 +208,14 @@ void InsetMathSpace::mathmlize(MathStream & ms) const ss << si.width; l = ss.str() + "px"; } - - ms << ""; } - + void InsetMathSpace::htmlize(HtmlStream & ms) const { SpaceInfo const & si = space_info[space_]; @@ -246,7 +246,7 @@ void InsetMathSpace::htmlize(HtmlStream & ms) const case InsetSpaceParams::CUSTOM: case InsetSpaceParams::CUSTOM_PROTECTED: { string l = length_.asHTMLString(); - ms << MTag("span", "width='" + l + "'") + ms << MTag("span", "width='" + l + "'") << from_ascii(" ") << ETag("span"); break; } @@ -259,14 +259,14 @@ void InsetMathSpace::htmlize(HtmlStream & ms) const } } - + void InsetMathSpace::normalize(NormalStream & os) const { os << "[space " << int(space_) << "] "; } -void InsetMathSpace::write(WriteStream & os) const +void InsetMathSpace::write(TeXMathStream & os) const { // All kinds work in text and math mode, so simply suspend // writing a possibly pending mode closing brace. @@ -321,8 +321,10 @@ void InsetMathSpace::doDispatch(Cursor & cur, FuncRequest & cmd) if (cmd.getArg(0) == "mathspace") { MathData ar; if (createInsetMath_fromDialogStr(cmd.argument(), ar)) { + Buffer * buf = buffer_; cur.recordUndo(); *this = *ar[0].nucleus()->asSpaceInset(); + buffer_ = buf; break; } }