]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcollapsable.C
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / insetcollapsable.C
index 6efb25a2b750911e35532f985127eb3a8178a9d8..2ea0f2f90849f8cb7054bd34af923db364f9cd47 100644 (file)
@@ -7,7 +7,7 @@
  * \author Jürgen Vigna
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
@@ -49,12 +49,12 @@ InsetCollapsable::InsetCollapsable(BufferParams const & bp, bool collapsed)
 #if 0
        autocollapse(false),
 #endif
-         oldWidth(0), in_update(false), first_after_edit(false)
+         in_update(false), first_after_edit(false)
 {
        inset.setOwner(this);
        inset.setAutoBreakRows(true);
-       inset.setDrawFrame(0, InsetText::ALWAYS);
-       inset.setFrameColor(0, LColor::collapsableframe);
+       inset.setDrawFrame(InsetText::ALWAYS);
+       inset.setFrameColor(LColor::collapsableframe);
        setInsetName("Collapsable");
 }
 
@@ -66,7 +66,7 @@ InsetCollapsable::InsetCollapsable(InsetCollapsable const & in)
 #if 0
          autocollapse(in.autocollapse),
 #endif
-         oldWidth(0), in_update(false), first_after_edit(false)
+         in_update(false), first_after_edit(false)
 {
        inset.init(&(in.inset));
        inset.setOwner(this);
@@ -84,14 +84,14 @@ bool InsetCollapsable::insertInset(BufferView * bv, InsetOld * in)
 }
 
 
-void InsetCollapsable::write(Buffer const * buf, ostream & os) const
+void InsetCollapsable::write(Buffer const & buf, ostream & os) const
 {
        os << "collapsed " << (collapsed_ ? "true" : "false") << "\n";
        inset.writeParagraphData(buf, os);
 }
 
 
-void InsetCollapsable::read(Buffer const * buf, LyXLex & lex)
+void InsetCollapsable::read(Buffer const & buf, LyXLex & lex)
 {
        if (lex.isOK()) {
                lex.next();
@@ -210,7 +210,7 @@ void InsetCollapsable::insetUnlock(BufferView * bv)
        inset.insetUnlock(bv);
        if (scroll())
                scroll(bv, 0.0F);
-       bv->updateInset();
+       bv->updateInset(this);
 }
 
 
@@ -229,7 +229,7 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
 
        if (collapsed_ && cmd.button() != mouse_button::button3) {
                collapsed_ = false;
-               bv->updateInset();
+               bv->updateInset(this);
                bv->buffer()->markDirty();
                return;
        }
@@ -241,8 +241,9 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
                        collapsed_ = true;
                        bv->unlockInset(this);
                }
-               bv->updateInset();
+               bv->updateInset(this);
                bv->buffer()->markDirty();
+               lyxerr << "InsetCollapsable::lfunMouseRelease\n";
        } else if (!collapsed_ && cmd.y > button_dim.y2) {
                ret = inset.localDispatch(adjustCommand(cmd)) == DISPATCHED;
        }
@@ -251,26 +252,26 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
 }
 
 
-int InsetCollapsable::latex(Buffer const * buf, ostream & os,
+int InsetCollapsable::latex(Buffer const & buf, ostream & os,
                            LatexRunParams const & runparams) const
 {
        return inset.latex(buf, os, runparams);
 }
 
 
-int InsetCollapsable::ascii(Buffer const * buf, ostream & os, int ll) const
+int InsetCollapsable::ascii(Buffer const & buf, ostream & os, int ll) const
 {
        return inset.ascii(buf, os, ll);
 }
 
 
-int InsetCollapsable::linuxdoc(Buffer const * buf, ostream & os) const
+int InsetCollapsable::linuxdoc(Buffer const & buf, ostream & os) const
 {
        return inset.linuxdoc(buf, os);
 }
 
 
-int InsetCollapsable::docbook(Buffer const * buf, ostream & os, bool mixcont) const
+int InsetCollapsable::docbook(Buffer const & buf, ostream & os, bool mixcont) const
 {
        return inset.docbook(buf, os, mixcont);
 }
@@ -295,7 +296,7 @@ InsetOld::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
                                        lyxerr << "branch collapsed_" << endl;
                                        collapsed_ = false;
                                        if (bv->lockInset(this)) {
-                                               bv->updateInset();
+                                               bv->updateInset(this);
                                                bv->buffer()->markDirty();
                                                inset.localDispatch(cmd);
                                                first_after_edit = true;
@@ -323,7 +324,7 @@ InsetOld::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
                                first_after_edit = true;
                                if (!bv->lockInset(this))
                                        return DISPATCHED;
-                               bv->updateInset();
+                               bv->updateInset(this);
                                bv->buffer()->markDirty();
                                inset.localDispatch(cmd);
                        } else {
@@ -444,13 +445,6 @@ void InsetCollapsable::deleteLyXText(BufferView * bv, bool recursive) const
 }
 
 
-void InsetCollapsable::resizeLyXText(BufferView * bv, bool force) const
-{
-       inset.resizeLyXText(bv, force);
-       oldWidth = width();
-}
-
-
 void InsetCollapsable::getLabelList(std::vector<string> & list) const
 {
        inset.getLabelList(list);
@@ -494,7 +488,7 @@ void InsetCollapsable::open(BufferView * bv)
                return;
 
        collapsed_ = false;
-       bv->updateInset();
+       bv->updateInset(this);
 }
 
 
@@ -504,7 +498,7 @@ void InsetCollapsable::close(BufferView * bv) const
                return;
 
        collapsed_ = true;
-       bv->updateInset();
+       bv->updateInset(this);
 }