]> git.lyx.org Git - lyx.git/commitdiff
Support FreeSpacing in InsetArgument
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 2 Jun 2019 14:33:06 +0000 (16:33 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 2 Jun 2019 14:33:06 +0000 (16:33 +0200)
lib/doc/Customization.lyx
lib/doc/de/Customization.lyx
lib/scripts/layout2layout.py
src/Layout.cpp
src/Layout.h
src/TextClass.cpp
src/insets/InsetArgument.cpp
src/insets/InsetArgument.h
src/insets/InsetLayout.cpp

index 53e7687400e06edbc6856fec7fa633dc643a1229..6a5e3696c5c91a0ef33bb05409d8ad06413a44ce 100644 (file)
@@ -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
index cec6b8f81e4decf906ca5daeaf6f3ebfaa779e21..97e876f83de0063db953cf427724762d4594916a 100644 (file)
@@ -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
index 8fdc9fdf7299a4f7eda4eca62f8975be535c2a5a..80a21d78131123fdf88c481ae47886e755d56420 100644 (file)
@@ -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
index be31ccb5a1ad8753143721a081ba53d590171e64..fa6b58cc118c143fe06d8e4ea509d7ae921a49f6 100644 (file)
@@ -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;
index fcfdc11872ba495055a312bf02027ca4c916ead6..5a2567c13dd8ac02206b5a192c87246f76bdc8f9 100644 (file)
@@ -109,6 +109,7 @@ public:
                ArgPassThru passthru;
                docstring pass_thru_chars;
                bool is_toc_caption;
+               bool free_spacing;
                std::string newlinecmd;
        };
        ///
index 0dd44340dcf2ee861e589b17dcfe1b5f05f73cea..43abe6769bcedd67cd416217e6fe155c2df36eff 100644 (file)
@@ -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
index 37c244d1582296e8d60b54788f17ba8ce6172060..5dd8644fa3131fe4c92a4d1cc9aabe2f6552f86c 100644 (file)
@@ -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;
index 88af23d2f322f01bdd17c1f22216dde05989da7c..5c63702262595a3295bd2b67104efd847386bbce 100644 (file)
@@ -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_;
index 4d6a5edfbd984362c2b75fe83d2efa370266039c..f486e3d3d87ed9c613f37529257fcefabbd115cf 100644 (file)
@@ -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;