]> git.lyx.org Git - features.git/commitdiff
support for \pagebreak:
authorUwe Stöhr <uwestoehr@web.de>
Fri, 23 Nov 2007 02:10:00 +0000 (02:10 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Fri, 23 Nov 2007 02:10:00 +0000 (02:10 +0000)
- rename former "pagebreak" to "newpage" since it produces a \newpage
- new LFUN
- menu entry
- tex2lyx support
- fileformat change

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21732 a592a061-630c-0410-9148-cb99ea01b6c8

27 files changed:
development/FORMAT
development/scons/scons_manifest.py
lib/configure.py
lib/lyx2lyx/LyX.py
lib/lyx2lyx/lyx_1_6.py
lib/ui/stdmenus.inc
src/Buffer.cpp
src/LyXAction.cpp
src/Makefile.am
src/Text.cpp
src/Text3.cpp
src/factory.cpp
src/insets/Inset.cpp
src/insets/InsetCaption.cpp
src/insets/InsetCode.h
src/insets/InsetCollapsable.cpp
src/insets/InsetNewpage.cpp [new file with mode: 0644]
src/insets/InsetNewpage.h [new file with mode: 0644]
src/insets/InsetPagebreak.cpp [deleted file]
src/insets/InsetPagebreak.h [deleted file]
src/insets/InsetTabular.h
src/lfuns.h
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathGrid.h
src/mathed/MathParser.cpp
src/tex2lyx/table.cpp
src/tex2lyx/text.cpp

index 373616ef217ac92e92c440fe95f5a86af9618fd2..df52bc23beea146af392ccaf093a5cffe5e0f304 100644 (file)
@@ -1,6 +1,9 @@
 LyX file-format changes
 -----------------------
 
+2007-11-23 Uwe Stöhr <uwestoehr@web.de>
+       * Format incremented to 300: support for \pagebreak
+
 2007-11-01 Uwe Stöhr <uwestoehr@web.de>
        * Format incremented to 299: support for hyperlink types
 
index aa29f0815078e96f10029c4169a5ce6bb131a0d4..88bc63ace1f5205b1b3e00b8970df02e4c6b0e3f 100644 (file)
@@ -1012,10 +1012,10 @@ src_insets_header_files = Split('''
     InsetListingsParams.h
     InsetMarginal.h
     InsetNewline.h
+    InsetNewpage.h
     InsetNomencl.h
     InsetNote.h
     InsetOptArg.h
-    InsetPagebreak.h
     InsetQuotes.h
     InsetRef.h
     InsetSpace.h
@@ -1068,10 +1068,10 @@ src_insets_files = Split('''
     InsetListingsParams.cpp
     InsetMarginal.cpp
     InsetNewline.cpp
+    InsetNewpage.cpp
     InsetNomencl.cpp
     InsetNote.cpp
     InsetOptArg.cpp
-    InsetPagebreak.cpp
     InsetQuotes.cpp
     InsetRef.cpp
     InsetSpace.cpp
index 4ab4fa837b5620fb3d9da6b3122b7e1daf194f14..210aad99b74ded4c40c79db60b90885ef4578bfe 100644 (file)
@@ -198,17 +198,14 @@ def checkDTLtools():
 
 def checkLatex(dtl_tools):
     ''' Check latex, return lyx_check_config '''
-    path, LATEX = checkProg('a Latex2e program', ['platex $$i', 'latex $$i', 'latex2e $$i'])
-    path, PPLATEX = checkProg('a DVI postprocessing program', ['pplatex $$i'])
-    # use LATEX to convert from latex to dvi if PPLATEX is not available    
-    if PPLATEX == '':
-        PPLATEX = LATEX
     if dtl_tools:
         # Windows only: DraftDVI
-        addToRC(r'''\converter latex      dvi2       "%s"      "latex"
-\converter dvi2       dvi        "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' % PPLATEX)
+        converter_entry = r'''\converter latex      dvi2       "%%"    "latex"
+\converter dvi2       dvi        "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""'''
     else:
-        addToRC(r'\converter latex      dvi        "%s"        "latex"' % PPLATEX)
+        converter_entry = r'\converter latex      dvi        "%%"      "latex"'
+    path, LATEX = checkProg('a Latex2e program', ['pplatex $$i', 'platex $$i', 'latex $$i', 'latex2e $$i'],
+        rc_entry = [converter_entry])
     # no latex
     if LATEX != '':
         # Check if latex is usable
@@ -854,7 +851,4 @@ Options:
         bool_docbook, bool_linuxdoc)
     checkModulesConfig() #lyx_check_config and LATEX != '')
     removeTempFiles()
-    # The return error code can be 256. Because most systems expect an error code
-    # in the range 0-127, 256 can be interpretted as 'success'. Because we expect
-    # a None for success, 'ret is not None' is used to exit.
-    sys.exit(ret is not None)
+    sys.exit(ret)
index 377397f6b44f76c2f8b3d0cb6359c87182ea8072..e11be98bb5cbff222b2dde925571ded65c7b0d27 100644 (file)
@@ -80,7 +80,7 @@ format_relation = [("0_06",    [200], minor_versions("0.6" , 4)),
                    ("1_3",     [221], minor_versions("1.3" , 7)),
                    ("1_4", range(222,246), minor_versions("1.4" , 5)),
                    ("1_5", range(246,277), minor_versions("1.5" , 2)),
-                   ("1_6", range(277,300), minor_versions("1.6" , 0))] # Uwe: Hyperlink types
+                   ("1_6", range(277,301), minor_versions("1.6" , 0))] # Uwe: \pagebreak
 
 
 def formats_list():
index b9291d0ea6431c6c2fcf79609fbda203648bbf5f..58f41486e15879ce613fbc30ed529b15a0b01e71 100644 (file)
@@ -788,6 +788,17 @@ def revert_hyperlinktype(document):
       i = i + 1
 
 
+def revert_pagebreak(document):
+    'Reverts pagebreak to newpage'
+    i = 0
+    while True:
+      i = find_token(document.body, "\\pagebreak", i)
+      if i == -1:
+          return
+      document.body[i] = document.body[i].replace("\\pagebreak", "\\newpage")
+      i = i + 1
+
+
 ##
 # Conversion hub
 #
@@ -815,10 +826,12 @@ convert = [[277, [fix_wrong_tables]],
            [296, [convert_include]],
            [297, [convert_usorbian]],
            [298, []],
-           [299, []]
+           [299, []],
+           [300, []]
           ]
 
-revert =  [[298, [revert_hyperlinktype]],
+revert =  [[299, [revert_pagebreak]],
+           [298, [revert_hyperlinktype]],
            [297, [revert_macro_optional_params]],
            [296, [revert_albanian, revert_lowersorbian, revert_uppersorbian]],
            [295, [revert_include]],
index 309b3da976a6d4d0a63c158d9008abafd064ce2d..72dbd6e1c94c9b7fd178d41e1940b3cef4cd1de1 100644 (file)
@@ -362,6 +362,7 @@ Menuset
                Item "Ligature Break|k" "ligature-break-insert"
                Item "Line Break|B" "break-line"
                Separator
+               Item "New Page|N" "newpage-insert"
                Item "Page Break|a" "pagebreak-insert"
                Item "Clear Page|C" "clearpage-insert"
                Item "Clear Double Page|D" "cleardoublepage-insert"
index 95920be88877c04b2fb1c9cf4d8c1887c5ea1c3a..4b64d52b2ad3fdf01a38b017fe9ac5c13c83fbf9 100644 (file)
@@ -153,7 +153,7 @@ namespace os = support::os;
 
 namespace {
 
-int const LYX_FORMAT = 299; // Uwe: Hyperlink types
+int const LYX_FORMAT = 300; // Uwe: \pagebreak
 
 } // namespace anon
 
index 9551e8abe1ef2e16cce49a9cc6136ba7285a5c58..e159f91b3ff64d91db008ba438b9957453480ae4 100644 (file)
@@ -206,6 +206,7 @@ void LyXAction::init()
                { LFUN_BIBTEX_DATABASE_ADD, "bibtex-database-add", Noop, Edit },
                { LFUN_BIBTEX_DATABASE_DEL, "bibtex-database-del", Noop, Edit },
                { LFUN_LINE_INSERT, "line-insert", Noop, Edit },
+               { LFUN_NEWPAGE_INSERT, "newpage-insert", Noop, Edit },
                { LFUN_PAGEBREAK_INSERT, "pagebreak-insert", Noop, Edit },
                { LFUN_LANGUAGE, "language", Noop, Edit },
                { LFUN_LAYOUT, "layout", Noop, Layout },
index ef28719ca8ad3c4b85ae3cf539839bd0bd7f175a..278a4b5af76e74ee101dd0382f8125a0306408ad 100644 (file)
@@ -525,10 +525,10 @@ SOURCEFILESINSETS = \
        insets/InsetListingsParams.cpp \
        insets/InsetMarginal.cpp \
        insets/InsetNewline.cpp \
+       insets/InsetNewpage.cpp \
        insets/InsetNomencl.cpp \
        insets/InsetNote.cpp \
        insets/InsetOptArg.cpp \
-       insets/InsetPagebreak.cpp \
        insets/InsetQuotes.cpp \
        insets/InsetRef.cpp \
        insets/InsetSpace.cpp \
@@ -581,10 +581,10 @@ HEADERFILESINSETS = \
        insets/InsetListingsParams.h \
        insets/InsetMarginal.h \
        insets/InsetNewline.h \
+       insets/InsetNewpage.h \
        insets/InsetNomencl.h \
        insets/InsetNote.h \
        insets/InsetOptArg.h \
-       insets/InsetPagebreak.h \
        insets/InsetQuotes.h \
        insets/InsetRef.h \
        insets/InsetSpace.h \
index 0af0731f89187a3e953f2a568f134a8142443398..02224a6ddc1b1d5925f3a22402bfefdc93a4e2b9 100644 (file)
@@ -58,7 +58,7 @@
 #include "insets/InsetHFill.h"
 #include "insets/InsetLine.h"
 #include "insets/InsetNewline.h"
-#include "insets/InsetPagebreak.h"
+#include "insets/InsetNewpage.h"
 #include "insets/InsetOptArg.h"
 #include "insets/InsetSpace.h"
 #include "insets/InsetSpecialChar.h"
@@ -245,6 +245,8 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
        } else if (token == "\\lyxline") {
                par.insertInset(par.size(), new InsetLine, font, change);
        } else if (token == "\\newpage") {
+               par.insertInset(par.size(), new InsetNewpage, font, change);
+       } else if (token == "\\pagebreak") {
                par.insertInset(par.size(), new InsetPagebreak, font, change);
        } else if (token == "\\clearpage") {
                par.insertInset(par.size(), new InsetClearPage, font, change);
index f400794e985a21345107f10e813f1d89638bb896..7b6a8f624ed4465e36177a3b889d204fa7eb86e3 100644 (file)
@@ -1384,6 +1384,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_TOC_INSERT:
        case LFUN_HFILL_INSERT:
        case LFUN_LINE_INSERT:
+       case LFUN_NEWPAGE_INSERT:
        case LFUN_PAGEBREAK_INSERT:
        case LFUN_CLEARPAGE_INSERT:
        case LFUN_CLEARDOUBLEPAGE_INSERT:
@@ -2110,6 +2111,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_DATE_INSERT:
        case LFUN_SELF_INSERT:
        case LFUN_LINE_INSERT:
+       case LFUN_NEWPAGE_INSERT:
        case LFUN_PAGEBREAK_INSERT:
        case LFUN_CLEARPAGE_INSERT:
        case LFUN_CLEARDOUBLEPAGE_INSERT:
index b8d79a5537dd4cd3875a754e44cd4d4ad7e0a85b..4649f151809bc1d2c62b4b074df7edc600166531 100644 (file)
@@ -46,7 +46,7 @@
 #include "insets/InsetBox.h"
 #include "insets/InsetBranch.h"
 #include "insets/InsetOptArg.h"
-#include "insets/InsetPagebreak.h"
+#include "insets/InsetNewpage.h"
 #include "insets/InsetRef.h"
 #include "insets/InsetSpace.h"
 #include "insets/InsetTabular.h"
@@ -93,6 +93,9 @@ Inset * createInset(Buffer & buf, FuncRequest const & cmd)
                case LFUN_LINE_INSERT:
                        return new InsetLine;
 
+               case LFUN_NEWPAGE_INSERT:
+                       return new InsetNewpage;
+
                case LFUN_PAGEBREAK_INSERT:
                        return new InsetPagebreak;
 
index e2213ef51df6857476d78726896e097d0714d8c4..952aa0a2a286a80b43a86af891cecf2d263b79f8 100644 (file)
@@ -105,7 +105,7 @@ static TranslatorMap const build_translator()
                InsetName("listings", LISTINGS_CODE),
                InsetName("info", INFO_CODE),
                InsetName("collapsable", COLLAPSABLE_CODE),
-               InsetName("pagebreak", PAGEBREAK_CODE),
+               InsetName("newpage", NEWPAGE_CODE),
        };
 
        std::size_t const insetnames_size =
index e343baa01bf1a7293a2dc9d33171cbbf8983c89a..37a7051c40635c3a446ae0b9e04917f99dc1c430 100644 (file)
@@ -186,7 +186,7 @@ bool InsetCaption::insetAllowed(InsetCode code) const
        case TABULAR_CODE:
        case WRAP_CODE:
        case CAPTION_CODE:
-       case PAGEBREAK_CODE:
+       case NEWPAGE_CODE:
                return false;
        default:
                return InsetText::insetAllowed(code);
index cd6e9e6b4abdf5fa860122eab333985560ff76b8..6a3f1bc15f1b06a33952efcf6a3c101a77a447d1 100644 (file)
@@ -118,7 +118,7 @@ enum InsetCode {
        ///
        NOMENCL_PRINT_CODE,
        ///
-       PAGEBREAK_CODE,
+       NEWPAGE_CODE,
        ///
        LISTINGS_CODE,
        ///
index 35e0736e0955d2fa1e9312a5712f7a23b8850441..3be7346a8d066db530e1a7a5a234bee884641bed 100644 (file)
@@ -691,6 +691,7 @@ bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_LABEL_INSERT:
        case LFUN_LIGATURE_BREAK_INSERT:
        case LFUN_LINE_INSERT:
+       case LFUN_NEWPAGE_INSERT:
        case LFUN_PAGEBREAK_INSERT:
        case LFUN_LAYOUT:
        case LFUN_LAYOUT_PARAGRAPH:
diff --git a/src/insets/InsetNewpage.cpp b/src/insets/InsetNewpage.cpp
new file mode 100644 (file)
index 0000000..a804d01
--- /dev/null
@@ -0,0 +1,105 @@
+/**
+ * \file InsetNewpage.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "InsetNewpage.h"
+
+#include "debug.h"
+#include "gettext.h"
+#include "Text.h"
+#include "MetricsInfo.h"
+#include "OutputParams.h"
+#include "TextMetrics.h"
+
+#include "frontends/FontMetrics.h"
+#include "frontends/Painter.h"
+
+#include "support/docstring.h"
+
+
+namespace lyx {
+
+using frontend::Painter;
+
+
+void InsetNewpage::read(Buffer const &, Lexer &)
+{
+       /* Nothing to read */
+}
+
+
+void InsetNewpage::write(Buffer const &, std::ostream & os) const
+{
+       os << "\n" << getCmdName() << '\n';
+}
+
+
+void InsetNewpage::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       dim.asc = defaultRowHeight();
+       dim.des = defaultRowHeight();
+       dim.wid = mi.base.textwidth;
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
+}
+
+
+void InsetNewpage::draw(PainterInfo & pi, int x, int y) const
+{
+       FontInfo font;
+       font.setColor(Color_pagebreak);
+       font.decSize();
+
+       Dimension const dim = dimension(*pi.base.bv);
+
+       int w = 0;
+       int a = 0;
+       int d = 0;
+       theFontMetrics(font).rectText(insetLabel(), w, a, d);
+
+       int const text_start = int(x + (dim.wid - w) / 2);
+       int const text_end = text_start + w;
+
+       pi.pain.rectText(text_start, y + d, insetLabel(), font,
+               Color_none, Color_none);
+
+       pi.pain.line(x, y, text_start, y,
+                  Color_pagebreak, Painter::line_onoffdash);
+       pi.pain.line(text_end, y, int(x + dim.wid), y,
+                  Color_pagebreak, Painter::line_onoffdash);
+}
+
+
+int InsetNewpage::latex(Buffer const &, odocstream & os,
+                         OutputParams const &) const
+{
+       os << from_ascii(getCmdName()) << "{}";
+       return 0;
+}
+
+
+int InsetNewpage::plaintext(Buffer const &, odocstream & os,
+                             OutputParams const &) const
+{
+       os << '\n';
+       return PLAINTEXT_NEWLINE;
+}
+
+
+int InsetNewpage::docbook(Buffer const &, odocstream & os,
+                           OutputParams const &) const
+{
+       os << '\n';
+       return 0;
+}
+
+
+} // namespace lyx
diff --git a/src/insets/InsetNewpage.h b/src/insets/InsetNewpage.h
new file mode 100644 (file)
index 0000000..6473149
--- /dev/null
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+/**
+ * \file InsetNewpage.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef INSET_NEWPAGE_H
+#define INSET_NEWPAGE_H
+
+
+#include "Inset.h"
+#include "gettext.h"
+
+
+namespace lyx {
+
+class InsetNewpage : public Inset {
+public:
+       InsetNewpage() {}
+
+       InsetCode lyxCode() const { return NEWPAGE_CODE; }
+
+       void metrics(MetricsInfo &, Dimension &) const;
+
+       void draw(PainterInfo & pi, int x, int y) const;
+
+       int latex(Buffer const &, odocstream &,
+                 OutputParams const &) const;
+
+       int plaintext(Buffer const &, odocstream &,
+                     OutputParams const &) const;
+
+       int docbook(Buffer const &, odocstream &,
+                   OutputParams const &) const;
+
+       void read(Buffer const &, Lexer & lex);
+
+       virtual void write(Buffer const & buf, std::ostream & os) const;
+       /// We don't need \begin_inset and \end_inset
+       bool directWrite() const { return true; }
+
+       DisplayType display() const { return AlignCenter; }
+
+       virtual docstring insetLabel() const { return _("New Page"); }
+
+       virtual std::string getCmdName() const { return "\\newpage"; }
+
+private:
+       virtual Inset * clone() const
+       {
+               return new InsetNewpage;
+       }
+};
+
+
+class InsetPagebreak : public InsetNewpage {
+public:
+       InsetPagebreak() {}
+
+       docstring insetLabel() const { return _("Page Break"); }
+
+       std::string getCmdName() const { return "\\pagebreak"; }
+
+private:
+       virtual Inset * clone() const
+       {
+               return new InsetPagebreak;
+       }
+};
+
+
+class InsetClearPage : public InsetNewpage {
+public:
+       InsetClearPage() {}
+
+       docstring insetLabel() const { return _("Clear Page"); }
+
+       std::string getCmdName() const { return "\\clearpage"; }
+
+private:
+       virtual Inset * clone() const
+       {
+               return new InsetClearPage;
+       }
+};
+
+
+class InsetClearDoublePage : public InsetNewpage {
+public:
+       InsetClearDoublePage() {}
+
+       docstring insetLabel() const { return _("Clear Double Page"); }
+
+       std::string getCmdName() const { return "\\cleardoublepage"; }
+
+private:
+       virtual Inset * clone() const
+       {
+               return new InsetClearDoublePage;
+       }
+};
+
+} // namespace lyx
+
+#endif // INSET_NEWPAGE_H
diff --git a/src/insets/InsetPagebreak.cpp b/src/insets/InsetPagebreak.cpp
deleted file mode 100644 (file)
index 5e2f9d7..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * \file InsetPagebreak.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "InsetPagebreak.h"
-
-#include "debug.h"
-#include "gettext.h"
-#include "Text.h"
-#include "MetricsInfo.h"
-#include "OutputParams.h"
-#include "TextMetrics.h"
-
-#include "frontends/FontMetrics.h"
-#include "frontends/Painter.h"
-
-#include "support/docstring.h"
-
-
-namespace lyx {
-
-using frontend::Painter;
-
-
-void InsetPagebreak::read(Buffer const &, Lexer &)
-{
-       /* Nothing to read */
-}
-
-
-void InsetPagebreak::write(Buffer const &, std::ostream & os) const
-{
-       os << "\n" << getCmdName() << '\n';
-}
-
-
-void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       dim.asc = defaultRowHeight();
-       dim.des = defaultRowHeight();
-       dim.wid = mi.base.textwidth;
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
-}
-
-
-void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
-{
-       FontInfo font;
-       font.setColor(Color_pagebreak);
-       font.decSize();
-
-       Dimension const dim = dimension(*pi.base.bv);
-
-       int w = 0;
-       int a = 0;
-       int d = 0;
-       theFontMetrics(font).rectText(insetLabel(), w, a, d);
-
-       int const text_start = int(x + (dim.wid - w) / 2);
-       int const text_end = text_start + w;
-
-       pi.pain.rectText(text_start, y + d, insetLabel(), font,
-               Color_none, Color_none);
-
-       pi.pain.line(x, y, text_start, y,
-                  Color_pagebreak, Painter::line_onoffdash);
-       pi.pain.line(text_end, y, int(x + dim.wid), y,
-                  Color_pagebreak, Painter::line_onoffdash);
-}
-
-
-int InsetPagebreak::latex(Buffer const &, odocstream & os,
-                         OutputParams const &) const
-{
-       os << from_ascii(getCmdName()) << "{}";
-       return 0;
-}
-
-
-int InsetPagebreak::plaintext(Buffer const &, odocstream & os,
-                             OutputParams const &) const
-{
-       os << '\n';
-       return PLAINTEXT_NEWLINE;
-}
-
-
-int InsetPagebreak::docbook(Buffer const &, odocstream & os,
-                           OutputParams const &) const
-{
-       os << '\n';
-       return 0;
-}
-
-
-} // namespace lyx
diff --git a/src/insets/InsetPagebreak.h b/src/insets/InsetPagebreak.h
deleted file mode 100644 (file)
index 0d793fc..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetPagebreak.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef INSET_PAGEBREAK_H
-#define INSET_PAGEBREAK_H
-
-
-#include "Inset.h"
-#include "gettext.h"
-
-
-namespace lyx {
-
-class InsetPagebreak : public Inset {
-public:
-       InsetPagebreak() {}
-
-       InsetCode lyxCode() const { return PAGEBREAK_CODE; }
-
-       void metrics(MetricsInfo &, Dimension &) const;
-
-       void draw(PainterInfo & pi, int x, int y) const;
-
-       int latex(Buffer const &, odocstream &,
-                 OutputParams const &) const;
-
-       int plaintext(Buffer const &, odocstream &,
-                     OutputParams const &) const;
-
-       int docbook(Buffer const &, odocstream &,
-                   OutputParams const &) const;
-
-       void read(Buffer const &, Lexer & lex);
-
-       virtual void write(Buffer const & buf, std::ostream & os) const;
-       /// We don't need \begin_inset and \end_inset
-       bool directWrite() const { return true; }
-
-       DisplayType display() const { return AlignCenter; }
-
-       virtual docstring insetLabel() const { return _("Page Break"); }
-
-       virtual std::string getCmdName() const { return "\\newpage"; }
-
-private:
-       virtual Inset * clone() const
-       {
-               return new InsetPagebreak;
-       }
-};
-
-
-class InsetClearPage : public InsetPagebreak {
-public:
-       InsetClearPage() {}
-
-       docstring insetLabel() const { return _("Clear Page"); }
-
-       std::string getCmdName() const { return "\\clearpage"; }
-
-private:
-       virtual Inset * clone() const
-       {
-               return new InsetClearPage;
-       }
-};
-
-
-class InsetClearDoublePage : public InsetPagebreak {
-public:
-       InsetClearDoublePage() {}
-
-       docstring insetLabel() const { return _("Clear Double Page"); }
-
-       std::string getCmdName() const { return "\\cleardoublepage"; }
-
-private:
-       virtual Inset * clone() const
-       {
-               return new InsetClearDoublePage;
-       }
-};
-
-} // namespace lyx
-
-#endif // INSET_PAGEBREAK_H
index 3020aede59dd53e2d0621a41a8055faede47e7d6..8950077de263bd4dc71f0e2d4b9ed13f02ef4795 100644 (file)
@@ -539,7 +539,7 @@ public:
                bool endfoot;
                /// row of endlastfoot
                bool endlastfoot;
