X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraphParameters.cpp;h=1152c6ab968855b4764c5d1ddff5b043d43cdabe;hb=3d4076b598deb18660e50ec9c327efc3b15f15d0;hp=1c9bf612798aaf194d81285b95c1d9cbcb0ceef4;hpb=de373da67b26141c6b10064381009a2d200d1734;p=lyx.git diff --git a/src/ParagraphParameters.cpp b/src/ParagraphParameters.cpp index 1c9bf61279..1152c6ab96 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. */ @@ -17,7 +17,7 @@ #include "ParagraphParameters.h" #include "Buffer.h" -#include "gettext.h" +#include "support/gettext.h" #include "Layout.h" #include "Lexer.h" #include "Text.h" @@ -27,16 +27,12 @@ #include -using lyx::support::rtrim; - -using std::istringstream; -using std::ostream; -using std::ostringstream; -using std::string; - +using namespace std; +using namespace lyx::support; namespace lyx { + //NOTE The order of these MUST be the same as in Layout.h. static char const * const string_align[] = { "block", "left", "right", "center", "default", "" @@ -173,10 +169,10 @@ void ParagraphParameters::leftIndent(Length const & li) } -void ParagraphParameters::read(std::string str, bool merge) +void ParagraphParameters::read(string str, bool merge) { - std::istringstream is(str); - Lexer lex(0, 0); + istringstream is(str); + Lexer lex; lex.setStream(is); read(lex, merge); } @@ -233,7 +229,7 @@ void ParagraphParameters::read(Lexer & lex, bool merge) } } else if (token == "\\align") { lex.next(); - int tmpret = support::findToken(string_align, lex.getString()); + int tmpret = findToken(string_align, lex.getString()); if (tmpret == -1) ++tmpret; align(LyXAlignment(1 << tmpret)); @@ -260,12 +256,6 @@ void ParagraphParameters::apply( } -bool canApply(ParagraphParameters const & params, Layout const & layout) -{ - return true; -} - - void ParagraphParameters::write(ostream & os) const { // Maybe the paragraph has special spacing @@ -313,13 +303,13 @@ void params2string(Paragraph const & par, string & data) ostringstream os; params.write(os); - Layout_ptr const & layout = par.layout(); + Layout const & layout = par.layout(); // Is alignment possible - os << "\\alignpossible " << layout->alignpossible << '\n'; + os << "\\alignpossible " << layout.alignpossible << '\n'; /// set default alignment - os << "\\aligndefault " << layout->align << '\n'; + os << "\\aligndefault " << layout.align << '\n'; /// paragraph is always in inset. This is redundant. os << "\\ininset " << 1 << '\n';