From: Juergen Spitzmueller Date: Sun, 2 Jun 2019 14:33:06 +0000 (+0200) Subject: Support FreeSpacing in InsetArgument X-Git-Tag: lyx-2.4.0dev-acb2ca7b~1942 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9f04eeae032d;p=features.git Support FreeSpacing in InsetArgument --- diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx index 53e7687400..6a5e3696c5 100644 --- a/lib/doc/Customization.lyx +++ b/lib/doc/Customization.lyx @@ -1,5 +1,5 @@ #LyX 2.4 created this file. For more info see https://www.lyx.org/ -\lyxformat 573 +\lyxformat 575 \begin_document \begin_header \save_transient_properties true @@ -102,6 +102,8 @@ logicalmkup \justification true \use_refstyle 0 \use_minted 0 +\use_lineno 0 +\lineno_options \notefontcolor #0000ff \branch OutDated \selected 0 @@ -12296,6 +12298,64 @@ reference "subsec:Font-description" \end_inset . +\change_inserted -712698321 1559484228 + +\end_layout + +\begin_layout Itemize + +\change_inserted -712698321 1559484228 +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1559484228 +FreeSpacing +\end_layout + +\end_inset + + [ +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1559484228 + +\emph on +0 +\end_layout + +\end_inset + +, +\begin_inset space \thinspace{} +\end_inset + + +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1559484228 +1 +\end_layout + +\end_inset + +] As with paragraph styles, see +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Paragraph-Styles" + +\end_inset + +. +\change_unchanged + \end_layout \begin_layout Itemize @@ -12376,8 +12436,12 @@ status collapsed \end_inset , this argument is automatically inserted when the respective style is selected. + +\change_deleted -712698321 1559484200 Currently, only one argument per style\SpecialChar breakableslash layout can be automatically inserted. +\change_unchanged + \end_layout \begin_layout Itemize diff --git a/lib/doc/de/Customization.lyx b/lib/doc/de/Customization.lyx index cec6b8f81e..97e876f83d 100644 --- a/lib/doc/de/Customization.lyx +++ b/lib/doc/de/Customization.lyx @@ -1,5 +1,5 @@ #LyX 2.4 created this file. For more info see https://www.lyx.org/ -\lyxformat 573 +\lyxformat 575 \begin_document \begin_header \save_transient_properties true @@ -110,6 +110,8 @@ logicalmkup \justification true \use_refstyle 0 \use_minted 0 +\use_lineno 0 +\lineno_options \notefontcolor #0000ff \branch OutDated \selected 0 @@ -10459,6 +10461,52 @@ reference "subsec:Beschreibung-des-Zeichensatzes" \begin_inset Flex Code status collapsed +\begin_layout Plain Layout +FreeSpacing +\end_layout + +\end_inset + + [ +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\emph on +0 +\end_layout + +\end_inset + +, +\begin_inset space \thinspace{} +\end_inset + + +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout +1 +\end_layout + +\end_inset + +] Wie bei Absatz-Layouts, siehe +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Einzelne-Absatz-Layouts" + +\end_inset + +. +\end_layout + +\begin_layout Itemize +\begin_inset Flex Code +status collapsed + \begin_layout Plain Layout LabelFont \end_layout @@ -10534,8 +10582,6 @@ status collapsed gesetzt wird, wird dieses Argument automatisch eingefügt, sobald der betreffend e Absatzstil ausgewählt wird. - Momentan ist es nur möglich, ein Argument pro Stil\SpecialChar breakableslash -Format automatisch einzufügen. \end_layout \begin_layout Itemize diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py index 8fdc9fdf72..80a21d7813 100644 --- a/lib/scripts/layout2layout.py +++ b/lib/scripts/layout2layout.py @@ -11,7 +11,7 @@ # This script will update a .layout file to current format # The latest layout format is also defined in src/TextClass.cpp -currentFormat = 74 +currentFormat = 75 # Incremented to format 4, 6 April 2007, lasgouttes @@ -248,6 +248,9 @@ currentFormat = 74 # Incremented to format 74, 18 April 2019 by spitz # New InsetLayout and Argument tag NewlineCmd +# Incremented to format 75, 2 June 2019 by spitz +# New Argument tag FreeSpacing + # Do not forget to document format change in Customization # Manual (section "Declaring a new text class"). @@ -497,7 +500,7 @@ def convert(lines, end_format): i += 1 continue - if format >= 65 and format <= 73: + if format >= 65 and format <= 74: # nothing to do. i += 1 continue diff --git a/src/Layout.cpp b/src/Layout.cpp index be31ccb5a1..fa6b58cc11 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -1022,6 +1022,7 @@ void Layout::readArgument(Lexer & lex) arg.labelfont = inherit_font; arg.is_toc_caption = false; arg.passthru = PT_INHERITED; + arg.free_spacing = false; string id; lex >> id; bool const itemarg = prefixIs(id, "item:"); @@ -1098,6 +1099,9 @@ void Layout::readArgument(Lexer & lex) } else if (tok == "istoccaption") { lex.next(); arg.is_toc_caption = lex.getBool(); + } else if (tok == "freespacing") { + lex.next(); + arg.free_spacing = lex.getBool(); } else { lex.printError("Unknown tag"); error = true; diff --git a/src/Layout.h b/src/Layout.h index fcfdc11872..5a2567c13d 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -109,6 +109,7 @@ public: ArgPassThru passthru; docstring pass_thru_chars; bool is_toc_caption; + bool free_spacing; std::string newlinecmd; }; /// diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 0dd44340dc..43abe6769b 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -62,7 +62,7 @@ namespace lyx { // You should also run the development/tools/updatelayouts.py script, // to update the format of all of our layout files. // -int const LAYOUT_FORMAT = 74; // spitz: NewlineCmd +int const LAYOUT_FORMAT = 75; // spitz: FreeSpacing (Argument) // Layout format for the current lyx file format. Controls which format is diff --git a/src/insets/InsetArgument.cpp b/src/insets/InsetArgument.cpp index 37c244d158..5dd8644fa3 100644 --- a/src/insets/InsetArgument.cpp +++ b/src/insets/InsetArgument.cpp @@ -43,7 +43,8 @@ InsetArgument::InsetArgument(Buffer * buf, string const & name) : InsetCollapsible(buf), name_(name), labelstring_(docstring()), font_(inherit_font), labelfont_(inherit_font), decoration_(string()), pass_thru_context_(false), pass_thru_local_(false), pass_thru_(false), - pass_thru_chars_(docstring()), is_toc_caption_(false), newline_cmd_(string()) + free_spacing_(false), pass_thru_chars_(docstring()), is_toc_caption_(false), + newline_cmd_(string()) {} @@ -119,6 +120,7 @@ void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype) decoration_ = (*lait).second.decoration; pass_thru_chars_ = (*lait).second.pass_thru_chars; newline_cmd_ = (*lait).second.newlinecmd; + free_spacing_ = (*lait).second.free_spacing; pass_thru_local_ = false; if (lait->second.is_toc_caption) { is_toc_caption_ = true; diff --git a/src/insets/InsetArgument.h b/src/insets/InsetArgument.h index 88af23d2f3..5c63702262 100644 --- a/src/insets/InsetArgument.h +++ b/src/insets/InsetArgument.h @@ -69,6 +69,8 @@ public: /// bool isPassThru() const { return pass_thru_; } /// + bool isFreeSpacing() const { return free_spacing_; } + /// bool isTocCaption() const { return is_toc_caption_; } /// bool resetFontEdit() const { return false; } @@ -114,6 +116,8 @@ private: /// Effective pass-thru setting (inherited or local) bool pass_thru_; /// + bool free_spacing_; + /// docstring pass_thru_chars_; /// Does this argument provide content for the TOC? bool is_toc_caption_; diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp index 4d6a5edfbd..f486e3d3d8 100644 --- a/src/insets/InsetLayout.cpp +++ b/src/insets/InsetLayout.cpp @@ -610,6 +610,7 @@ void InsetLayout::readArgument(Lexer & lex) arg.font = inherit_font; arg.labelfont = inherit_font; arg.is_toc_caption = false; + arg.free_spacing = false; arg.passthru = PT_INHERITED; arg.nodelims = false; string nr; @@ -685,6 +686,9 @@ void InsetLayout::readArgument(Lexer & lex) } else if (tok == "istoccaption") { lex.next(); arg.is_toc_caption = lex.getBool(); + } else if (tok == "freespacing") { + lex.next(); + arg.free_spacing = lex.getBool(); } else { lex.printError("Unknown tag"); error = true;