]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiParagraph.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiParagraph.cpp
index 183b1fe1cc478988263bef51e0bcd28423581cd4..6cad13767308076f0881beec28e7ee244d43d5a6 100644 (file)
@@ -218,7 +218,7 @@ void GuiParagraph::applyView()
                break;
        case 4:
                ls = Spacing::Other;
-               other = fromqstr(linespacingValue->text());
+               other = widgetToDoubleStr(linespacingValue);
                break;
        }
 
@@ -242,8 +242,7 @@ void GuiParagraph::updateView()
 
        // label width
        docstring const & labelwidth = pp.labelWidthString();
-       // FIXME We should not compare translated strings
-       if (labelwidth != _("Senseless with this layout!")) {
+       if (hasLabelwidth()) {
                labelwidthGB->setEnabled(true);
                labelWidth->setText(toqstr(labelwidth));
        } else {
@@ -282,7 +281,7 @@ void GuiParagraph::updateView()
        }
        linespacing->setCurrentIndex(ls);
        if (space.getSpace() == Spacing::Other) {
-               linespacingValue->setText(toqstr(space.getValueAsString()));
+               doubleToWidget(linespacingValue, space.getValue());
                linespacingValue->setEnabled(true);
        } else {
                linespacingValue->setText(QString());
@@ -354,6 +353,14 @@ LyXAlignment GuiParagraph::alignDefault() const
 }
 
 
+bool GuiParagraph::hasLabelwidth() const
+{
+       Layout layout = bufferview()->cursor().innerParagraph().layout();
+       return (layout.margintype == MARGIN_MANUAL
+               || layout.latextype == LATEX_BIB_ENVIRONMENT);
+}
+
+
 void GuiParagraph::saveSession() const
 {
        Dialog::saveSession();