}
-LyXAlignment GuiParagraph::getAlignmentFromDialog()
+LyXAlignment GuiParagraph::getAlignmentFromDialog() const
{
LyXAlignment alignment = LYX_ALIGN_NONE;
RadioMap::const_iterator it = radioMap_.begin();
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());
break;
case 4:
ls = Spacing::Other;
- other = fromqstr(linespacingValue->text());
+ other = widgetToDoubleStr(linespacingValue);
break;
}
// 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 {
}
linespacing->setCurrentIndex(ls);
if (space.getSpace() == Spacing::Other) {
- linespacingValue->setText(toqstr(space.getValueAsString()));
+ doubleToWidget(linespacingValue, space.getValue());
linespacingValue->setEnabled(true);
} else {
linespacingValue->setText(QString());
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();
}
}
+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();
} // namespace frontend
} // namespace lyx
-#include "GuiParagraph_moc.cpp"
+#include "moc_GuiParagraph.cpp"