From 4781794e4ead792c77b2780087cbac7c4e7b74e6 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Mon, 16 Jun 2008 20:25:44 +0000 Subject: [PATCH] The mode changing math insets already provide the needed info, so this is definitely better. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25284 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathNest.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index cabb21ab36..2dd5fd3a7a 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -73,11 +73,6 @@ using cap::cutSelection; using cap::replaceSelection; using cap::selClearOrDel; -string const text_commands[] = -{ "text", "textrm", "textsf", "texttt", "textmd", "textbf", "textup", "textit", - "textsl", "textsc", "textnormal" }; -int const num_text_commands = sizeof(text_commands) / sizeof(*text_commands); - InsetMathNest::InsetMathNest(idx_type nargs) : cells_(nargs), lock_(false), mouse_hover_(false) @@ -342,13 +337,8 @@ MathData InsetMathNest::glue() const void InsetMathNest::write(WriteStream & os) const { bool textmode = os.textMode(); - string const latex_name = to_ascii(name()); - for (int i = 0; i < num_text_commands; ++i) { - if (latex_name == text_commands[i]) { - os.textMode(true); - break; - } - } + os.textMode(currentMode() == TEXT_MODE); + docstring const latex_name = name().c_str(); os << '\\' << latex_name.c_str(); for (size_t i = 0; i < nargs(); ++i) os << '{' << cell(i) << '}'; -- 2.39.2