]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewpage.cpp
Some things did not need to be mutable after all
[lyx.git] / src / insets / InsetNewpage.cpp
index 85e8d14dd394d02539d1963015f389613f141ddf..b369ce1b7e7d915f66aa675fd4f88e056219eac9 100644 (file)
@@ -20,6 +20,7 @@
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "output_xhtml.h"
+#include "texstream.h"
 #include "Text.h"
 #include "TextMetrics.h"
 
@@ -47,7 +48,6 @@ InsetNewpage::InsetNewpage(InsetNewpageParams const & params)
 
 void InsetNewpageParams::write(ostream & os) const
 {
-       string command;
        switch (kind) {
        case InsetNewpageParams::NEWPAGE:
                os << "newpage";
@@ -213,13 +213,15 @@ ColorCode InsetNewpage::ColorName() const
 }
 
 
-void InsetNewpage::latex(otexstream & os, OutputParams const &) const
+void InsetNewpage::latex(otexstream & os, OutputParams const & runparams) const
 {
        switch (params_.kind) {
                case InsetNewpageParams::NEWPAGE:
                        os << "\\newpage{}";
                        break;
                case InsetNewpageParams::PAGEBREAK:
+                       if (runparams.moving_arg)
+                               os << "\\protect";
                        os << "\\pagebreak{}";
                        break;
                case InsetNewpageParams::CLEARPAGE:
@@ -235,7 +237,8 @@ void InsetNewpage::latex(otexstream & os, OutputParams const &) const
 }
 
 
-int InsetNewpage::plaintext(odocstream & os, OutputParams const &) const
+int InsetNewpage::plaintext(odocstringstream & os,
+        OutputParams const &, size_t) const
 {
        os << '\n';
        return PLAINTEXT_NEWLINE;