]> git.lyx.org Git - features.git/commitdiff
fix crash when opening collapsables
authorAlfredo Braunstein <abraunst@lyx.org>
Wed, 4 Feb 2004 09:14:27 +0000 (09:14 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Wed, 4 Feb 2004 09:14:27 +0000 (09:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8399 a592a061-630c-0410-9148-cb99ea01b6c8

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

index 3451fd64e9af19bc312f2bb37633453ae72b4a57..6ce68cdc4bf8f8a17d391fc0545592530789b31d 100644 (file)
@@ -1,3 +1,10 @@
+
+2004-02-04  Alfredo Braunstein  <abraunst@lyx.org>
+
+       * insettext.C (edit): 
+       (updateLocal): use the cur argument instead of the global cursor
+       * insetcollapsable.C (edit): dont call inset.edit(x,y) when opening
+
 2004-02-01  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * insetlatexaccent.C (checkContents): "c" -> 'c' in calls to contains
index 59857a0a1bb1ef63b29663450ebaf7715080ac89..cbea996dcb6792301c377dba04e046929de3d8fe 100644 (file)
@@ -299,13 +299,18 @@ void InsetCollapsable::edit(LCursor & cur, int x, int y)
        //lyxerr << "InsetCollapsable: edit xy" << endl;
        if (status_ == Collapsed) {
                setStatus(Open);
+               inset.edit(cur, true);
+#warning look here
+//we are not calling edit(x,y) because there are no coordinates in the
+//inset yet. I personally think it's ok. (ab)
        } else {
                if (y <= button_dim.y2)
                        y = 0;
                else
                        y += inset.ascent() - height_collapsed();
+               
+               inset.edit(cur, x, y);
        }
-       inset.edit(cur, x, y);
 }
 
 
index f06f56b0e03e1f311ab3523d28741dc2957d7475..195a2e31e0a365f2e1df4ac2e94375d5cc3b0cba 100644 (file)
@@ -253,7 +253,7 @@ void InsetText::updateLocal(LCursor & cur)
        lv->updateMenubar();
        lv->updateToolbar();
        if (old_par != cur.par()) {
-               lv->setLayout(text_.cursorPar()->layout()->name());
+               lv->setLayout(text_.getPar(cur.par())->layout()->name());
                old_par = cur.par();
        }
 }
@@ -287,7 +287,7 @@ void InsetText::edit(LCursor & cur, bool left)
        setViewCache(&cur.bv());
        int const par = left ? 0 : paragraphs().size() - 1;
        int const pos = left ? 0 : paragraphs().back().size();
-       text_.setCursor(par, pos);
+       text_.setCursor(cur.current(), par, pos);
        cur.clearSelection();
        finishUndo();
        sanitizeEmptyText(cur.bv());