]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewpage.cpp
DocBook: escape IDs for InsetRef.
[lyx.git] / src / insets / InsetNewpage.cpp
index e83f56dc705348556b60b667c8aa954eb2debc1a..6e9f34211fb62803496086b01795403935ed37e3 100644 (file)
@@ -19,7 +19,7 @@
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
-#include "output_xhtml.h"
+#include "xml.h"
 #include "texstream.h"
 #include "Text.h"
 #include "TextMetrics.h"
@@ -163,7 +163,7 @@ bool InsetNewpage::getStatus(Cursor & cur, FuncRequest const & cmd,
                        InsetNewpageParams params;
                        string2params(to_utf8(cmd.argument()), params);
                        status.setOnOff(params_.kind == params.kind);
-               } 
+               }
                status.setEnabled(true);
                return true;
        default:
@@ -213,24 +213,29 @@ ColorCode InsetNewpage::ColorName() const
 
 void InsetNewpage::latex(otexstream & os, OutputParams const & runparams) const
 {
-       switch (params_.kind) {
+       if (runparams.inDeletedInset) {
+               os << "\\mbox{}\\\\\\makebox[\\columnwidth]{\\dotfill\\ "
+                  << insetLabel() << "\\ \\dotfill}";
+       } else {
+               switch (params_.kind) {
                case InsetNewpageParams::NEWPAGE:
-                       os << "\\newpage{}";
+                       os << "\\newpage" << termcmd;
                        break;
                case InsetNewpageParams::PAGEBREAK:
                        if (runparams.moving_arg)
                                os << "\\protect";
-                       os << "\\pagebreak{}";
+                       os << "\\pagebreak" << termcmd;
                        break;
                case InsetNewpageParams::CLEARPAGE:
-                       os << "\\clearpage{}";
+                       os << "\\clearpage" << termcmd;
                        break;
                case InsetNewpageParams::CLEARDOUBLEPAGE:
-                       os << "\\cleardoublepage{}";
+                       os << "\\cleardoublepage" << termcmd;
                        break;
                default:
-                       os << "\\newpage{}";
+                       os << "\\newpage" << termcmd;
                        break;
+               }
        }
 }
 
@@ -243,16 +248,15 @@ int InsetNewpage::plaintext(odocstringstream & os,
 }
 
 
-int InsetNewpage::docbook(odocstream & os, OutputParams const &) const
+void InsetNewpage::docbook(XMLStream & os, OutputParams const &) const
 {
-       os << '\n';
-       return 0;
+       os << xml::CR();
 }
 
 
-docstring InsetNewpage::xhtml(XHTMLStream & xs, OutputParams const &) const
+docstring InsetNewpage::xhtml(XMLStream & xs, OutputParams const &) const
 {
-       xs << html::CompTag("br");
+       xs << xml::CompTag("br");
        return docstring();
 }