]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetArgument.cpp
Some things did not need to be mutable after all
[lyx.git] / src / insets / InsetArgument.cpp
index 26aa2f3754c16bdaf8f0c5c23b0381acef5e0f2e..da807d201a40af30e34192970e0c9c2c1c87be24 100644 (file)
@@ -24,6 +24,8 @@
 #include "Lexer.h"
 #include "OutputParams.h"
 #include "ParIterator.h"
+#include "TexRow.h"
+#include "texstream.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
@@ -39,7 +41,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 +114,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.");
@@ -231,7 +234,10 @@ bool InsetArgument::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 string InsetArgument::contextMenuName() const
 {
-       return "context-argument";
+       if (decoration() == InsetLayout::CONGLOMERATE)
+               return "context-argument-conglomerate";
+       else
+               return "context-argument";
 }
 
 
@@ -264,10 +270,11 @@ void InsetArgument::latexArgument(otexstream & os,
                OutputParams const & runparams_in, docstring const & ldelim,
                docstring const & rdelim, docstring const & presetarg) const
 {
-       TexRow texrow;
        odocstringstream ss;
-       otexstream ots(ss, texrow);
+       otexstream ots(ss);
        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(", ");
@@ -275,6 +282,7 @@ void InsetArgument::latexArgument(otexstream & os,
                str = presetarg + sep + str;
        if (ldelim != "{" && support::contains(str, rdelim))
                str = '{' + str + '}';
+       // TODO: append texrow information
        os << ldelim << str << rdelim;
 }