Abdelrazak Younes wrote:
> Georg Baum wrote:
>> Abdelrazak Younes wrote:
>>
>>> Index: frontends/LyXView.C
>>> ===================================================================
>>> --- frontends/LyXView.C (revision 14813)
>>> +++ frontends/LyXView.C (working copy)
>>> @@ -139,22 +139,19 @@
>>>
>>> work_area_->bufferView().setBuffer(b);
>>>
>>> - if (work_area_->bufferView().buffer())
>>> - {
>>> + if (work_area_->bufferView().buffer()) {
>>> // Buffer-dependent dialogs should be updated or
>>> // hidden. This should go here because some dialogs (eg
>> ToC)
>>> // require bv_->text.
>>> getDialogs().updateBufferDependent(true);
>>> + connectBuffer(*work_area_->bufferView().buffer());
>>> + setLayout(work_area_->bufferView().firstLayout());
>>> }
>>>
>>> updateMenubar();
>>> updateToolbars();
>>> updateLayoutChoice();
>>> updateWindowTitle();
>>> - if (b) {
>>> - connectBuffer(*b);
>>> - setLayout(work_area_->bufferView().firstLayout());
>>> - }
>>> redrawWorkArea();
>>> }
>>
>> This looks wrong (the rest looks OK). Do you know that b !=
>> work_area_->bufferView().buffer() is possible even after a
>> work_area_->bufferView().setBuffer(b)?
>
> This was indeed the case before my patch but look also at my
> BufferView_pimp change.
They do only change the behaviour if quitting == true. b !=
work_area_->bufferView().buffer() is still possible. BTW, it would be nice
if you could do your diffs with function names (-p argument of diff).
> I've tested this patch with a lot of buffer switching and deletion.
It may work, but I still think that the logic above is wrong. You are going
to call connectBuffer and setLayout with an already connected buffer when b
== 0. That may do no harm, but is AFAIK not necessary, and makes the code
harder to understand.
Georg