From 524073d09f89ea8484db5bc20d78e7cef0deda89 Mon Sep 17 00:00:00 2001 From: Yuriy Skalko Date: Mon, 26 Oct 2020 20:16:28 +0200 Subject: [PATCH] Move HullType functions declared in InsetMath.h into InsetMath.cpp --- src/mathed/InsetMath.cpp | 42 ++++++++++++++++++++++++++++++++++++ src/mathed/InsetMathHull.cpp | 42 ------------------------------------ 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/mathed/InsetMath.cpp b/src/mathed/InsetMath.cpp index 1adeec10a8..33a9a4e6b4 100644 --- a/src/mathed/InsetMath.cpp +++ b/src/mathed/InsetMath.cpp @@ -30,6 +30,48 @@ using namespace std; namespace lyx { +HullType hullType(docstring const & s) +{ + if (s == "none") return hullNone; + if (s == "simple") return hullSimple; + if (s == "equation") return hullEquation; + if (s == "eqnarray") return hullEqnArray; + if (s == "align") return hullAlign; + if (s == "alignat") return hullAlignAt; + if (s == "xalignat") return hullXAlignAt; + if (s == "xxalignat") return hullXXAlignAt; + if (s == "multline") return hullMultline; + if (s == "gather") return hullGather; + if (s == "flalign") return hullFlAlign; + if (s == "regexp") return hullRegexp; + lyxerr << "unknown hull type '" << to_utf8(s) << "'" << endl; + return hullUnknown; +} + + +docstring hullName(HullType type) +{ + switch (type) { + case hullNone: return from_ascii("none"); + case hullSimple: return from_ascii("simple"); + case hullEquation: return from_ascii("equation"); + case hullEqnArray: return from_ascii("eqnarray"); + case hullAlign: return from_ascii("align"); + case hullAlignAt: return from_ascii("alignat"); + case hullXAlignAt: return from_ascii("xalignat"); + case hullXXAlignAt: return from_ascii("xxalignat"); + case hullMultline: return from_ascii("multline"); + case hullGather: return from_ascii("gather"); + case hullFlAlign: return from_ascii("flalign"); + case hullRegexp: return from_ascii("regexp"); + case hullUnknown: + lyxerr << "unknown hull type" << endl; + break; + } + return from_ascii("none"); +} + + docstring InsetMath::name() const { return from_utf8("Unknown"); diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 4125bf6ee5..43f49584af 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -147,51 +147,9 @@ namespace { os << "}\\\\\n"; } - } // namespace -HullType hullType(docstring const & s) -{ - if (s == "none") return hullNone; - if (s == "simple") return hullSimple; - if (s == "equation") return hullEquation; - if (s == "eqnarray") return hullEqnArray; - if (s == "align") return hullAlign; - if (s == "alignat") return hullAlignAt; - if (s == "xalignat") return hullXAlignAt; - if (s == "xxalignat") return hullXXAlignAt; - if (s == "multline") return hullMultline; - if (s == "gather") return hullGather; - if (s == "flalign") return hullFlAlign; - if (s == "regexp") return hullRegexp; - lyxerr << "unknown hull type '" << to_utf8(s) << "'" << endl; - return hullUnknown; -} - - -docstring hullName(HullType type) -{ - switch (type) { - case hullNone: return from_ascii("none"); - case hullSimple: return from_ascii("simple"); - case hullEquation: return from_ascii("equation"); - case hullEqnArray: return from_ascii("eqnarray"); - case hullAlign: return from_ascii("align"); - case hullAlignAt: return from_ascii("alignat"); - case hullXAlignAt: return from_ascii("xalignat"); - case hullXXAlignAt: return from_ascii("xxalignat"); - case hullMultline: return from_ascii("multline"); - case hullGather: return from_ascii("gather"); - case hullFlAlign: return from_ascii("flalign"); - case hullRegexp: return from_ascii("regexp"); - case hullUnknown: - lyxerr << "unknown hull type" << endl; - break; - } - return from_ascii("none"); -} - static InsetLabel * dummy_pointer = 0; InsetMathHull::InsetMathHull(Buffer * buf)