]> git.lyx.org Git - lyx.git/commitdiff
Implement PassThruChars to Argument
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 8 May 2015 07:32:31 +0000 (09:32 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 8 May 2015 07:32:31 +0000 (09:32 +0200)
Closes: #9535.
src/Layout.cpp
src/Layout.h
src/insets/InsetArgument.cpp
src/insets/InsetArgument.h
src/insets/InsetLayout.cpp

index 1e8943377716c393cbefbeff80cb3ab64fa40f0a..e01b21eed74b584322afa5f6b707256609d1c99a 100644 (file)
@@ -994,6 +994,9 @@ void Layout::readArgument(Lexer & lex)
                        arg.font = lyxRead(lex, arg.font);
                } else if (tok == "labelfont") {
                        arg.labelfont = lyxRead(lex, arg.labelfont);
+               } else if (tok == "passthruchars") {
+                       lex.next();
+                       arg.pass_thru_chars = lex.getDocString();
                } else {
                        lex.printError("Unknown tag");
                        error = true;
index 9f98f0a1f9ed40be3a823f72bb33d982b1781afe..a458f2f6dc07619faa180273f6e3fa78c22b6924 100644 (file)
@@ -104,6 +104,7 @@ public:
                FontInfo font;
                FontInfo labelfont;
                bool autoinsert;
+               docstring pass_thru_chars;
        };
        ///
        typedef std::map<std::string, latexarg> LaTeXArgMap;
index 26aa2f3754c16bdaf8f0c5c23b0381acef5e0f2e..48551db1f528e94f1d6becdc8d38414a188206d1 100644 (file)
@@ -39,7 +39,7 @@ namespace lyx {
 InsetArgument::InsetArgument(Buffer * buf, string const & name)
     : InsetCollapsable(buf), name_(name), labelstring_(docstring()),
       font_(inherit_font), labelfont_(inherit_font), decoration_(string()),
-      pass_thru_(false)
+      pass_thru_(false), pass_thru_chars_(docstring())
 {}
 
 
@@ -112,6 +112,7 @@ void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
                font_ = (*lait).second.font;
                labelfont_ = (*lait).second.labelfont;
                decoration_ = (*lait).second.decoration;
+               pass_thru_chars_ = (*lait).second.pass_thru_chars;
        } else {
                labelstring_ = _("Unknown Argument");
                tooltip_ = _("Argument not known in this Layout. Will be supressed in the output.");
@@ -268,6 +269,8 @@ void InsetArgument::latexArgument(otexstream & os,
        odocstringstream ss;
        otexstream ots(ss, texrow);
        OutputParams runparams = runparams_in;
+       if (!pass_thru_chars_.empty())
+               runparams.pass_thru_chars += pass_thru_chars_;
        InsetText::latex(ots, runparams);
        docstring str = ss.str();
        docstring const sep = str.empty() ? docstring() : from_ascii(", ");
index 186c6119e3d884c64790a53616ddfcf43f795cd0..d5cae98cb05ddac36c78f627434e875313431c76 100644 (file)
@@ -97,6 +97,8 @@ private:
        std::string decoration_;
        ///
        bool pass_thru_;
+       ///
+       docstring pass_thru_chars_;
 
 protected:
        /// \name Protected functions inherited from Inset class
index eed1b6bbde4b79dc56ecd519302dbc3bf4bdfd1d..de8ee9e0083c76cebada2f12ea27c766c4f988fe 100644 (file)
@@ -620,6 +620,9 @@ void InsetLayout::readArgument(Lexer & lex)
                        arg.font = lyxRead(lex, arg.font);
                } else if (tok == "labelfont") {
                        arg.labelfont = lyxRead(lex, arg.labelfont);
+               } else if (tok == "passthruchars") {
+                       lex.next();
+                       arg.pass_thru_chars = lex.getDocString();
                } else {
                        lex.printError("Unknown tag");
                        error = true;