]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetArgument.cpp
DocBook: fix encoding issues with complex ERT.
[lyx.git] / src / insets / InsetArgument.cpp
index a3cf1c5202971fd76cb2529dcf67cb5fb93028be..00484f791f49154f617811b72e705fc54909d66e 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())
+      free_spacing_(false), pass_thru_chars_(docstring()), is_toc_caption_(false),
+      newline_cmd_(string())
 {}
 
 
@@ -61,7 +62,7 @@ void InsetArgument::read(Lexer & lex)
 }
 
 
-void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        bool const insetlayout = !it.paragraph().layout().hasArgs();
        Layout::LaTeXArgMap const args = insetlayout ?
@@ -118,12 +119,16 @@ void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
                labelfont_ = (*lait).second.labelfont;
                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)
+               if (lait->second.is_toc_caption) {
+                       is_toc_caption_ = true;
                        // empty if AddToToc is not set
                        caption_of_toc_ = insetlayout
                                ? it.inset().getLayout().tocType()
                                : it.paragraph().layout().tocType();
+               }
 
                switch ((*lait).second.passthru) {
                        case PT_INHERITED:
@@ -152,7 +157,7 @@ void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
        }
 
        setButtonLabel();
-       InsetCollapsible::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype, deleted);
 }
 
 
@@ -309,10 +314,13 @@ void InsetArgument::latexArgument(otexstream & os,
        OutputParams runparams = runparams_in;
        if (!pass_thru_chars_.empty())
                runparams.pass_thru_chars += pass_thru_chars_;
+       if (!newline_cmd_.empty())
+               runparams.newlinecmd = newline_cmd_;
        runparams.pass_thru = isPassThru();
        InsetText::latex(ots, runparams);
        TexString ts = ots.release();
-       bool const add_braces = ldelim != "{" && support::contains(ts.str, rdelim);
+       bool const add_braces = !ldelim.empty() && ldelim != "{"
+                       && support::contains(ts.str, rdelim);
        os << ldelim;
        if (add_braces)
                os << '{';