https://bugs.documentfoundation.org/show_bug.cgi?id=96896

--- Comment #11 from [email protected] ---
Hi castanheira,

First of all thanks for your explanation of the bug. It was really helpful.
I have been studying the gdb stack-traces, trying to understand the cause of
the bug. I have made a few observations. These observations relate less to the
original title of the bug but are more related to your cases.
Tested on ubuntu 5.2 dev build
1. Case 1,3: it doesn't matter if we switch to read only mode or not. When
switching to print preview mode and back the title changes from :2 to :3 .

2. These cases can be created in linux build as well. Also it is not restricted
to only writer but also calc. All other modules don't have a print preview
option.Therefore this a bug in all platforms across multiple modules.

3. The creation of title seems to be highly recursive procedure. I was counting
8 to 9 levels of recursion for each title change. The title is built in three
parts. The frame,controller and model title are concatenated. The problem in
setting the title from the api is that the function setting the title for the
title returns without setting the title string if an external title is present.
The api is most likely changing only the model part of the title. 'read-only'
is added in the model title but if the modeltitle is set from outside then the
model part of the title string is not set internally. I am unable to recreate
this part in ubuntu and I am unable to build on windows. Can you please confirm
one thing for me? In case 2 after step 4 are you actually able to edit the doc
or the read-only in not present in the title but the document is in read-only
mode?

4. The problem of wrong numbers occurs due to the fact that when a component is
detached from the frame(frameAction_COMPONENT_DETACHED) event, it never
releases its lease number. Even though the controller and the window for the
component are disposed, the disposing function in titlehelper is never called.
In fact the title for a detaching component is generated even though it will
never be used. I don't understand why this is happening.

5. When a new component reattaches to the
frame(frameAction_COMPONENT_REATTACHED) the lease number goes up. But this
would mean that continuously switching between print preview and default mode
should increase the number. Again this is not the case even though there is no
release of the leased number. I am unable to figure out why this is happening
even though the XUntitledNumbers function leaseNumber is being called by the
same XNumber object everytime. Can any dev help me on this?
But according to me this last statement is not critical to solving the bug.

To solve the bug, I think that when detaching a component its lease number
should be released and there is no need to regenerate its title i.e. in the
class framework::TitleHelper::frameAction frameAction_COMPONENT_DETACHING
should be handled separately. I seek advice on how to handle this case
separately. Should the leasedNumber be released in a separate function? Because
the current disposing function in the titlehelper only works on a dispose event
and dispose event is not created when a component is
detached.(framework/source/services/frame.cxx).
A couple of more questions:
1. Is a mutex lock automatically released when is goes out of scope without
clearing the lock?
2. Can anyone point me to some documentation of the model-control-frame model
of application. I am currently refering to this:
https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Frame-Controller-Model_Paradigm_in_OpenOffice.org

Also... the original bug can't be solved by using
if (!init) // avoid recursion.
    sTitle.append      (xModelTitle->getTitle ());
This will break the title because in a component reattachment event
impl_updateTitleForController is called with a true value. This is because in a
reattachment the controller and window are new so the controller title is never
set before.If we only set the title when init is false then on changing views
the controller part of the title will disappear(tested on ubuntu).
This bug ,acc to me, is happening due to the fact that a controller title
includes a model title. In impl_updateTitleForController there is a call to
getTitle for the model. But somehow in the impl_updateTitle function the
component is being always identified as a controller. Thus the recursion.
My understanding of some parts may be wrong. Please correct anything you feel
is not right so I can better understand the problem.
Regards.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to