]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetArgument.cpp
InsetInfo: enable inset dissolve
[lyx.git] / src / insets / InsetArgument.cpp
index 88e733613ad3d13fbb9d56ffbba381a6c742a9cd..df1344e6267a5537bcc4e972ea4b0afacb83133f 100644 (file)
@@ -40,24 +40,24 @@ namespace lyx {
 
 
 InsetArgument::InsetArgument(Buffer * buf, string const & name)
-    : InsetCollapsable(buf), name_(name), labelstring_(docstring()),
+    : 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())
+      pass_thru_chars_(docstring()), is_toc_caption_(false)
 {}
 
 
 void InsetArgument::write(ostream & os) const
 {
        os << "Argument " << name_ << "\n";
-       InsetCollapsable::write(os);
+       InsetCollapsible::write(os);
 }
 
 
 void InsetArgument::read(Lexer & lex)
 {
        lex >> name_;
-       InsetCollapsable::read(lex);
+       InsetCollapsible::read(lex);
 }
 
 
@@ -119,11 +119,13 @@ void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
                decoration_ = (*lait).second.decoration;
                pass_thru_chars_ = (*lait).second.pass_thru_chars;
                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 +154,7 @@ void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
        }
 
        setButtonLabel();
-       InsetCollapsable::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype);
 }
 
 
@@ -207,11 +209,11 @@ void InsetArgument::doDispatch(Cursor & cur, FuncRequest & cmd)
                                fixParagraphLanguage(buffer().params().language);
                }
                else
-                       InsetCollapsable::doDispatch(cur, cmd);
+                       InsetCollapsible::doDispatch(cur, cmd);
                break;
 
        default:
-               InsetCollapsable::doDispatch(cur, cmd);
+               InsetCollapsible::doDispatch(cur, cmd);
                break;
        }
 }
@@ -251,11 +253,11 @@ bool InsetArgument::getStatus(Cursor & cur, FuncRequest const & cmd,
                                flag.setEnabled(false);
                        return true;
                }
-               return InsetCollapsable::getStatus(cur, cmd, flag);
+               return InsetCollapsible::getStatus(cur, cmd, flag);
        }
 
        default:
-               return InsetCollapsable::getStatus(cur, cmd, flag);
+               return InsetCollapsible::getStatus(cur, cmd, flag);
        }
 }
 
@@ -273,7 +275,7 @@ FontInfo InsetArgument::getFont() const
 {
        if (font_ != inherit_font)
                return font_;
-       return InsetCollapsable::getFont();
+       return InsetCollapsible::getFont();
 }
 
 
@@ -281,14 +283,14 @@ FontInfo InsetArgument::getLabelfont() const
 {
        if (labelfont_ != inherit_font)
                return labelfont_;
-       return InsetCollapsable::getLabelfont();
+       return InsetCollapsible::getLabelfont();
 }
 
 
 ColorCode InsetArgument::labelColor() const {
        if (labelfont_.color() != Color_inherit)
                return labelfont_.color();
-       return InsetCollapsable::labelColor();
+       return InsetCollapsible::labelColor();
 }