To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=115510





------- Additional comments from m...@openoffice.org Fri Nov 12 12:25:17 +0000 
2010 -------
At the end no SwClientIter instances should be created anymore (except in
SwModify to notify all clients) and SwClients shoulnd't be used for anything
except receiving notifications from their SwModify.

As changing this will be a long journey, an iterative aproach was chosen. In a
first step the classes SwClient and SwModify got a rework so that some members
of them no longer are exposed to the outside world. In case this created
problems in other code that can't be solved without larger rework, new methods
(with names that make it easier to find where they are used) have been created
that access these members. The following steps have been applied:

(1) The method 

    virtual void Modify( SfxPoolItem*, SfxPoolItem* )

and all overwritten methods in derived classes have been made protected. In a
clean design this method is called only from an SfxModify object when it wants
to notify its clients. SwModify is "friend" to SwClient so it doesn't need a
public method for that. 

This breaks code in several places. Where reworking wasn't easy, a new method
"ModifyNotification" that internally calls "Modify" was added to SwClient. These
places can be fixed later.

Notifying all SwClients from an SwModify can be done now by calling the
"ModifyBroadcast" method in SwModify. It still allows to pass a TypeId parameter
(defaulting to TYPE(SwClient), this will be fixed later: it's up to the clients
to decide whether they want to react on a particular notification. This will
require more information provided in the "Modify" call.

(2) The parameters of these methods have been changed to const SfxPoolItem*.
This caused several code adaptions, but no problems

(3) The SwModify& in SwClienIter was changed to const&. This allowed to remove a
lot of former const_casts

(3) All inheritance from SwClient was changed to "private". An object shouldn't
tell the outside world that it is listening to someone. 

This created problems: 

static_casts from SwClients don't work anymore. So for the time being they have
been replaced by PTR_CASTs that still work. That will be fixed in later rework. 

some code needed access to the SwClient of an SwModify; this has been
workarounded by adding the method "SwModify::GetClientBase()". These places can
be fixed later

TYPEINFO didn't work for classes derived from SwModify, as this class didn't
have own TYPEINFO and access to SwClient was forbidden; this was fixed by adding
TYPEINFO to SwModify

some code neede access to the SwModify of an SwClient, so the GetRegisteredIn()
method SwClient was forwarded from all classes derived from SwClient where this
was required. A new method GetRegisteredInNonConst() was provided (and treated
the same way) to replace the former protected pRegisteredIn member in SwClient.
This will be fixed later

(4) Moved some members and their access methods from SwClient to SwModify that
never have been used in class SwClient; this revealed a bug where code called
LockModify() was called on an SwDepend, but SwClient::bModifyLocked was only
used in SwModify objects, not in any other class derived from SwClient.

(5) SwTOXBase did not have own TYPEINFO, but was used in TYPE(...) macros

(6) The watch client hack in SwClient was replaced by a local solution



---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@sw.openoffice.org
For additional commands, e-mail: issues-h...@sw.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to