|
| | PstLstReferenceConverter (IPMUnknown *boss) |
| |
| virtual | ~PstLstReferenceConverter () |
| |
| virtual bool16 | CanConvert (ClassID clsID) |
| |
| virtual UID | ConvertReference (IDataBase *sourceDB, UID convertThis, IDataBase *targetDB, IPMUnknown *pmobject) |
| |
| virtual bool16 | ConvertAlways (void) const |
| |
| virtual UID | GetReference (IDataBase *sourceDB, UID convertThis, IDataBase *targetDB) const |
| |
| | CReferenceConverter (IPMUnknown *boss) |
| |
| virtual bool16 | IsMappingReference (IDataBase *, UID, IDataBase *) const |
| |
| virtual UID | MapReference (IDataBase *, UID, IDataBase *, IPMUnknown *) |
| |
| virtual UID | GetMappedReference (IDataBase *, UID, IDataBase *) |
| |
| IPMUnknown * | QueryInterface (PMIID interfaceID) const |
| |
| void | AddRef () const |
| |
| void | Release () const |
| |
| void | PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue) |
| |
| void | PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue) |
| |
| | CPMUnknown (const CPMUnknown &)=delete |
| |
| CPMUnknown & | operator= (const CPMUnknown &)=delete |
| |
Implements a reference converter, IReferenceConverter, that controls how objects of ClassID kPstLstDataBoss get copied.
For example, say a page item has two associated kPstLstDataBoss objects with UID's UID1, UID2 and the selected object is UID2 (see interface IPstLstUIDList). When this page item is copied a new page item is created and distinct copies of the kPstLstDataBoss objects are made. The new page item's associated kPstLstDataBoss objects are UID1', UID2' and the selected object is UID2'. UID1' contains a copy of the data held by the object UID1. UID2' contains a copy of the data held by the object UID2.
When the copy happens, a persistent implementation's ReadWrite function gets called to write itself out into the copy stream. When the ReadWrite function calls IPMStream::XferReference on the UID, the copy stream tries to copy the UID. First it checks to see if the UID has already been copied previously in the copy session(see IXReferenceUID). If it hasn't, then it looks for a reference converter which can copy the UID for it. If it finds a reference converter, it calls it to make a copy of the UID. The reference converter returns the UID of the copy. If there is no reference converter, then the copy stream just returns kInvalidUID. When the ReadWrite function calls IPMStream::XferObject the same process is run through with the additional final step of simply streaming the data for the object via ReadWrite if no reference converter is available.
If a reference converter is not provided for a persistent boss class then calls to IPMStream::XferReference for UID's of that ClassID return kInvalidUID (as was the case before this reference converter was added to this plug-in). When PstLstUIDList::ReadWrite was called during copy operations its data member (fSelectedUID) was copied with a value of kInvalidUID. PstLstUIDList::ReadWrite was updating fSelectedUID when this happened and calling Dirty to mask this problem. The ReadWrite method of a persistent implementation should never call Dirty. Adding the reference converter maintains fSelectedUID across the copy to be the UID of the selected kPstLstDataBoss object, see PstLstUIDList::ReadWrite. This removed the need to dirty the object during ReadWrite.