+
+
+bool InsetCollapsable::nodraw() const
+{
+ return inset.nodraw();
+}
+
+
+int InsetCollapsable::scroll(bool recursive) const
+{
+ int sx = UpdatableInset::scroll(false);
+
+ if (recursive)
+ sx += inset.scroll(recursive);
+
+ return sx;
+}
+
+
+Paragraph * InsetCollapsable::getParFromID(int id) const
+{
+ lyxerr[Debug::INFO] << "Looking for paragraph " << id << endl;
+ return inset.getParFromID(id);
+}
+
+
+Paragraph * InsetCollapsable::firstParagraph() const
+{
+ return inset.firstParagraph();
+}
+
+
+Paragraph * InsetCollapsable::getFirstParagraph(int i) const
+{
+ return inset.getFirstParagraph(i);
+}
+
+
+LyXCursor const & InsetCollapsable::cursor(BufferView * bv) const
+{
+ return inset.cursor(bv);
+}
+
+
+Inset * InsetCollapsable::getInsetFromID(int id_arg) const
+{
+ if (id_arg == id())
+ return const_cast<InsetCollapsable *>(this);
+ return inset.getInsetFromID(id_arg);
+}
+
+
+void InsetCollapsable::open(BufferView * bv)
+{
+ if (!collapsed_) return;
+
+ collapsed_ = false;
+ bv->updateInset(this, false);
+}
+
+
+void InsetCollapsable::close(BufferView * bv) const
+{
+ if (collapsed_)
+ return;
+
+ collapsed_ = true;
+ bv->updateInset(const_cast<InsetCollapsable *>(this), false);
+}
+
+
+void InsetCollapsable::setLabel(string const & l) const
+{
+ label = l;
+}
+
+
+bool InsetCollapsable::searchForward(BufferView * bv, string const & str,
+ bool cs, bool mw)
+{
+ bool found = inset.searchForward(bv, str, cs, mw);
+ if (first_after_edit && !found)
+ close(bv);
+ first_after_edit = false;
+ return found;
+}
+
+
+bool InsetCollapsable::searchBackward(BufferView * bv, string const & str,
+ bool cs, bool mw)
+{
+ bool found = inset.searchBackward(bv, str, cs, mw);
+ if (first_after_edit && !found)
+ close(bv);
+ first_after_edit = false;
+ return found;
+}
+
+
+string const InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv,
+ float & value) const
+{
+ string const str = inset.selectNextWordToSpellcheck(bv, value);
+ if (first_after_edit && str.empty())
+ close(bv);
+ first_after_edit = false;
+ return str;
+}