Andre Poenitz schrieb:
+ int num = QComboBox::count();
+ for (int i = 0; i < num; i++) {
+ if (QComboBox::itemText(i).contains("mu") > 0) {
Shouldn't
if (QComboBox::itemText(i).contains("mu"))
be sufficient?
You are right. I copied the code from the existing noPercents() method.
Corrected patch is attached.
Also the 'QComboBox::' qualification should not be necessary.
LengthCombo.cpp uses this all over the place. I leave the decision to you to
clean up this file or not.
regards Uwe
Index: frontends/qt4/GuiHSpace.cpp
===================================================================
--- frontends/qt4/GuiHSpace.cpp (revision 28082)
+++ 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 28082)
+++ 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 28082)
+++ 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).contains("mu")) {
+ QComboBox::removeItem(i);
+ --i;
+ --num;
+ }
+ }
+}
+
#include "LengthCombo_moc.cpp"
Index: frontends/qt4/LengthCombo.h
===================================================================
--- frontends/qt4/LengthCombo.h (revision 28082)
+++ 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);