]> git.lyx.org Git - features.git/commitdiff
* qt_helpers.cpp:
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 12 Jan 2009 06:48:12 +0000 (06:48 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 12 Jan 2009 06:48:12 +0000 (06:48 +0000)
- fix function Length lengthFromWidgets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28112 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/qt_helpers.cpp

index 0a4cf615fb4c560908074ed2865e8ed00e535a86..8d37d7beccd6686e555778436ce85f26335185f1 100644 (file)
@@ -92,7 +92,14 @@ Length widgetsToLength(QLineEdit const * input, QComboBox const * combo)
        if (isValidGlueLength(fromqstr(length)))
                return Length(fromqstr(length));
 
-       Length::UNIT const unit = unitFromString(fromqstr(combo->currentText()));
+       Length::UNIT unit;
+       QString const item = combo->currentText();
+       for (int i = 0; i < num_units; i++) {
+               if (qt_(lyx::unit_name_gui[i]) == item) {
+                       unit = unitFromString(unit_name[i]);
+                       break;
+               }
+       }
 
        return Length(length.toDouble(), unit);
 }