-               /// row for a pagebreak
+               /// row for a newpage
                bool newpage;
        };
        ///
index 7d4563d3e43575c323965b2bb407893075f252f7..b6089f07571e6bee0a1a68d4db94b11ca71329ad 100644 (file)
@@ -339,6 +339,7 @@ enum kb_action {
        LFUN_BOX_INSERT,
        LFUN_LINE_INSERT,
        // 240
+       LFUN_NEWPAGE_INSERT,                     // uwestoehr 20071124
        LFUN_PAGEBREAK_INSERT,
        LFUN_REPEAT,
        LFUN_FINISHED_LEFT,
index f357c2e43cad36568ab6335c2f5497e5679383e7..eebcc990c7f1ad3e43baf8653f0eb0cbc5a414f0 100644 (file)
@@ -86,7 +86,7 @@ InsetMathGrid::CellInfo::CellInfo()
 
 
 InsetMathGrid::RowInfo::RowInfo()
-       : lines_(0), skip_(0), allow_pagebreak_(true)
+       : lines_(0), skip_(0), allow_newpage_(true)
 {}
 
 
@@ -649,7 +649,7 @@ docstring InsetMathGrid::eolString(row_type row, bool emptyline, bool fragile) c
 
        if (!rowinfo_[row].crskip_.zero())
                eol += '[' + from_utf8(rowinfo_[row].crskip_.asLatexString()) + ']';
-       else if(!rowinfo_[row].allow_pagebreak_)
+       else if(!rowinfo_[row].allow_newpage_)
                eol += '*';
 
        // make sure an upcoming '[' does not break anything
index 7663d3ec2c144222eaf106e1df5f3a94b5677e68..da309998d19142ba8128a23bac9f322257ce8dfc 100644 (file)
@@ -63,7 +63,7 @@ public:
                /// extra distance between lines
                int skip_;
                /// Is a page break allowed after this row?
-               bool allow_pagebreak_;
+               bool allow_newpage_;
        };
 
        // additional per-row information
