]> git.lyx.org Git - lyx.git/commitdiff
Move defaults into struct definition
authorRichard Kimberly Heck <rikiheck@lyx.org>
Tue, 29 Sep 2020 01:30:40 +0000 (21:30 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Tue, 29 Sep 2020 01:30:40 +0000 (21:30 -0400)
src/Layout.cpp
src/Layout.h

index f5e6f771308ff6a476852adf7995d705fa3a2ffb..6b591ec13ff8a74c5b5b4071c50f59ddce83f28e 100644 (file)
@@ -1151,19 +1151,8 @@ void Layout::readSpacing(Lexer & lex)
 void Layout::readArgument(Lexer & lex)
 {
        latexarg arg;
-       // writeArgument() makes use of these default values
-       arg.mandatory = false;
-       arg.nodelims = false;
-       arg.autoinsert = false;
-       arg.insertcotext = false;
-       arg.insertonnewline = false;
        bool error = false;
        bool finished = false;
-       arg.font = inherit_font;
-       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:");
index 14784a27d23315456d7eddb2286a912d28572a97..590c52d34168033f13dc7644f86a1a6a33698391 100644 (file)
@@ -93,8 +93,8 @@ public:
        struct latexarg {
                docstring labelstring;
                docstring menustring;
-               bool mandatory;
-               bool nodelims;
+               bool mandatory = false;
+               bool nodelims = false;
                docstring ldelim;
                docstring rdelim;
                docstring defaultarg;
@@ -102,15 +102,15 @@ public:
                docstring tooltip;
                std::string required;
                std::string decoration;
-               FontInfo font;
-               FontInfo labelfont;
-               bool autoinsert;
-               bool insertcotext;
-               bool insertonnewline;
-               ArgPassThru passthru;
+               FontInfo font = inherit_font;
+               FontInfo labelfont = inherit_font;
+               bool autoinsert = false;
+               bool insertcotext = false;
+               bool insertonnewline = false;
+               ArgPassThru passthru = PT_INHERITED;
                docstring pass_thru_chars;
-               bool is_toc_caption;
-               bool free_spacing;
+               bool is_toc_caption = false;
+               bool free_spacing = false;
                std::string newlinecmd;
        };
        ///