Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
[EMAIL PROTECTED] wrote: Author: spitz Date: Mon Mar 3 13:22:17 2008 New Revision: 23410 URL: http://www.lyx.org/trac/changeset/23410 Log: * src/insets/InsetLabel.cpp (doDispatch): - restore call to changeRefsIfUnique. The references were not updated if the label name was changed.

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: The references were not updated if the label name was changed. Then this is a bug of in InsetLabel::update() because the code for this is present in there. looks like it. Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: But it used to work fine, including for references or labels in child documents. I cannot imagine how I could have broken it. But I'll recheck rev. 23405. Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: But it used to work fine, including for references or labels in child documents. I cannot imagine how I could have broken it. But I'll recheck rev. 23405. I didn't accuse you :-), maybe I broke it before committing this stuff I am simply

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: The references were not updated if the label name was changed. Then this is a bug of in InsetLabel::update() because the code for this is present in there. looks like it. But it used to work fine, including for references or labels in

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: I cannot imagine how I could have broken it. But I'll recheck rev. 23405. I didn't accuse you  :-), maybe I broke it before committing this stuff Looks like it (I just checked) I am simply saying that fixing update() might be a better idea. Sure, but I tried and

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: I cannot imagine how I could have broken it. But I'll recheck rev. 23405. I didn't accuse you :-), maybe I broke it before committing this stuff Looks like it (I just checked) I am simply saying that fixing update() might be a better

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: I think the reason is the const_iterator used in InsetLabel::update(). I guess gcc silently fail to update the InsetRef pointers because of that. So I'll switch a non const iterator and revert your fix. Please tell me if that's OK. No, does not work either. Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: I think the reason is the const_iterator used in InsetLabel::update(). I guess gcc silently fail to update the InsetRef pointers because of that. So I'll switch a non const iterator and revert your fix. Please tell me if that's OK. No, does

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: OK, I'll put back your change. Wait ... Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote: OK, I'll put back your change. Wait ... It works if you call update from outside. E.g., if you change in the cut and paste check I introduced: - lab.update(oldname, false); + lab.update(oldname, true); the refs are updated on paste (which is unwanted in this case

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Jürgen Spitzmüller wrote: OK, I'll put back your change. Wait ... It works if you call update from outside. E.g., if you change in the cut and paste check I introduced: - lab.update(oldname, false); + lab.update(oldname, true); the refs are updated on paste

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: Could you please remove it and always pass true? - void update(docstring const new_label, bool updaterefs = true); + void update(docstring const new_label, bool updaterefs); It does not even work if I remove the bool altogether. I have a similar problem with my

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: Could you please remove it and always pass true? - void update(docstring const new_label, bool updaterefs = true); + void update(docstring const new_label, bool updaterefs); It does not even work if I remove the bool altogether. I have a

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: This strikes me like the identical bug. Hum, that might just be a redraw problem... But the name is not changed indeed (as view source reveals). Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: This strikes me like the identical bug. Hum, that might just be a redraw problem... But the name is not changed indeed (as view source reveals). I am out of idea then... Abdel.

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: This strikes me like the identical bug. Hum, that might just be a redraw problem... But the name is not changed indeed (as view source reveals). Another idea: void InsetCommand::metrics(MetricsInfo mi, Dimension dim) const { if

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: Could you please remove it and always pass true? - void update(docstring const new_label, bool updaterefs = true); + void update(docstring const new_label, bool updaterefs); It does not even work if I remove the bool altogether. And if

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: It does not even work if I remove the bool altogether. And if you rename the method to say, updateCommand()? No (but I prefer that name). Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: It does not even work if I remove the bool altogether. And if you rename the method to say, updateCommand()? No (but I prefer that name). Another idea... This might be related to the way we update the dialogs. For example, I was debugging

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: Another idea... This might be related to the way we update the dialogs. Good news: it works now. Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
[EMAIL PROTECTED] wrote: Author: spitz Date: Mon Mar 3 13:22:17 2008 New Revision: 23410 URL: http://www.lyx.org/trac/changeset/23410 Log: * src/insets/InsetLabel.cpp (doDispatch): - restore call to changeRefsIfUnique. The references were not updated if the label name was changed.

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > > The references were not updated if the label name was changed. > > Then this is a bug of in InsetLabel::update() because the code for this > is present in there. looks like it. Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > But it used to work fine, including for references or labels in child > documents. I cannot imagine how I could have broken it. But I'll recheck rev. 23405. Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: But it used to work fine, including for references or labels in child documents. I cannot imagine how I could have broken it. But I'll recheck rev. 23405. I didn't accuse you :-), maybe I broke it before committing this stuff I am simply

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: The references were not updated if the label name was changed. Then this is a bug of in InsetLabel::update() because the code for this is present in there. looks like it. But it used to work fine, including for references or labels in

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > > I cannot imagine how I could have broken it. But I'll recheck rev. 23405. > > I didn't accuse you  :-), maybe I broke it before committing this stuff Looks like it (I just checked) > I am simply saying that fixing update() might be a better idea. Sure, but I tried

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: I cannot imagine how I could have broken it. But I'll recheck rev. 23405. I didn't accuse you :-), maybe I broke it before committing this stuff Looks like it (I just checked) I am simply saying that fixing update() might be a better

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > I think the reason is the const_iterator used in InsetLabel::update(). I > guess gcc silently fail to update the InsetRef pointers because of that. > So I'll switch a non const iterator and revert your fix. Please tell me > if that's OK. No, does not work either.

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: I think the reason is the const_iterator used in InsetLabel::update(). I guess gcc silently fail to update the InsetRef pointers because of that. So I'll switch a non const iterator and revert your fix. Please tell me if that's OK. No, does

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > OK, I'll put back your change. Wait ... Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Jürgen Spitzmüller wrote: > > OK, I'll put back your change. > > Wait ... It works if you call update from outside. E.g., if you change in the cut and paste check I introduced: - lab.update(oldname, false); + lab.update(oldname, true); the refs are updated on paste (which is unwanted in this

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Jürgen Spitzmüller wrote: OK, I'll put back your change. Wait ... It works if you call update from outside. E.g., if you change in the cut and paste check I introduced: - lab.update(oldname, false); + lab.update(oldname, true); the refs are updated on paste

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > Could you please remove it and always pass > true? > > - void update(docstring const & new_label, bool updaterefs = true); > + void update(docstring const & new_label, bool updaterefs); It does not even work if I remove the bool altogether. I have a similar problem

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: Could you please remove it and always pass true? - void update(docstring const & new_label, bool updaterefs = true); + void update(docstring const & new_label, bool updaterefs); It does not even work if I remove the bool altogether. I have

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > > This strikes me like the identical bug. > > Hum, that might just be a redraw problem... But the name is not changed indeed (as view source reveals). Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: This strikes me like the identical bug. Hum, that might just be a redraw problem... But the name is not changed indeed (as view source reveals). I am out of idea then... Abdel.

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: This strikes me like the identical bug. Hum, that might just be a redraw problem... But the name is not changed indeed (as view source reveals). Another idea: void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const {

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: Could you please remove it and always pass true? - void update(docstring const & new_label, bool updaterefs = true); + void update(docstring const & new_label, bool updaterefs); It does not even work if I remove the bool altogether. And if

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > > It does not even work if I remove the bool altogether. > > And if you rename the method to say, updateCommand()? No (but I prefer that name). Jürgen

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Abdelrazak Younes
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: It does not even work if I remove the bool altogether. And if you rename the method to say, updateCommand()? No (but I prefer that name). Another idea... This might be related to the way we update the dialogs. For example, I was debugging

Re: r23410 - /lyx-devel/trunk/src/insets/InsetLabel.cpp

2008-03-03 Thread Jürgen Spitzmüller
Abdelrazak Younes wrote: > Another idea... This might be related to the way we update the dialogs. Good news: it works now. Jürgen