]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewpage.cpp
Restore XHTML output for InsetListings.
[lyx.git] / src / insets / InsetNewpage.cpp
index 9cb680c6849007c1ccfe3b036880b0fda889a5cf..35c5b0a5acac17f46bdf9f7bd81a65c120fe2e6d 100644 (file)
@@ -3,8 +3,8 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
- * \author Jürgen Spitzmüller
+ * \author André Pönitz
+ * \author Jürgen Spitzmüller
  *
  * Full author contact details are available in file CREDITS.
  */
 
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "Text.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
+#include "output_xhtml.h"
+#include "Text.h"
 #include "TextMetrics.h"
 
 #include "frontends/FontMetrics.h"
@@ -34,12 +35,12 @@ using namespace std;
 
 namespace lyx {
 
-InsetNewpage::InsetNewpage()
+       InsetNewpage::InsetNewpage() : Inset(0)
 {}
 
 
 InsetNewpage::InsetNewpage(InsetNewpageParams const & params)
-       : params_(params)
+       : Inset(0), params_(params)
 {}
 
 
@@ -79,8 +80,6 @@ void InsetNewpageParams::read(Lexer & lex)
                kind = InsetNewpageParams::CLEARDOUBLEPAGE;
        else
                lex.printError("Unknown kind");
-
-       lex >> "\\end_inset";
 }
 
 
@@ -94,6 +93,7 @@ void InsetNewpage::write(ostream & os) const
 void InsetNewpage::read(Lexer & lex)
 {
        params_.read(lex);
+       lex >> "\\end_inset";
 }
 
 
@@ -197,22 +197,17 @@ docstring InsetNewpage::insetLabel() const
 ColorCode InsetNewpage::ColorName() const
 {
        switch (params_.kind) {
-               case InsetNewpageParams::NEWPAGE:
-                       return Color_newpage;
-                       break;
                case InsetNewpageParams::PAGEBREAK:
                        return Color_pagebreak;
                        break;
+               case InsetNewpageParams::NEWPAGE:
                case InsetNewpageParams::CLEARPAGE:
-                       return Color_newpage;
-                       break;
                case InsetNewpageParams::CLEARDOUBLEPAGE:
                        return Color_newpage;
                        break;
-               default:
-                       return Color_newpage;
-                       break;
        }
+       // not really useful, but to avoids gcc complaints
+       return Color_newpage;
 }
 
 
@@ -253,6 +248,13 @@ int InsetNewpage::docbook(odocstream & os, OutputParams const &) const
 }
 
 
+docstring InsetNewpage::xhtml(XHTMLStream & xs, OutputParams const &) const
+{
+       xs << CompTag("br");
+       return docstring();
+}
+
+
 docstring InsetNewpage::contextMenu(BufferView const &, int, int) const
 {
        return from_ascii("context-newpage");