index 1d27f65f3e6a9f88e6e64588f793863aa3f2277a..9193e666a74998c05d87e778ce19824d1dd58889 100644 (file)
@@ -112,7 +112,7 @@ bool stared(docstring const & s)
  * environments like "equation" that have a fixed number of rows.
  */
 bool addRow(InsetMathGrid & grid, InsetMathGrid::row_type & cellrow,
-           docstring const & vskip, bool allow_pagebreak = true)
+           docstring const & vskip, bool allow_newpage_ = true)
 {
        ++cellrow;
        if (cellrow == grid.nrows()) {
@@ -129,14 +129,14 @@ bool addRow(InsetMathGrid & grid, InsetMathGrid::row_type & cellrow,
                        lyxerr << "ignoring extra row";
                        if (!vskip.empty())
                                lyxerr << " with extra space " << to_utf8(vskip);
-                       if (!allow_pagebreak)
+                       if (!allow_newpage_)
                                lyxerr << " with no page break allowed";
                        lyxerr << '.' << endl;
                        return false;
                }
        }
        grid.vcrskip(Length(to_utf8(vskip)), cellrow - 1);
-       grid.rowinfo(cellrow - 1).allow_pagebreak_ = allow_pagebreak;
+       grid.rowinfo(cellrow - 1).allow_newpage_ = allow_newpage_;
        return true;
 }
 
index 35de97af6a5ef8ad0d9c5082ff9c8a3fb0c92dff..2fa33955e7888f9f60c06b063af5c34d9fadc521 100644 (file)
@@ -87,7 +87,7 @@ public:
        /// These are for longtabulars only
        /// row type (head, foot, firsthead etc.)
        LTRowType type;
-       /// row for a pagebreak
+       /// row for a newpage
        bool newpage;
 };
 
index f49012a55941e2760996d1f3ee760a593ce798e6..2385831302c3fcc5756ed21b8ec482c997fe1347 100644 (file)
@@ -2290,10 +2290,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                }
 
                else if (t.cs() == "newpage" ||
-                        t.cs() == "clearpage" ||
-                        t.cs() == "cleardoublepage") {
+                       t.cs() == "pagebreak" ||
+                       t.cs() == "clearpage" ||
+                       t.cs() == "cleardoublepage") {
                        context.check_layout(os);
-                       // FIXME: what about \\pagebreak?
                        os << "\n\\" << t.cs() << "\n";
                        skip_braces(p); // eat {}
                }