]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/qt_helpers.cpp
Whitespace cleanup
[features.git] / src / frontends / qt4 / qt_helpers.cpp
index 24392f5bb9676769cda61374c60f4b7ccae685a0..c39a245433c4ebb7fa0e03d486c4a30d219c2139 100644 (file)
@@ -71,38 +71,38 @@ string widgetsToLength(QLineEdit const * input, LengthCombo const * combo)
        if (isValidGlueLength(fromqstr(length)))
                return fromqstr(length);
 
-       LyXLength::UNIT const unit = combo->currentLengthItem();
+       Length::UNIT const unit = combo->currentLengthItem();
 
-       return LyXLength(length.toDouble(), unit).asString();
+       return Length(length.toDouble(), unit).asString();
 }
 
 
-LyXLength widgetsToLength(QLineEdit const * input, QComboBox const * combo)
+Length widgetsToLength(QLineEdit const * input, QComboBox const * combo)
 {
        QString const length = input->text();
        if (length.isEmpty())
-               return LyXLength();
+               return Length();
 
        // don't return unit-from-choice if the input(field) contains a unit
        if (isValidGlueLength(fromqstr(length)))
-               return LyXLength(fromqstr(length));
+               return Length(fromqstr(length));
 
-       LyXLength::UNIT const unit = unitFromString(fromqstr(combo->currentText()));
+       Length::UNIT const unit = unitFromString(fromqstr(combo->currentText()));
 
-       return LyXLength(length.toDouble(), unit);
+       return Length(length.toDouble(), unit);
 }
 
 
 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
-       LyXLength const & len, LyXLength::UNIT defaultUnit) 
+       Length const & len, Length::UNIT defaultUnit)
 {
-       combo->setCurrentItem(LyXLength(len).unit());
-       input->setText(toqstr(convert<string>(LyXLength(len).value())));
+       combo->setCurrentItem(Length(len).unit());
+       input->setText(toqstr(convert<string>(Length(len).value())));
 }
 
 
 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
-       string const & len, LyXLength::UNIT defaultUnit)
+       string const & len, Length::UNIT defaultUnit)
 {
        if (len.empty()) {
                // no length (UNIT_NONE)
@@ -113,15 +113,15 @@ void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
                combo->setCurrentItem(defaultUnit);
                input->setText(toqstr(len));
        } else {
-               lengthToWidgets(input, combo, LyXLength(len), defaultUnit);
+               lengthToWidgets(input, combo, Length(len), defaultUnit);
        }
 }
 
 
-void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo, 
-       LyXLength const & len, LyXLength::UNIT defaultUnit)
+void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo,
+       Length const & len, Length::UNIT defaultUnit)
 {
-       if (len.value() == 0) 
+       if (len.value() == 0)
                lengthToWidgets(input, combo, "auto", defaultUnit);
        else
                lengthToWidgets(input, combo, len, defaultUnit);
@@ -130,15 +130,15 @@ void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo,
 
 //NOTE "CB" here because we probably will want one of these
 //for labeled sets, as well.
-void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit, 
-       LengthCombo * lengthCombo) 
+void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit,
+       LengthCombo * lengthCombo)
 {
-       if (!checkBox->isChecked()) 
+       if (!checkBox->isChecked())
                lengthToWidgets(lineEdit, lengthCombo,
-                               "auto", lengthCombo->currentLengthItem());
+                               "auto", lengthCombo->currentLengthItem());
        else if (lineEdit->text() == "auto")
                lengthToWidgets(lineEdit, lengthCombo, string(),
-                               lengthCombo->currentLengthItem());
+                               lengthCombo->currentLengthItem());
 }