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
This commit is contained in:
Enrico Forestieri 2007-04-11 00:27:35 +00:00
parent aa87b87bf9
commit c58f3252e5
3 changed files with 8 additions and 5 deletions

View File

@ -70,7 +70,7 @@ string fix_name(string const & str, bool big)
|| str == "|" || str == "/")
return str;
return "\\" + (str == "\\" ? "backslash" : str);
return "\\" + str;
}
} // namespace anon

View File

@ -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",

View File

@ -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 },