]> git.lyx.org Git - features.git/commitdiff
Fix remaining issues with big delimiters
authorEnrico Forestieri <forenr@lyx.org>
Wed, 11 Apr 2007 00:27:35 +0000 (00:27 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 11 Apr 2007 00:27:35 +0000 (00:27 +0000)
* 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
src/mathed/InsetMathBig.C
src/mathed/MathSupport.C

index 866d22605110bc22802fe1c725cdda9828cf836e..302c1a273a26c63540b4ef77a77f73e82813dd6b 100644 (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
index b0bcb7ebe6431282a6067729244df93825ad51e6..9f6b09e1be1721b7d023de5cc9df24b5e2f172b3 100644 (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",
index df31054ae47daa41b0ed8146a3cce12e1e8bb273..9db65f586e9c14c27d906353641d9eee650753bd 100644 (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 },