commit 5b03ae11a06f937b270fc6bccab1e3a7d96fc3b8
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri May 8 09:32:31 2015 +0200

    Implement PassThruChars to Argument
    
    Closes: #9535.

diff --git a/src/Layout.cpp b/src/Layout.cpp
index 1e89433..e01b21e 100644
--- a/src/Layout.cpp
+++ b/src/Layout.cpp
@@ -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;
diff --git a/src/Layout.h b/src/Layout.h
index 9f98f0a..a458f2f 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -104,6 +104,7 @@ public:
                FontInfo font;
                FontInfo labelfont;
                bool autoinsert;
+               docstring pass_thru_chars;
        };
        ///
        typedef std::map<std::string, latexarg> LaTeXArgMap;
diff --git a/src/insets/InsetArgument.cpp b/src/insets/InsetArgument.cpp
index 26aa2f3..48551db 100644
--- a/src/insets/InsetArgument.cpp
+++ b/src/insets/InsetArgument.cpp
@@ -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(", ");
diff --git a/src/insets/InsetArgument.h b/src/insets/InsetArgument.h
index 186c611..d5cae98 100644
--- a/src/insets/InsetArgument.h
+++ b/src/insets/InsetArgument.h
@@ -97,6 +97,8 @@ private:
        std::string decoration_;
        ///
        bool pass_thru_;
+       ///
+       docstring pass_thru_chars_;
 
 protected:
        /// \name Protected functions inherited from Inset class
diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index eed1b6b..de8ee9e 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -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;

Reply via email to