X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraphParameters.cpp;h=72b2286b1284588385a5adaa924fa863dbae2f14;hb=1cbac6fcb40d6e0803198624c047769adec2fe09;hp=88dd6c69990e5f7ddb19df9c2a04beb84ac139b2;hpb=11a0458d3f66bce83b90e23f1c85175a8ffcae45;p=lyx.git diff --git a/src/ParagraphParameters.cpp b/src/ParagraphParameters.cpp index 88dd6c6999..72b2286b12 100644 --- a/src/ParagraphParameters.cpp +++ b/src/ParagraphParameters.cpp @@ -3,11 +3,11 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author Angus Leeming * \author John Levon - * \author André Pönitz - * \author Jürgen Vigna + * \author André Pönitz + * \author Jürgen Vigna * * Full author contact details are available in file CREDITS. */ @@ -16,13 +16,12 @@ #include "ParagraphParameters.h" -#include "Buffer.h" -#include "support/gettext.h" #include "Layout.h" #include "Lexer.h" -#include "Text.h" #include "Paragraph.h" +#include "support/debug.h" +#include "support/docstring.h" #include "support/lstrings.h" #include @@ -169,7 +168,7 @@ void ParagraphParameters::leftIndent(Length const & li) } -void ParagraphParameters::read(string str, bool merge) +void ParagraphParameters::read(string const & str, bool merge) { istringstream is(str); Lexer lex; @@ -245,23 +244,14 @@ void ParagraphParameters::read(Lexer & lex, bool merge) void ParagraphParameters::apply( - ParagraphParameters const & p, Layout const & layout) + ParagraphParameters const & params, Layout const & layout) { - spacing(p.spacing()); + spacing(params.spacing()); // does the layout allow the new alignment? - if (p.align() & layout.alignpossible) - align(p.align()); - labelWidthString(p.labelWidthString()); - noindent(p.noindent()); -} - - -//FIXME This needs to be made a real method, so that getStatus() -//can return sensible information. -bool ParagraphParameters::canApply( - ParagraphParameters const & /*params*/, Layout const & /*layout*/) -{ - return true; + if (params.align() & layout.alignpossible) + align(params.align()); + labelWidthString(params.labelWidthString()); + noindent(params.noindent()); } @@ -327,6 +317,12 @@ void params2string(Paragraph const & par, string & data) } +LyXErr & operator<<(LyXErr & os, ParagraphParameters const & parp) { + parp.write(os.stream()); + return os; +} + + /* bool operator==(ParagraphParameeters const & ps1, ParagraphParameeters const & ps2)