commit 094c69acd5a16e81eb59f29ea6b27754b67c80de
Author: Juergen Spitzmueller <[email protected]>
Date: Tue Oct 21 22:05:38 2025 +0200
Rename InsetNewpage to InsetTextbreak
and LFUN_NEWPAGE_INSERT to LFUN_TEXTBREAK_INSERT
this reflects that \newpage is just one break this inset provides
---
development/FORMAT | 4 +
lib/RELEASE-NOTES | 105 ++++------------
lib/lyx2lyx/lyx_2_6.py | 29 ++++-
lib/ui/stdcontext.inc | 16 +--
lib/ui/stdmenus.inc | 10 +-
src/FuncCode.h | 2 +-
src/LyXAction.cpp | 10 +-
src/Makefile.am | 4 +-
src/Text.cpp | 6 +-
src/factory.cpp | 24 ++--
src/frontends/qt/Menus.cpp | 4 +-
src/insets/CMakeLists.txt | 4 +-
src/insets/Inset.cpp | 2 +-
src/insets/InsetCaption.cpp | 2 +-
src/insets/InsetCode.h | 2 +-
src/insets/InsetScript.cpp | 4 +-
src/insets/InsetTabular.cpp | 2 +-
.../{InsetNewpage.cpp => InsetTextbreak.cpp} | 136 ++++++++++-----------
src/insets/{InsetNewpage.h => InsetTextbreak.h} | 30 ++---
src/mathed/InsetMathNest.cpp | 2 +-
src/tex2lyx/text.cpp | 2 +-
src/version.h | 4 +-
22 files changed, 186 insertions(+), 218 deletions(-)
diff --git a/development/FORMAT b/development/FORMAT
index 8e7be9240f..3c3818c999 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -7,6 +7,10 @@ changes happened in particular if possible. A good example
would be
-----------------------
+2025-10-21 Jürgen Spitzmüller <[email protected]>
+ * Format incremented to 647:
+ Rename inset newpage to inset textbreak.
+
2025-10-21 Jürgen Spitzmüller <[email protected]>
* Format incremented to 646: Implement contextual text breaks
in Layout and InsetLayout:
diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index d0a9ebdcc9..01952e331d 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -1,115 +1,52 @@
-!Important Changes in LyX 2.5.0
+!Important Changes in LyX 2.6.0
!!Interface changes
!!Documents compilation process and images conversion
-- the default length of latex log lines is now by default extended so that the
- detection of latex erros is more robust (esp. for missing
citations/references).
- Works with TeX Live only.
-!!!The following pref variables were added in 2.5:
+!!!The following pref variables were added in 2.:
-- \color_scheme {system,light,dark} allows to override the system-wide
- color scheme (i.e., dark or light mode). This requires LyX to be built
- against Qt >= 6.8.0.
-- \workarea_justify {true,false} sets text justification on the screen.
- It has effect only if document itself does not enforce the justification.
-!!!The following pref variables were changed in 2.5:
+!!!The following pref variables were changed in 2.6:
-!!!The following pref variables are obsoleted in 2.5:
+!!!The following pref variables are obsoleted in 2.6:
-!!!The following new LyX functions have been introduced in 2.5:
+!!!The following new LyX functions have been introduced in 2.6:
-- The re-introduced function error-next moves the cursor to the next
- LaTeX error in the current buffer.
+!!!The following LyX functions have been changed in 2.6:
-- The new function errors-show re-displays the (e.g., LaTeX) errors dialog
- if there had been any processing errors.
+- The function newpage-insert has been renamed to textbreak-insert
+ (since it does not only insert page breaks)
-- The new function word-invertcase is a companion of word-upcase and
- word-lowcase: it inverts each character between lowcase and upcase,
- which is useful when one FORGOT THE cAPS lOCK KEY.
+!!!The following LyX functions have been removed in 2.6:
-!!!The following LyX functions have been changed in 2.5:
+!!!The following LyX function has been added and then removed in 2.6
development cycle:
-- The function window-new does not take an optional <GEOMETRY>
- parameter anymore. This only worked in windows and existed for
- internal reasons.
+!!!The following layout-related changes has been done in 2.6 development cycle:
-!!!The following LyX functions have been removed in 2.5:
-!!!The following LyX function has been added and then removed in 2.5
development cycle:
-
-!!!The following layout-related changes has been done in 2.5 development cycle:
-
-- Theorems are now specified via dedicated tags, no longer in the layout's
- Preamble. LyX introduces the following tags for this: TheoremName,
- TheoremZRefName, TheoremCounter, TheoremParentCounter, TheoremStyle,
- TheoremCrossRefName, and TheoremCrossRefPluralName. Please refer to
- the Customization manual for details.
-
-- Float insets have now dedicated preamble tag section so that preamble code
- is included only when the particular float is used.
-
-- Layout now has a tag "MultiPar <true|false>", which causes mutliple
paragraphs
- being output within the same command.
-
-- InsetArgument now have their own "InheritFont" tag where you can specifiy
- whether the argument should take the surrounding font (in the workarea).
-
-- Counter specifications can now have a tag "StepOtherCounter <counter>" which
- effects that this other counter is stepped whenever the counter in question
is.
-
-- InsetLayout now also support "StepParentCounter <true|false>", like Layout.
-
-- If InsetLayout used a counter, the value of this counter has been
automatically
- appended to the LabelString for the button of the inset. Now, the counter
- needs to be added to the LabelString explicitly via the placeholder '##'
- (e.g., "Foot ##") or special commands such as \the<counter> or
\arabic{counter},
- like in LabelStrings of other elements.
-
-!!!The following LyX documents have been moved in 2.5:
+!!!The following LyX documents have been moved in 2.6:
!!!The following new files and folders have been added to the LyX directory
-!!!The following preferences files have been removed from the tarball in 2.5:
-
-!!!The following metadata files have been added to the tarball in 2.5:
-
-!!Changes with respect to external programs and libraries in 2.5:
-
-- The Qt6 libraries are now used by default. In order to force
- building against Qt5, the configure option --disable-qt6 (or the
- cmake -DLYX_USE_QT=QT5 option) has to be used.
-
-- The support for python 2 was completely removed. Python 3.8 (or newer)
- must be present on your system for LyX to work properly.
-
-- The support for (long unmaintained) eLyXer was removed.
-
-- When compiling , LyX now requires a compiler supporting C++17, like
- for example gcc >= 8.
-
-- Dependence on boost libraries was dropped and they are not needed
- for building the binaries anymore.
+!!!The following preferences files have been removed from the tarball in 2.6:
-- CAS interface for octave changed from calling 'octave' to 'octave-cli'.
+!!!The following metadata files have been added to the tarball in 2.6:
-- The internal hunspell shipped with LyX has been updated to version 1.7.2.
+!!Changes with respect to external programs and libraries in 2.6:
-!!Known issues in version 2.5.0
+!!Known issues in version 2.6.0
-!!Caveats when upgrading from earlier versions to 2.5.x
+!!Caveats when upgrading from earlier versions to 2.6.x
-!! If upgrading from a LyX version before 2.4.0
+!! If upgrading from a LyX version before 2.5.0
-!!Detailed list of 2.5 changes
+!!Detailed list of 2.6 changes
-* For more comprehensive list of changes and new features in LyX 2.5 see
- https://wiki.lyx.org/LyX/NewInLyX25
+* For more comprehensive list of changes and new features in LyX 2.6 see
+ https://wiki.lyx.org/LyX/NewInLyX26
diff --git a/lib/lyx2lyx/lyx_2_6.py b/lib/lyx2lyx/lyx_2_6.py
index 8b9d417712..e493d5e6fd 100644
--- a/lib/lyx2lyx/lyx_2_6.py
+++ b/lib/lyx2lyx/lyx_2_6.py
@@ -633,6 +633,31 @@ def revert_contextual_breaks(document):
if not handled:
del document.body[beglay - 1 : endlay + 1]
+
+def convert_textbreaks(document):
+ "Convert Inset Textbreak to Inset Newpage"
+
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_inset Newpage", i)
+ if i == -1:
+ break
+ document.body[i] = document.body[i].replace("\\begin_inset Newpage",
"\\begin_inset Textbreak")
+ i += 1
+ continue
+
+def revert_textbreaks(document):
+ "Revert Inset Textbreak to Inset Newpage"
+
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_inset Textbreak", i)
+ if i == -1:
+ break
+ document.body[i] = document.body[i].replace("\\begin_inset Textbreak",
"\\begin_inset Newpage")
+ i += 1
+ continue
+
##
# Conversion hub
#
@@ -641,11 +666,13 @@ supported_versions = ["2.6.0", "2.6"]
convert = [
[644, [convert_refname]],
[645, []],
- [646, []]
+ [646, []],
+ [647, [convert_textbreaks]]
]
revert = [
+ [646, [revert_textbreaks]],
[645, [revert_contextual_breaks]],
[644, [revert_mathref]],
[643, [revert_ling_xrefs]]
diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc
index a38e4f015b..7af263fbc4 100644
--- a/lib/ui/stdcontext.inc
+++ b/lib/ui/stdcontext.inc
@@ -342,14 +342,14 @@ Menuset
End
#
-# InsetNewpage context menu
-#
- Menu "context-newpage"
- Item "New Page|N" "inset-modify newpage newpage"
- Item "Page Break|a" "inset-modify newpage pagebreak"
- Item "No Page Break|g" "inset-modify newpage nopagebreak"
- Item "Clear Page|C" "inset-modify newpage clearpage"
- Item "Clear Double Page|D" "inset-modify newpage
cleardoublepage"
+# InsetTextbreak context menu
+#
+ Menu "context-textbreak"
+ Item "New Page|N" "inset-modify textbreak newpage"
+ Item "Page Break|a" "inset-modify textbreak pagebreak"
+ Item "No Page Break|g" "inset-modify textbreak nopagebreak"
+ Item "Clear Page|C" "inset-modify textbreak clearpage"
+ Item "Clear Double Page|D" "inset-modify textbreak
cleardoublepage"
TextBreaksModify
End
diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc
index 1ddaf4282e..748b4c48b4 100644
--- a/lib/ui/stdmenus.inc
+++ b/lib/ui/stdmenus.inc
@@ -469,11 +469,11 @@ Menuset
Item "Ragged Line Break|R" "newline-insert newline"
Item "Justified Line Break|J" "newline-insert linebreak"
Separator
- Item "New Page|N" "newpage-insert newpage"
- Item "Page Break|a" "newpage-insert pagebreak"
- Item "Prevent Page Break|g" "newpage-insert nopagebreak"
- Item "Clear Page|C" "newpage-insert clearpage"
- Item "Clear Double Page|D" "newpage-insert cleardoublepage"
+ Item "New Page|N" "textbreak-insert newpage"
+ Item "Page Break|a" "textbreak-insert pagebreak"
+ Item "Prevent Page Break|g" "textbreak-insert nopagebreak"
+ Item "Clear Page|C" "textbreak-insert clearpage"
+ Item "Clear Double Page|D" "textbreak-insert cleardoublepage"
TextBreaks
End
diff --git a/src/FuncCode.h b/src/FuncCode.h
index b63d21abe1..33875dc373 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -313,7 +313,7 @@ enum FuncCode
LFUN_BOX_INSERT,
LFUN_BUFFER_TOGGLE_OUTPUT_SYNC,
// 235
- LFUN_NEWPAGE_INSERT, // uwestoehr, 20071124
+ LFUN_TEXTBREAK_INSERT, // uwestoehr, 20071124
LFUN_REPEAT,
LFUN_FINISHED_LEFT,
LFUN_FINISHED_RIGHT,
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index d93df8cd44..ac4d5d8a08 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -2271,9 +2271,9 @@ void LyXAction::init()
* \li Action: Modify some properties of an inset.
* \li Notion: Used for argument, bibitem, bibtex, box, branch, caption,
citation,
command, ert, external, float, graphics, include,
index,
- info, label, line, listings, newline, newpage, nomencl,
+ info, label, line, listings, newline, nomencl,
note, phantom, quotes, ref, script, separator, space,
- tabular, vspace and wrap insets.
+ tabular, textbreak, vspace and wrap insets.
* \li Syntax: inset-modify <INSET> <ARGS> \n
inset-modify changetype <TYPE>
* \li Sample: Change a Note inset into a Comment inset: \n
@@ -3211,14 +3211,14 @@ void LyXAction::init()
{ LFUN_NEWLINE_INSERT, "newline-insert", Noop, Edit },
/*!
- * \var lyx::FuncCode lyx::LFUN_NEWPAGE_INSERT
+ * \var lyx::FuncCode lyx::LFUN_TEXTBREAK_INSERT
* \li Action: Inserts a new page.
- * \li Syntax: newpage-insert <ARG>
+ * \li Syntax: textbreak-insert <ARG>
* \li Params: <ARG>: <newpage|pagebreak|clearpage|cleardoublepage|contextual>
default: newpage
* \li Origin: uwestoehr, 24 Nov 2007
* \endvar
*/
- { LFUN_NEWPAGE_INSERT, "newpage-insert", Noop, Edit },
+ { LFUN_TEXTBREAK_INSERT, "textbreak-insert", Noop, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_NOMENCL_INSERT
diff --git a/src/Makefile.am b/src/Makefile.am
index 3bbcae30fb..7dae8d43fc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -606,8 +606,6 @@ liblyxinsets_a_SOURCES = \
insets/InsetMarginal.h \
insets/InsetNewline.cpp \
insets/InsetNewline.h \
- insets/InsetNewpage.cpp \
- insets/InsetNewpage.h \
insets/InsetNomencl.cpp \
insets/InsetNomencl.h \
insets/InsetNote.cpp \
@@ -632,6 +630,8 @@ liblyxinsets_a_SOURCES = \
insets/InsetTabular.h \
insets/InsetText.cpp \
insets/InsetText.h \
+ insets/InsetTextbreak.cpp \
+ insets/InsetTextbreak.h \
insets/InsetTOC.cpp \
insets/InsetTOC.h \
insets/InsetVSpace.cpp \
diff --git a/src/Text.cpp b/src/Text.cpp
index 7da4f3fa32..11bd0ddf21 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -5694,7 +5694,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
cur.posForward();
break;
- case LFUN_NEWPAGE_INSERT: {
+ case LFUN_TEXTBREAK_INSERT: {
// When we are in a heading, put the page break in a standard
// paragraph before the heading (if cur.pos() == 0) or after
// (if cur.pos() == cur.lastpos())
@@ -6932,9 +6932,9 @@ bool Text::getStatus(Cursor & cur, FuncRequest const &
cmd,
break;
}
- case LFUN_NEWPAGE_INSERT:
+ case LFUN_TEXTBREAK_INSERT:
// not allowed in description items and in the midst of sections
- code = NEWPAGE_CODE;
+ code = TEXTBREAK_CODE;
enable = !inDescriptionItem(cur)
&& (cur.text()->getTocLevel(cur.pit()) ==
Layout::NOT_IN_TOC
|| cur.pos() == 0 || cur.pos() == cur.lastpos());
diff --git a/src/factory.cpp b/src/factory.cpp
index fc36228bbc..f85b90298b 100644
--- a/src/factory.cpp
+++ b/src/factory.cpp
@@ -41,7 +41,6 @@
#include "insets/InsetLine.h"
#include "insets/InsetMarginal.h"
#include "insets/InsetNewline.h"
-#include "insets/InsetNewpage.h"
#include "insets/InsetNomencl.h"
#include "insets/InsetNote.h"
#include "insets/InsetArgument.h"
@@ -53,6 +52,7 @@
#include "insets/InsetSeparator.h"
#include "insets/InsetSpace.h"
#include "insets/InsetTabular.h"
+#include "insets/InsetTextbreak.h"
#include "insets/InsetTOC.h"
#include "insets/InsetVSpace.h"
#include "insets/InsetWrap.h"
@@ -84,22 +84,22 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const &
cmd)
switch (cmd.action()) {
- case LFUN_NEWPAGE_INSERT: {
+ case LFUN_TEXTBREAK_INSERT: {
string const name = cmd.getArg(0);
- InsetNewpageParams inp;
+ InsetTextbreakParams inp;
if (name.empty() || name == "newpage")
- inp.kind = InsetNewpageParams::NEWPAGE;
+ inp.kind = InsetTextbreakParams::NEWPAGE;
else if (name == "pagebreak")
- inp.kind = InsetNewpageParams::PAGEBREAK;
+ inp.kind = InsetTextbreakParams::PAGEBREAK;
else if (name == "clearpage")
- inp.kind = InsetNewpageParams::CLEARPAGE;
+ inp.kind = InsetTextbreakParams::CLEARPAGE;
else if (name == "cleardoublepage")
- inp.kind = InsetNewpageParams::CLEARDOUBLEPAGE;
+ inp.kind =
InsetTextbreakParams::CLEARDOUBLEPAGE;
else if (name == "nopagebreak")
- inp.kind = InsetNewpageParams::NOPAGEBREAK;
+ inp.kind = InsetTextbreakParams::NOPAGEBREAK;
else if (name == "contextual")
- inp.kind = InsetNewpageParams::CONTEXTUAL;
- return new InsetNewpage(inp);
+ inp.kind = InsetTextbreakParams::CONTEXTUAL;
+ return new InsetTextbreak(inp);
}
case LFUN_SEPARATOR_INSERT: {
@@ -650,8 +650,8 @@ Inset * readInset(Lexer & lex, Buffer * buf)
inset.reset(new InsetFoot(buf));
} else if (tmptok == "Marginal") {
inset.reset(new InsetMarginal(buf));
- } else if (tmptok == "Newpage") {
- inset.reset(new InsetNewpage);
+ } else if (tmptok == "Textbreak") {
+ inset.reset(new InsetTextbreak);
} else if (tmptok == "Newline") {
inset.reset(new InsetNewline);
} else if (tmptok == "Separator") {
diff --git a/src/frontends/qt/Menus.cpp b/src/frontends/qt/Menus.cpp
index ce3c73faae..5c096d0a8a 100644
--- a/src/frontends/qt/Menus.cpp
+++ b/src/frontends/qt/Menus.cpp
@@ -1551,10 +1551,10 @@ void MenuDefinition::expandTextBreaks(BufferView const
* bv, bool const modify)
gui = to_utf8(_("Contextual Break"));
if (modify)
addWithStatusCheck(MenuItem(MenuItem::Command, qt_(gui),
- FuncRequest(LFUN_INSET_MODIFY, "newpage
contextual")));
+ FuncRequest(LFUN_INSET_MODIFY, "textbreak
contextual")));
else
add(MenuItem(MenuItem::Command, qt_(gui),
- FuncRequest(LFUN_NEWPAGE_INSERT, "contextual")));
+ FuncRequest(LFUN_TEXTBREAK_INSERT, "contextual")));
}
diff --git a/src/insets/CMakeLists.txt b/src/insets/CMakeLists.txt
index 3d0756f487..a3f47ec301 100644
--- a/src/insets/CMakeLists.txt
+++ b/src/insets/CMakeLists.txt
@@ -24,9 +24,9 @@ foreach(_base InsetExternal ExternalSupport Inset
InsetArgument
InsetERT InsetFlex InsetFloat InsetFloatList InsetFoot InsetFootlike
InsetGraphics InsetHyperlink InsetInfo InsetIPA InsetIPAMacro
InsetInclude InsetIndex InsetIndexMacro
InsetLabel InsetLayout InsetLine InsetListings InsetListingsParams
InsetMarginal
- InsetNewline InsetNewpage InsetNomencl InsetNote
+ InsetNewline InsetNomencl InsetNote
InsetPhantom InsetPreview InsetQuotes InsetRef InsetScript
InsetSeparator InsetSpace InsetSpecialChar
- InsetTOC InsetTabular InsetText InsetVSpace InsetWrap
+ InsetTOC InsetTabular InsetText InsetTextbreak InsetVSpace InsetWrap
RenderButton RenderGraphic RenderPreview)
handle_source_option("CXX" ${TOP_SRC_DIR}/src/insets/${_base}.cpp
-Wno-shadow)
endforeach()
diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp
index 3e9de261da..2a84f0986f 100644
--- a/src/insets/Inset.cpp
+++ b/src/insets/Inset.cpp
@@ -118,7 +118,7 @@ static void build_translator()
insetnames[LISTINGS_CODE] = InsetName("listings");
insetnames[INFO_CODE] = InsetName("info", _("Info"));
insetnames[COLLAPSIBLE_CODE] = InsetName("collapsible");
- insetnames[NEWPAGE_CODE] = InsetName("newpage");
+ insetnames[TEXTBREAK_CODE] = InsetName("textbreak");
insetnames[SCRIPT_CODE] = InsetName("script");
insetnames[CELL_CODE] = InsetName("tablecell");
insetnames[MATH_AMSARRAY_CODE] = InsetName("mathamsarray");
diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp
index 8ed1885fae..1efc70c214 100644
--- a/src/insets/InsetCaption.cpp
+++ b/src/insets/InsetCaption.cpp
@@ -186,7 +186,7 @@ bool InsetCaption::insetAllowed(InsetCode code) const
case CAPTION_CODE:
case FLOAT_CODE:
case FOOT_CODE:
- case NEWPAGE_CODE:
+ case TEXTBREAK_CODE:
case MARGIN_CODE:
case MATH_MACROTEMPLATE_CODE:
case TABULAR_CODE:
diff --git a/src/insets/InsetCode.h b/src/insets/InsetCode.h
index a375500f60..bdf7183eed 100644
--- a/src/insets/InsetCode.h
+++ b/src/insets/InsetCode.h
@@ -105,7 +105,7 @@ enum InsetCode {
///
NOMENCL_PRINT_CODE,
///
- NEWPAGE_CODE,
+ TEXTBREAK_CODE,
///
LISTINGS_CODE,
///
diff --git a/src/insets/InsetScript.cpp b/src/insets/InsetScript.cpp
index f1e0e07beb..03c195445c 100644
--- a/src/insets/InsetScript.cpp
+++ b/src/insets/InsetScript.cpp
@@ -231,7 +231,7 @@ bool InsetScript::insetAllowed(InsetCode code) const
case MATH_MACRO_CODE:
case MATH_MACROTEMPLATE_CODE:
case NEWLINE_CODE:
- case NEWPAGE_CODE:
+ case TEXTBREAK_CODE:
case NOMENCL_PRINT_CODE:
case QUOTE_CODE:
case PREVIEW_CODE:
@@ -260,12 +260,12 @@ bool InsetScript::getStatus(Cursor & cur, FuncRequest
const & cmd,
case LFUN_LISTING_INSERT:
case LFUN_MARGINALNOTE_INSERT:
case LFUN_NEWLINE_INSERT:
- case LFUN_NEWPAGE_INSERT:
case LFUN_NOMENCL_PRINT:
case LFUN_PREVIEW_INSERT:
case LFUN_QUOTE_INSERT:
case LFUN_TABULAR_INSERT:
case LFUN_TABULAR_STYLE_INSERT:
+ case LFUN_TEXTBREAK_INSERT:
case LFUN_WRAP_INSERT:
flag.setEnabled(false);
return true;
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 14f2e4b557..d46858b93b 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -6849,7 +6849,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest
const & cmd,
case LFUN_NEWLINE_INSERT:
return cell(cur.idx())->getStatus(cur, cmd, status);
- case LFUN_NEWPAGE_INSERT:
+ case LFUN_TEXTBREAK_INSERT:
status.setEnabled(false);
return true;
diff --git a/src/insets/InsetNewpage.cpp b/src/insets/InsetTextbreak.cpp
similarity index 63%
rename from src/insets/InsetNewpage.cpp
rename to src/insets/InsetTextbreak.cpp
index 42db2ddbbe..c163c5c05e 100644
--- a/src/insets/InsetNewpage.cpp
+++ b/src/insets/InsetTextbreak.cpp
@@ -1,5 +1,5 @@
/**
- * \file InsetNewpage.cpp
+ * \file InsetTextbreak.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@@ -11,7 +11,7 @@
#include <config.h>
-#include "InsetNewpage.h"
+#include "InsetTextbreak.h"
#include "Buffer.h"
#include "Cursor.h"
@@ -40,80 +40,80 @@ namespace lyx {
using support::Lexer;
-InsetNewpage::InsetNewpage() : Inset(nullptr)
+InsetTextbreak::InsetTextbreak() : Inset(nullptr)
{}
-InsetNewpage::InsetNewpage(InsetNewpageParams const & params)
+InsetTextbreak::InsetTextbreak(InsetTextbreakParams const & params)
: Inset(nullptr), params_(params)
{}
-void InsetNewpageParams::write(ostream & os) const
+void InsetTextbreakParams::write(ostream & os) const
{
switch (kind) {
- case InsetNewpageParams::NEWPAGE:
+ case InsetTextbreakParams::NEWPAGE:
os << "newpage";
break;
- case InsetNewpageParams::PAGEBREAK:
+ case InsetTextbreakParams::PAGEBREAK:
os << "pagebreak";
break;
- case InsetNewpageParams::CLEARPAGE:
+ case InsetTextbreakParams::CLEARPAGE:
os << "clearpage";
break;
- case InsetNewpageParams::CLEARDOUBLEPAGE:
+ case InsetTextbreakParams::CLEARDOUBLEPAGE:
os << "cleardoublepage";
break;
- case InsetNewpageParams::NOPAGEBREAK:
+ case InsetTextbreakParams::NOPAGEBREAK:
os << "nopagebreak";
break;
- case InsetNewpageParams::CONTEXTUAL:
+ case InsetTextbreakParams::CONTEXTUAL:
os << "contextual";
break;
}
}
-void InsetNewpageParams::read(Lexer & lex)
+void InsetTextbreakParams::read(Lexer & lex)
{
- lex.setContext("InsetNewpageParams::read");
+ lex.setContext("InsetTextbreakParams::read");
string token;
lex >> token;
if (token == "newpage")
- kind = InsetNewpageParams::NEWPAGE;
+ kind = InsetTextbreakParams::NEWPAGE;
else if (token == "pagebreak")
- kind = InsetNewpageParams::PAGEBREAK;
+ kind = InsetTextbreakParams::PAGEBREAK;
else if (token == "clearpage")
- kind = InsetNewpageParams::CLEARPAGE;
+ kind = InsetTextbreakParams::CLEARPAGE;
else if (token == "cleardoublepage")
- kind = InsetNewpageParams::CLEARDOUBLEPAGE;
+ kind = InsetTextbreakParams::CLEARDOUBLEPAGE;
else if (token == "nopagebreak")
- kind = InsetNewpageParams::NOPAGEBREAK;
+ kind = InsetTextbreakParams::NOPAGEBREAK;
else if (token == "contextual")
- kind = InsetNewpageParams::CONTEXTUAL;
+ kind = InsetTextbreakParams::CONTEXTUAL;
else
lex.printError("Unknown kind");
}
-void InsetNewpage::write(ostream & os) const
+void InsetTextbreak::write(ostream & os) const
{
- os << "Newpage ";
+ os << "Textbreak ";
params_.write(os);
}
-void InsetNewpage::read(Lexer & lex)
+void InsetTextbreak::read(Lexer & lex)
{
params_.read(lex);
lex >> "\\end_inset";
}
-void InsetNewpage::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetTextbreak::metrics(MetricsInfo & mi, Dimension & dim) const
{
- if (params_.kind == InsetNewpageParams::NOPAGEBREAK) {
+ if (params_.kind == InsetTextbreakParams::NOPAGEBREAK) {
frontend::FontMetrics const & fm = theFontMetrics(mi.base.font);
dim.asc = fm.maxAscent();
dim.des = fm.maxDescent();
@@ -127,9 +127,9 @@ void InsetNewpage::metrics(MetricsInfo & mi, Dimension &
dim) const
}
-void InsetNewpage::draw(PainterInfo & pi, int x, int y) const
+void InsetTextbreak::draw(PainterInfo & pi, int x, int y) const
{
- if (params_.kind == InsetNewpageParams::NOPAGEBREAK) {
+ if (params_.kind == InsetTextbreakParams::NOPAGEBREAK) {
FontInfo font;
font.setColor(ColorName());
@@ -203,12 +203,12 @@ void InsetNewpage::draw(PainterInfo & pi, int x, int y)
const
}
-void InsetNewpage::doDispatch(Cursor & cur, FuncRequest & cmd)
+void InsetTextbreak::doDispatch(Cursor & cur, FuncRequest & cmd)
{
switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
- InsetNewpageParams params;
+ InsetTextbreakParams params;
cur.recordUndo();
string2params(to_utf8(cmd.argument()), params);
params_.kind = params.kind;
@@ -222,18 +222,18 @@ void InsetNewpage::doDispatch(Cursor & cur, FuncRequest &
cmd)
}
-bool InsetNewpage::getStatus(Cursor & cur, FuncRequest const & cmd,
+bool InsetTextbreak::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
switch (cmd.action()) {
// we handle these
case LFUN_INSET_MODIFY: {
bool enabled = true;
- if (cmd.getArg(0) == "newpage") {
- InsetNewpageParams params;
+ if (cmd.getArg(0) == "textbreak") {
+ InsetTextbreakParams params;
string2params(to_utf8(cmd.argument()), params);
status.setOnOff(params_.kind == params.kind);
- enabled = params.kind != InsetNewpageParams::CONTEXTUAL
|| !contextual_cmd_.empty();
+ enabled = params.kind !=
InsetTextbreakParams::CONTEXTUAL || !contextual_cmd_.empty();
}
status.setEnabled(enabled);
return true;
@@ -244,20 +244,20 @@ bool InsetNewpage::getStatus(Cursor & cur, FuncRequest
const & cmd,
}
-docstring InsetNewpage::insetLabel() const
+docstring InsetTextbreak::insetLabel() const
{
switch (params_.kind) {
- case InsetNewpageParams::NEWPAGE:
+ case InsetTextbreakParams::NEWPAGE:
return _("New Page");
- case InsetNewpageParams::PAGEBREAK:
+ case InsetTextbreakParams::PAGEBREAK:
return _("Page Break");
- case InsetNewpageParams::CLEARPAGE:
+ case InsetTextbreakParams::CLEARPAGE:
return _("Clear Page");
- case InsetNewpageParams::CLEARDOUBLEPAGE:
+ case InsetTextbreakParams::CLEARDOUBLEPAGE:
return _("Clear Double Page");
- case InsetNewpageParams::NOPAGEBREAK:
+ case InsetTextbreakParams::NOPAGEBREAK:
return _("No Page Break");
- case InsetNewpageParams::CONTEXTUAL:
+ case InsetTextbreakParams::CONTEXTUAL:
return contextual_gui_.empty() ? _("Non-sensical
Break") : _(contextual_gui_);
default:
return _("New Page");
@@ -265,16 +265,16 @@ docstring InsetNewpage::insetLabel() const
}
-ColorCode InsetNewpage::ColorName() const
+ColorCode InsetTextbreak::ColorName() const
{
switch (params_.kind) {
- case InsetNewpageParams::PAGEBREAK:
- case InsetNewpageParams::NOPAGEBREAK:
+ case InsetTextbreakParams::PAGEBREAK:
+ case InsetTextbreakParams::NOPAGEBREAK:
return Color_pagebreak;
- case InsetNewpageParams::NEWPAGE:
- case InsetNewpageParams::CLEARPAGE:
- case InsetNewpageParams::CLEARDOUBLEPAGE:
- case InsetNewpageParams::CONTEXTUAL:
+ case InsetTextbreakParams::NEWPAGE:
+ case InsetTextbreakParams::CLEARPAGE:
+ case InsetTextbreakParams::CLEARDOUBLEPAGE:
+ case InsetTextbreakParams::CONTEXTUAL:
return Color_newpage;
}
// not really useful, but to avoids gcc complaints
@@ -282,31 +282,31 @@ ColorCode InsetNewpage::ColorName() const
}
-void InsetNewpage::latex(otexstream & os, OutputParams const & runparams) const
+void InsetTextbreak::latex(otexstream & os, OutputParams const & runparams)
const
{
if (runparams.inDeletedInset) {
os << "\\mbox{}\\\\\\makebox[\\columnwidth]{\\dotfill\\ "
<< insetLabel() << "\\ \\dotfill}";
} else {
switch (params_.kind) {
- case InsetNewpageParams::NEWPAGE:
+ case InsetTextbreakParams::NEWPAGE:
os << "\\newpage" << termcmd;
break;
- case InsetNewpageParams::PAGEBREAK:
+ case InsetTextbreakParams::PAGEBREAK:
if (runparams.moving_arg)
os << "\\protect";
os << "\\pagebreak" << termcmd;
break;
- case InsetNewpageParams::CLEARPAGE:
+ case InsetTextbreakParams::CLEARPAGE:
os << "\\clearpage" << termcmd;
break;
- case InsetNewpageParams::CLEARDOUBLEPAGE:
+ case InsetTextbreakParams::CLEARDOUBLEPAGE:
os << "\\cleardoublepage" << termcmd;
break;
- case InsetNewpageParams::NOPAGEBREAK:
+ case InsetTextbreakParams::NOPAGEBREAK:
os << "\\nopagebreak" << termcmd;
break;
- case InsetNewpageParams::CONTEXTUAL:
+ case InsetTextbreakParams::CONTEXTUAL:
if (!contextual_cmd_.empty())
os << "\\" << contextual_cmd_ << termcmd;
break;
@@ -318,46 +318,46 @@ void InsetNewpage::latex(otexstream & os, OutputParams
const & runparams) const
}
-int InsetNewpage::plaintext(odocstringstream & os,
+int InsetTextbreak::plaintext(odocstringstream & os,
OutputParams const &, size_t) const
{
- if (params_.kind == InsetNewpageParams::NOPAGEBREAK)
+ if (params_.kind == InsetTextbreakParams::NOPAGEBREAK)
return 0;
os << '\n';
return PLAINTEXT_NEWLINE;
}
-void InsetNewpage::docbook(XMLStream & os, OutputParams const &) const
+void InsetTextbreak::docbook(XMLStream & os, OutputParams const &) const
{
- if (params_.kind != InsetNewpageParams::NOPAGEBREAK)
+ if (params_.kind != InsetTextbreakParams::NOPAGEBREAK)
os << xml::CR();
}
-docstring InsetNewpage::xhtml(XMLStream & xs, OutputParams const &) const
+docstring InsetTextbreak::xhtml(XMLStream & xs, OutputParams const &) const
{
- if (params_.kind != InsetNewpageParams::NOPAGEBREAK)
+ if (params_.kind != InsetTextbreakParams::NOPAGEBREAK)
xs << xml::CompTag("br");
return docstring();
}
-void InsetNewpage::updateBuffer(ParIterator const & it, UpdateType /* utype*/,
bool const /*deleted*/)
+void InsetTextbreak::updateBuffer(ParIterator const & it, UpdateType /*
utype*/, bool const /*deleted*/)
{
buffer().text().getContextualBreak(it.plist(), it.pit(),
contextual_cmd_, contextual_gui_);
}
-string InsetNewpage::contextMenuName() const
+string InsetTextbreak::contextMenuName() const
{
- return "context-newpage";
+ return "context-textbreak";
}
-void InsetNewpage::string2params(string const & in, InsetNewpageParams &
params)
+void InsetTextbreak::string2params(string const & in, InsetTextbreakParams &
params)
{
- params = InsetNewpageParams();
+ params = InsetTextbreakParams();
if (in.empty())
return;
@@ -367,8 +367,8 @@ void InsetNewpage::string2params(string const & in,
InsetNewpageParams & params)
string name;
lex >> name;
- if (!lex || name != "newpage") {
- LYXERR0("Expected arg 2 to be \"wrap\" in " << in);
+ if (!lex || name != "textbreak") {
+ LYXERR0("Expected arg 2 to be \"textbreak\" in " << in);
return;
}
@@ -376,10 +376,10 @@ void InsetNewpage::string2params(string const & in,
InsetNewpageParams & params)
}
-string InsetNewpage::params2string(InsetNewpageParams const & params)
+string InsetTextbreak::params2string(InsetTextbreakParams const & params)
{
ostringstream data;
- data << "newpage" << ' ';
+ data << "textbreak" << ' ';
params.write(data);
return data.str();
}
diff --git a/src/insets/InsetNewpage.h b/src/insets/InsetTextbreak.h
similarity index 70%
rename from src/insets/InsetNewpage.h
rename to src/insets/InsetTextbreak.h
index 1596c03009..8d99ffc074 100644
--- a/src/insets/InsetNewpage.h
+++ b/src/insets/InsetTextbreak.h
@@ -1,6 +1,6 @@
// -*- C++ -*-
/**
- * \file InsetNewpage.h
+ * \file InsetTextbreak.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@@ -9,15 +9,15 @@
* Full author contact details are available in file CREDITS.
*/
-#ifndef INSET_NEWPAGE_H
-#define INSET_NEWPAGE_H
+#ifndef INSET_TEXTBREAK_H
+#define INSET_TEXTBREAK_H
#include "Inset.h"
namespace lyx {
-class InsetNewpageParams
+class InsetTextbreakParams
{
public:
/// The different kinds of breaks we support
@@ -36,7 +36,7 @@ public:
CONTEXTUAL
};
///
- InsetNewpageParams() : kind(NEWPAGE) {}
+ InsetTextbreakParams() : kind(NEWPAGE) {}
///
void write(std::ostream & os) const;
///
@@ -46,23 +46,23 @@ public:
};
-class InsetNewpage : public Inset
+class InsetTextbreak : public Inset
{
public:
///
- InsetNewpage();
+ InsetTextbreak();
///
- explicit InsetNewpage(InsetNewpageParams const & par);
+ explicit InsetTextbreak(InsetTextbreakParams const & par);
///
- static void string2params(std::string const &, InsetNewpageParams &);
+ static void string2params(std::string const &, InsetTextbreakParams &);
///
- static std::string params2string(InsetNewpageParams const &);
+ static std::string params2string(InsetTextbreakParams const &);
/// Update the contextual information of this inset
void updateBuffer(ParIterator const &, UpdateType, bool const deleted =
false) override;
private:
///
- InsetCode lyxCode() const override { return NEWPAGE_CODE; }
+ InsetCode lyxCode() const override { return TEXTBREAK_CODE; }
///
void metrics(MetricsInfo &, Dimension &) const override;
///
@@ -81,7 +81,7 @@ private:
///
void write(std::ostream & os) const override;
///
- int rowFlags() const override { return (params_.kind ==
InsetNewpageParams::NOPAGEBREAK) ? Inline : Display; }
+ int rowFlags() const override { return (params_.kind ==
InsetTextbreakParams::NOPAGEBREAK) ? Inline : Display; }
///
docstring insetLabel() const;
///
@@ -89,14 +89,14 @@ private:
///
std::string contextMenuName() const override;
///
- Inset * clone() const override { return new InsetNewpage(*this); }
+ Inset * clone() const override { return new InsetTextbreak(*this); }
///
void doDispatch(Cursor & cur, FuncRequest & cmd) override;
///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &)
const override;
///
- InsetNewpageParams params_;
+ InsetTextbreakParams params_;
///
std::string contextual_cmd_;
///
@@ -105,4 +105,4 @@ private:
} // namespace lyx
-#endif // INSET_NEWPAGE_H
+#endif // INSET_TEXTBREAK_H
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index fd5abbc39f..e2df762724 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -1815,12 +1815,12 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest
const & cmd,
case LFUN_IPA_INSERT:
case LFUN_LISTING_INSERT:
case LFUN_MARGINALNOTE_INSERT:
- case LFUN_NEWPAGE_INSERT:
case LFUN_NOMENCL_INSERT:
case LFUN_NOMENCL_PRINT:
case LFUN_NOTE_INSERT:
case LFUN_PREVIEW_INSERT:
case LFUN_TABULAR_INSERT:
+ case LFUN_TEXTBREAK_INSERT:
case LFUN_WRAP_INSERT:
flag.setEnabled(false);
break;
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index b0aa48024a..8081a94c81 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -6159,7 +6159,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags,
bool outer,
t.cs() == "cleardoublepage" ||
t.cs() == "nopagebreak") {
context.check_layout(os);
- begin_inset(os, "Newpage ");
+ begin_inset(os, "Textbreak ");
os << t.cs();
end_inset(os);
skip_spaces_braces(p);
diff --git a/src/version.h b/src/version.h
index b71cf989f8..cf76ee8ce3 100644
--- a/src/version.h
+++ b/src/version.h
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 646 // spitz: InsetNewPage contextual
-#define LYX_FORMAT_TEX2LYX 646
+#define LYX_FORMAT_LYX 647 // spitz: InsetTextbreak
+#define LYX_FORMAT_TEX2LYX 647
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs