]> git.lyx.org Git - features.git/blobdiff - src/frontends/controllers/ControlParagraph.C
change "support/std_sstream.h" to <sstream>
[features.git] / src / frontends / controllers / ControlParagraph.C
index 05e9f3cadd25e8daf897f7e5cda7f41f8e77636b..88e2f7a3bb0da7ba28b1db8d6067b74f75db5725 100644 (file)
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /**
  * \file ControlParagraph.C
  * This file is part of LyX, the document processor.
@@ -7,7 +6,7 @@
  * \author Edwin Leuven
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 #include "ButtonController.h"
 #include "funcrequest.h"
 #include "lyxlex.h"
+#include "paragraph.h"
 #include "ParagraphParameters.h"
-#include "support/LAssert.h"
-#include "Lsstream.h"
 
+#include <sstream>
+
+using std::istringstream;
+using std::ostringstream;
+using std::string;
+
+namespace lyx {
+namespace frontend {
 
 ControlParagraph::ControlParagraph(Dialog & parent)
        : Dialog::Controller(parent), ininset_(false)
@@ -48,7 +54,7 @@ bool ControlParagraph::initialiseParams(string const & data)
                        lex.next();
                        bool const accept = lex.getBool();
                        action = accept ? 1 : 2;
-               } else {
+               } else if (!token.empty()) {
                        // Unrecognised token
                        return false;
                }
@@ -71,6 +77,9 @@ bool ControlParagraph::initialiseParams(string const & data)
                lex.next();
                string const token = lex.getString();
 
+               if (token.empty())
+                       continue;
+
                int Int = 0;
                if (token == "\\alignpossible" ||
                    token == "\\aligndefault" ||
@@ -92,8 +101,9 @@ bool ControlParagraph::initialiseParams(string const & data)
                        ininset_ = Int;
                }
        }
-       if (nset != 3)
+       if (nset != 3) {
                return false;
+       }
 
        // If "update", then set the activation status of the button controller
        if (action > 0) {
@@ -121,14 +131,14 @@ void ControlParagraph::dispatchParams()
 
 ParagraphParameters & ControlParagraph::params()
 {
-       lyx::Assert(params_.get());
+       BOOST_ASSERT(params_.get());
        return *params_;
 }
 
 
 ParagraphParameters const & ControlParagraph::params() const
 {
-       lyx::Assert(params_.get());
+       BOOST_ASSERT(params_.get());
        return *params_;
 }
 
@@ -149,3 +159,6 @@ LyXAlignment ControlParagraph::alignDefault() const
 {
        return aligndefault_;
 }
+
+} // namespace frontend
+} // namespace lyx