mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-10 18:58:10 +00:00
De-serialization of the paragraph settings dialog step 3: fix the multi-paragraph selection case.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20512 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
67206b5d60
commit
960af372a8
@ -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();
|
||||
}
|
||||
|
@ -44,6 +44,9 @@ public:
|
||||
LyXAlignment alignPossible() const;
|
||||
///
|
||||
LyXAlignment alignDefault() const;
|
||||
|
||||
private:
|
||||
ParagraphParameters multiparsel_;
|
||||
};
|
||||
|
||||
} // namespace frontend
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user