X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiParagraph.cpp;h=6cad13767308076f0881beec28e7ee244d43d5a6;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=42255010d99df10bed1cd9186f13beb78eafaac8;hpb=aedba73655ad78526056de70816da4eeb605d4b3;p=lyx.git diff --git a/src/frontends/qt4/GuiParagraph.cpp b/src/frontends/qt4/GuiParagraph.cpp index 42255010d9..6cad137673 100644 --- a/src/frontends/qt4/GuiParagraph.cpp +++ b/src/frontends/qt4/GuiParagraph.cpp @@ -196,13 +196,7 @@ void GuiParagraph::on_restorePB_clicked() void GuiParagraph::applyView() { - if (haveMultiParSelection()) { - // FIXME: in case of multi-paragraph selection, it would be nice to - // initialise the parameters that are common to all paragraphs. - params_ = ParagraphParameters(); - } else { - params_ = bufferview()->cursor().innerParagraph().params(); - } + params_ = params(); params_.align(getAlignmentFromDialog()); @@ -224,7 +218,7 @@ void GuiParagraph::applyView() break; case 4: ls = Spacing::Other; - other = fromqstr(linespacingValue->text()); + other = widgetToDoubleStr(linespacingValue); break; } @@ -248,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 { @@ -288,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()); @@ -318,8 +311,8 @@ ParagraphParameters const & GuiParagraph::params() const if (haveMultiParSelection()) { // FIXME: in case of multi-paragraph selection, it would be nice to // initialise the parameters that are common to all paragraphs. - params_ = ParagraphParameters(); - return params_; + static ParagraphParameters empty; + return empty; } return bufferview()->cursor().innerParagraph().params(); } @@ -360,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(); @@ -386,4 +387,4 @@ Dialog * createGuiParagraph(GuiView & lv) } // namespace frontend } // namespace lyx -#include "GuiParagraph_moc.cpp" +#include "moc_GuiParagraph.cpp"