> 1. the strings in the combo are translated. So searching fo the English
> version "mu" might fail. You will have to compare unit_name_gui against
> unit_name

I don't think so. What will you translate "mu" to? Units like "sp", "cm", etc. are proverbs that should not be translatable. I don't know a language where units are translated, even in Japanese you use "mm" etc. as is, see for example:
http://ja.wikipedia.org/wiki/%E3%83%9D%E3%82%A4%E3%83%B3%E3%83%88
The only units that are allowed to be translated are the percent ones.

> 2. Why "contains("mu")"? I think you are looking for the string "mu" exactly.

Yes, fixed in the attached patch.

regards Uwe

Index: frontends/qt4/GuiHSpace.cpp
===================================================================
--- frontends/qt4/GuiHSpace.cpp	(revision 28092)
+++ frontends/qt4/GuiHSpace.cpp	(working copy)
@@ -78,6 +78,8 @@
 
 	// remove the %-items from the unit choice
 	unitCO->noPercents();
+	// remove the unit "mu" because it is not allowed by \hspace
+	unitCO->noMu();
 }
 
 
Index: frontends/qt4/GuiVSpace.cpp
===================================================================
--- frontends/qt4/GuiVSpace.cpp	(revision 28092)
+++ frontends/qt4/GuiVSpace.cpp	(working copy)
@@ -79,6 +79,8 @@
 
 	// remove the %-items from the unit choice
 	unitCO->noPercents();
+	// remove the unit "mu" because it is not allowed by \vspace
+	unitCO->noMu();
 }
 
 
Index: frontends/qt4/LengthCombo.cpp
===================================================================
--- frontends/qt4/LengthCombo.cpp	(revision 28092)
+++ frontends/qt4/LengthCombo.cpp	(working copy)
@@ -62,7 +62,7 @@
 {
 	int num = QComboBox::count();
 	for (int i = 0; i < num; i++) {
-		if (QComboBox::itemText(i).contains('%') > 0) {
+		if (QComboBox::itemText(i).contains('%')) {
 			QComboBox::removeItem(i);
 			--i;
 			--num;
@@ -70,4 +70,16 @@
 	}
 }
 
+void LengthCombo::noMu()
+{
+	int num = QComboBox::count();
+	for (int i = 0; i < num; i++) {
+		if (QComboBox::itemText(i) == "mu") {
+			QComboBox::removeItem(i);
+			--i;
+			--num;
+		}
+	}
+}
+
 #include "LengthCombo_moc.cpp"
Index: frontends/qt4/LengthCombo.h
===================================================================
--- frontends/qt4/LengthCombo.h	(revision 28092)
+++ frontends/qt4/LengthCombo.h	(working copy)
@@ -38,6 +38,8 @@
 	virtual void setEnabled(bool b);
 	/// use the %-items?
 	virtual void noPercents();
+	/// use the "mu" item?
+	virtual void noMu();
 
 protected Q_SLOTS:
 	virtual void has_activated(int index);

Reply via email to