The math delimiter dialog is still buggy. Attached is a patch that fixes bug 
3457 and bug 3458:

- the sequence "\\" must not be used as math delimiters, so currently we 
produce LaTeX-errors
 (bug 3458)
  I fixed this by using \backslash instead

- the shown TeX-Code of the selected delimiters is wrong (bug 3457). In the fix 
is a problem I
  cannot solve:
  This line makes the dialog crashing when you call it:

  string stri_left = fromqstr(leftLW->currentItem()->toolTip());

  What is wrong with this?

- the "\" charaacter of the cmsy font has whitespace below. As we currently 
don't use the same font
  for "/" too, the delimiters are not vertically in sync, see the attached 
screenshot. I fixed this
  by using the cmsy font for "/" too. Perhaps you have a better idea.

My patch doesn't fix bug 3456.

regards Uwe
Index: controllers/ControlMath.C
===================================================================
--- controllers/ControlMath.C	(revision 17798)
+++ controllers/ControlMath.C	(working copy)
@@ -46,8 +46,8 @@
 	math_symbols_["["] = MathSymbol('[');
 	math_symbols_["]"] = MathSymbol(']');
 	math_symbols_["|"] = MathSymbol('|');
-	math_symbols_["/"] = MathSymbol('/');
-	math_symbols_["\\"] = MathSymbol('\\', 110, LyXFont::CMSY_FAMILY);
+	math_symbols_["/"] = MathSymbol('/', 54, LyXFont::CMSY_FAMILY);
+	math_symbols_["backslash"] = MathSymbol('\\', 110, LyXFont::CMSY_FAMILY);
 	math_symbols_["lceil"] = MathSymbol(0x2308, 100, LyXFont::CMSY_FAMILY);
 	math_symbols_["rceil"] = MathSymbol(0x2309, 101, LyXFont::CMSY_FAMILY);
 	math_symbols_["lfloor"] = MathSymbol(0x230A, 98, LyXFont::CMSY_FAMILY);
@@ -407,7 +407,7 @@
 	"(", ")", "{", "}", "[", "]",
 	"lceil", "rceil", "lfloor", "rfloor", "langle", "rangle",
 	"uparrow", "Uparrow", "downarrow", "Downarrow",
-	"|", "Vert", "/", "\\", ""
+	"|", "Vert", "/", "backslash", ""
 };
 
 
Index: qt4/QDelimiterDialog.C
===================================================================
--- qt4/QDelimiterDialog.C	(revision 17798)
+++ qt4/QDelimiterDialog.C	(working copy)
@@ -77,8 +77,8 @@
 	else if (str == "lfloor") match = "rfloor";
 	else if (str == "rangle") match = "langle";
 	else if (str == "langle") match = "rangle";
-	else if (str == "\\") match = "/";
-	else if (str == "/") match = "\\";
+	else if (str == "backslash") match = "/";
+	else if (str == "/") match = "backslash";
 	else return symbol;
 
 	return form_->controller().mathSymbol(match).unicode;
@@ -174,6 +174,8 @@
 
 void QDelimiterDialog::on_leftLW_currentRowChanged(int item)
 {
+	string stri_left = fromqstr(leftLW->currentItem()->toolTip());
+		
 	if (matchCB->isChecked())
 		rightLW->setCurrentRow(item);
 
@@ -181,12 +183,14 @@
 	if (leftLW->currentRow() == leftLW->count() - 1)
 		texCodeL->clear();
 	else
-		texCodeL->setText("TeX code: \\" + leftLW->currentItem()->toolTip());
+		texCodeL->setText("TeX code: " + qt_(fix_name(stri_left, false)));
 }
 
 
 void QDelimiterDialog::on_rightLW_currentRowChanged(int item)
 {
+	string stri_right = fromqstr(righLW->currentItem()->toolTip());
+
 	if (matchCB->isChecked())
 		leftLW->setCurrentRow(item);
 
@@ -194,7 +198,8 @@
 	if (rightLW->currentRow() == leftLW->count() - 1)
 		texCodeL->clear();
 	else
-		texCodeL->setText("TeX code: \\" + rightLW->currentItem()->toolTip());
+		texCodeL->setText("TeX code: " + qt_(fix_name(stri_right, false)));
+		
 }
 
 

PNG image

Reply via email to