]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphParameters.C
ws changes only
[lyx.git] / src / ParagraphParameters.C
index aca07b6b949e82f6cd67c0eeb0a44fe6801e52c3..cd9bd49bc0c99c76c7d426dce711a3d36f6ba7e1 100644 (file)
@@ -1,22 +1,44 @@
+/**
+ * \file ParagraphParameters.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ * \author Angus Leeming
+ * \author John Levon
+ * \author André Pönitz
+ * \author Jürgen Vigna
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
 #include <config.h>
 
 #include "ParagraphParameters.h"
-#include "ParameterStruct.h"
-#include "tex-strings.h"
-#include "lyxlex.h"
 
 #include "buffer.h"
 #include "BufferView.h"
 #include "gettext.h"
-#include "paragraph.h"
+#include "lyxlayout.h"
+#include "lyxlex.h"
 #include "lyxtext.h"
+#include "paragraph.h"
+#include "ParameterStruct.h"
+#include "tex-strings.h"
+
 #include "frontends/LyXView.h"
 
 #include "support/lstrings.h"
 
-#include <iostream>
+#include "support/std_sstream.h"
+
+using lyx::support::rtrim;
 
+using std::istringstream;
 using std::ostream;
+using std::ostringstream;
+using std::string;
+
 
 // Initialize static member var.
 ShareContainer<ParameterStruct> ParagraphParameters::container;
@@ -48,6 +70,12 @@ void ParagraphParameters::clear()
 }
 
 
+ParagraphParameters::depth_type ParagraphParameters::depth() const
+{
+       return param->depth;
+}
+
+
 bool ParagraphParameters::sameLayout(ParagraphParameters const & pp) const
 {
        return param->align == pp.param->align &&
@@ -416,6 +444,7 @@ void ParagraphParameters::write(ostream & os) const
 }
 
 
+
 void setParagraphParams(BufferView & bv, string const & data)
 {
        istringstream is(data);
@@ -437,9 +466,7 @@ void setParagraphParams(BufferView & bv, string const & data)
                           params.labelWidthString(),
                           params.noindent());
 
-       // Actually apply these settings
-       bv.update(text, BufferView::SELECT);
-
+       bv.update();
        bv.owner()->message(_("Paragraph layout set"));
 }
 
@@ -467,7 +494,7 @@ void params2string(Paragraph const & par, string & data)
        os << "\\aligndefault " << layout->align << '\n';
 
        /// is paragraph in inset
-       os << "\\ininset " << par.inInset() << '\n';
+       os << "\\ininset " << (par.inInset()?1:0) << '\n';
 
        data = os.str();
 }