From c58f3252e52ff7f65a1ad60d5b4f1d97e205a0c5 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 11 Apr 2007 00:27:35 +0000 Subject: [PATCH] Fix remaining issues with big delimiters * src/mathed/MathSupport.C: add "slash" to the decoration table. * src/mathed/InsetMathBig.C (InsetMathBig::draw): don't remove backslash delimiter. (InsetMathBig::isBigInsetDelim): add "\\" and "\slash" to the delimiters table. * src/frontends/qt4/QDelimiterDialog.C (fix_name): return "\\" instead of "\backslash" as that now works after the fixes above. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17771 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QDelimiterDialog.C | 2 +- src/mathed/InsetMathBig.C | 10 ++++++---- src/mathed/MathSupport.C | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/QDelimiterDialog.C b/src/frontends/qt4/QDelimiterDialog.C index 866d226051..302c1a273a 100644 --- a/src/frontends/qt4/QDelimiterDialog.C +++ b/src/frontends/qt4/QDelimiterDialog.C @@ -70,7 +70,7 @@ string fix_name(string const & str, bool big) || str == "|" || str == "/") return str; - return "\\" + (str == "\\" ? "backslash" : str); + return "\\" + str; } } // namespace anon diff --git a/src/mathed/InsetMathBig.C b/src/mathed/InsetMathBig.C index b0bcb7ebe6..9f6b09e1be 100644 --- a/src/mathed/InsetMathBig.C +++ b/src/mathed/InsetMathBig.C @@ -78,11 +78,12 @@ bool InsetMathBig::metrics(MetricsInfo & mi, Dimension & dim) const void InsetMathBig::draw(PainterInfo & pi, int x, int y) const { - // mathed_draw_deco does not use the leading backslash, so remove it. + // mathed_draw_deco does not use the leading backslash, so remove it + // (but don't use ltrim if this is the backslash delimiter). // Replace \| by \Vert (equivalent in LaTeX), since mathed_draw_deco // would treat it as |. - docstring const delim = - (delim_ == "\\|") ? from_ascii("Vert") : support::ltrim(delim_, "\\"); + docstring const delim = (delim_ == "\\|") ? from_ascii("Vert") : + (delim_ == "\\\\") ? from_ascii("\\") : support::ltrim(delim_, "\\"); mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 4, dim_.height(), delim); setPosCache(pi, x, y); @@ -114,7 +115,8 @@ bool InsetMathBig::isBigInsetDelim(docstring const & delim) // mathed_draw_deco must handle these static char const * const delimiters[] = { "(", ")", "\\{", "\\}", "\\lbrace", "\\rbrace", "[", "]", - "|", "/", "\\|", "\\vert", "\\Vert", "'", "\\backslash", + "|", "/", "\\slash", "\\|", "\\vert", "\\Vert", "'", + "\\\\", "\\backslash", "\\langle", "\\lceil", "\\lfloor", "\\rangle", "\\rceil", "\\rfloor", "\\downarrow", "\\Downarrow", diff --git a/src/mathed/MathSupport.C b/src/mathed/MathSupport.C index df31054ae4..9db65f586e 100644 --- a/src/mathed/MathSupport.C +++ b/src/mathed/MathSupport.C @@ -293,6 +293,7 @@ named_deco_struct deco_table[] = { {"]", brack, 2 }, {"|", vert, 0 }, {"/", slash, 0 }, + {"slash", slash, 0 }, {"vert", vert, 0 }, {"Vert", Vert, 0 }, {"'", slash, 1 },