* 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.
*/
#include "ParagraphParameters.h"
#include "Buffer.h"
-#include "gettext.h"
+#include "support/gettext.h"
#include "Layout.h"
#include "Lexer.h"
#include "Text.h"
#include <sstream>
-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", ""
}
-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);
}
}
} 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));
}
-//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;
-}
-
-
void ParagraphParameters::write(ostream & os) const
{
// Maybe the paragraph has special spacing
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';