]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphParameters.cpp
Disable CheckTeX while buffer is processed
[lyx.git] / src / ParagraphParameters.cpp
index 12a17830856367d92e0832b5de757c9f8e2405bd..1152c6ab968855b4764c5d1ddff5b043d43cdabe 100644 (file)
@@ -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"
 
 #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", ""
@@ -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,15 +256,6 @@ void ParagraphParameters::apply(
 }
 
 
-//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
@@ -316,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';