]> git.lyx.org Git - features.git/commitdiff
Fixed updating of non locked inset inside other insets if requested!
authorJürgen Vigna <jug@sad.it>
Mon, 3 Dec 2001 14:46:22 +0000 (14:46 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 3 Dec 2001 14:46:22 +0000 (14:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3139 a592a061-630c-0410-9148-cb99ea01b6c8

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

index 00c3101df973cc9dd2a27041aa03a6d7af1c9ecc..b0cb4a1c5057129f3a8320d0e2ee030effb210ef 100644 (file)
@@ -2,6 +2,7 @@
 
        * insettext.C (updateInsetInInset): use lt variable to forbid
        changes of LyXText in an update call.
+       (updateInsetInInset): fixed updating of non locked insets!
 
 2001-12-01  John Levon  <moz@compsoc.man.ac.uk>
 
index 8b70df3e27e37cd234a289a9e603467b66f896a7..e3b43f0f1a1fbd9ae53f6ba3d9689b76df2f4697 100644 (file)
@@ -835,29 +835,45 @@ bool InsetText::unlockInsetInInset(BufferView * bv, UpdatableInset * inset,
 
 bool InsetText::updateInsetInInset(BufferView * bv, Inset * inset)
 {
-       if (!the_locking_inset)
-               return false;
-       if (the_locking_inset != inset) {
-               getLyXText(bv)->updateInset(bv, the_locking_inset);
-               setUpdateStatus(bv, CURSOR_PAR);
-               return the_locking_inset->updateInsetInInset(bv, inset);
-       }
        bool clear = false;
        if (!lt) {
                lt = getLyXText(bv);
                clear = true;
        }
-       if (lt->updateInset(bv, inset)) {
+       if (!the_locking_inset) {
+               bool found = lt->updateInset(bv, inset);
                if (clear)
                        lt = 0;
-               updateLocal(bv, CURSOR_PAR, false);
-       } else if (clear)
+               if (found)
+                       setUpdateStatus(bv, NONE);
+               return found;
+       }
+       if (the_locking_inset != inset) {
+#if 0
+               lt->updateInset(bv, the_locking_inset);
+               setUpdateStatus(bv, CURSOR_PAR);
+#endif
+               bool found = the_locking_inset->updateInsetInInset(bv, inset);
+               if (clear)
+                       lt = 0;
+               if (found)
+                       setUpdateStatus(bv, CURSOR_PAR);
+               return found;
+       }
+       bool found = lt->updateInset(bv, inset);
+       if (clear)
                lt = 0;
-       if (cpar(bv) == inset_par && cpos(bv) == inset_pos) {
-               inset_x = cx(bv) - top_x + drawTextXOffset;
-               inset_y = cy(bv) + drawTextYOffset;
+       if (found) {
+               setUpdateStatus(bv, CURSOR_PAR);
+#if 0
+               updateLocal(bv, CURSOR_PAR, false);
+#endif
+               if (cpar(bv) == inset_par && cpos(bv) == inset_pos) {
+                       inset_x = cx(bv) - top_x + drawTextXOffset;
+                       inset_y = cy(bv) + drawTextYOffset;
+               }
        }
-       return true;
+       return found;
 }