Alfredo Braunstein wrote:

> Andre Poenitz wrote:
> 
>>                  for (int i = 0; i < n; ++i) {
>>                          InsetText * in = &tabular.getCellInset(i);
>>                          if (inset == in) {
>> @@ -451,11 +450,9 @@ bool InsetTabular::lockInsetInInset(Buff
>>                                  resetPos(bv);
>>                                  return true;
>>                          }
>> -                        if (in->getInsetFromID(id)) {
>> -                                actcell = i;
>> -                                in->dispatch(FuncRequest(bv,
>> LFUN_INSET_EDIT));
>> -                                return
>> the_locking_inset->lockInsetInInset(bv, inset);
>> -                        }
>> +                        actcell = i;
>> +                        in->dispatch(FuncRequest(bv, LFUN_INSET_EDIT));
>> +                        return the_locking_inset->lockInsetInInset(bv,
>> inset);
>  
> shouldn't this last line be
> 
> if (the_locking_inset->lockInsetInInset(bv, inset))
>         return true;
> 
> instead? If that is not needed, then you can get rid of the loop

it is needed (this broke lockPath)

Can I commit this?

Alfredo
Index: insets/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.894
diff -u -p -u -r1.894 ChangeLog
--- insets/ChangeLog	4 Nov 2003 08:33:23 -0000	1.894
+++ insets/ChangeLog	4 Nov 2003 11:08:43 -0000
@@ -1,3 +1,7 @@
+2003-11-04  Alfredo Braunstein  <[EMAIL PROTECTED]>
+
+	* insettabular.C (lockInsetInInset): small fix
+
 2003-11-04  Lars Gullik Bjønnes  <[EMAIL PROTECTED]>
 
 	* insettext.C (priv_dispatch): some DispatchResult type cleanup,
Index: insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.364
diff -u -p -u -r1.364 insettabular.C
--- insets/insettabular.C	3 Nov 2003 19:52:45 -0000	1.364
+++ insets/insettabular.C	4 Nov 2003 11:08:47 -0000
@@ -450,9 +450,14 @@ bool InsetTabular::lockInsetInInset(Buff
 				resetPos(bv);
 				return true;
 			}
-			actcell = i;
-			in->dispatch(FuncRequest(bv, LFUN_INSET_EDIT));
-			return the_locking_inset->lockInsetInInset(bv, inset);
+			if (in->lockInsetInInset(bv, inset)) {
+				actcell = i;
+				the_locking_inset = in;
+				locked = true;
+				resetPos(bv);
+				in->dispatch(FuncRequest(bv, LFUN_INSET_EDIT));
+				return true;
+			}
 		}
 		return false;
 	}

Reply via email to