]> git.lyx.org Git - lyx.git/commitdiff
Simplify by using adjustCommand, and fix bug in the process
authorMartin Vermeer <martin.vermeer@hut.fi>
Wed, 10 Sep 2003 14:06:49 +0000 (14:06 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Wed, 10 Sep 2003 14:06:49 +0000 (14:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7730 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetcollapsable.C

index 1e591c440f6b86116b3d7c19290f61c4d5262b87..7db0575a150558a9288f526cf37ec82aa23929c0 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-10  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * insetcollapsable.C: Simplify by using adjustCommand, and fix bug
+       in the process
+
 2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * several files: change Assert to BOOST_ASSERT
index becba557199306a8c60bd27615ff3515cb431bf7..68fe887ab036aaa95f0d9d8de2971fcfa2c56cab 100644 (file)
@@ -319,15 +319,14 @@ InsetOld::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
                                bv->buffer()->markDirty();
                                inset.localDispatch(cmd);
                        } else {
-                               FuncRequest cmd1 = cmd;
                                if (!bv->lockInset(this))
                                        return DISPATCHED;
                                if (cmd.y <= button_dim.y2) {
+                                       FuncRequest cmd1 = cmd;
                                        cmd1.y = 0;
-                               } else {
-                                       cmd1.y = ascent() + cmd.y - (height_collapsed() + inset.ascent());
-                               }
-                               inset.localDispatch(cmd);
+                                       inset.localDispatch(cmd1);
+                               } else
+                                       inset.localDispatch(adjustCommand(cmd));
                        }
                        return DISPATCHED;
                }