diff --git a/src/frontends/controllers/ControlParagraph.cpp b/src/frontends/controllers/ControlParagraph.cpp index 9480c9d112..290a4bc084 100644 --- a/src/frontends/controllers/ControlParagraph.cpp +++ b/src/frontends/controllers/ControlParagraph.cpp @@ -37,6 +37,13 @@ ControlParagraph::ControlParagraph(Dialog & parent) ParagraphParameters & ControlParagraph::params() { + if (haveMulitParSelection()) { + multiparsel_ = ParagraphParameters(); + // FIXME: It would be nice to initialise the parameters that + // are common to all paragraphs. + return multiparsel_; + } + return bufferview()->cursor().paragraph().params(); } @@ -49,6 +56,14 @@ ParagraphParameters const & ControlParagraph::params() const void ControlParagraph::dispatchParams() { + if (haveMulitParSelection()) { + ostringstream data; + multiparsel_.write(data); + FuncRequest const fr(LFUN_PARAGRAPH_PARAMS_APPLY, data.str()); + dispatch(fr); + return; + } + bufferview()->updateMetrics(false); bufferview()->buffer().changed(); } diff --git a/src/frontends/controllers/ControlParagraph.h b/src/frontends/controllers/ControlParagraph.h index 1abf56f0e5..839187a9a7 100644 --- a/src/frontends/controllers/ControlParagraph.h +++ b/src/frontends/controllers/ControlParagraph.h @@ -44,6 +44,9 @@ public: LyXAlignment alignPossible() const; /// LyXAlignment alignDefault() const; + +private: + ParagraphParameters multiparsel_; }; } // namespace frontend diff --git a/src/frontends/qt4/GuiParagraph.cpp b/src/frontends/qt4/GuiParagraph.cpp index 11c4393477..0606fca896 100644 --- a/src/frontends/qt4/GuiParagraph.cpp +++ b/src/frontends/qt4/GuiParagraph.cpp @@ -166,11 +166,6 @@ LyXAlignment GuiParagraphDialog::getAlignmentFromDialog() void GuiParagraphDialog::applyView() { - // FIXME: We should not access params() at all! - // we should just pass the relevant GUI information - // and let the controller do the rest. - // With this architecture, only current parent paragraph will be - // modified when we have a multi-paragraph selection. ParagraphParameters & params = controller().params(); params.align(getAlignmentFromDialog());