Hi Felix, The files look good from the first view. There are small problems: - in the attributes implementation getUri() method should use mpTempFile->GetURL() and getResourceName() method should use mpTempFile->GetFileName() as it is done for the related properties in the old implementation; - XTempFile_createInstance should create an instance of OTempFileService object;
Additionally, OTempFileBase could be used as the direct base of the OTempFileService. That would probably improve a little bit readability of the code. The reimplementation is close to be ready ( if I do not forget anything ), so you probably can start to build the service and try to let the office run using the new implementation :) Please see the answers for your questions below. Zhang Xiaofei wrote: > Hi Mikhail, > > Thanks to your instructions in our last IRC meeting, I have adjusted the > declaration of the interface and worked out most of the implementations. > All the related files are attached to this mail, please give a > inspection to them and some advice to me. :-) > > Just as usual, I have some questions today. > 1. Is the XTempFile::GetProps() method to be disposed in the new > implementation as well? > Yes, this function is not needed any more. > 2. As I can recall, you have mentioned the compatibility thing before, > do we need to do additional implementations or the PropertySetMixin > class takes care of it itself? > Exactly, the PropertySetMixin should provide the XPropertySet access based on the attributes implementation. > 3. Could you give me some further explanation why > IllegalArgumentException is thrown in the old, but not thrown in the new > implementation? > I assume you mean the setRemoveFile() method. In the old implementation the setting of the related property could trigger IllegalArgumentException because XPropertySet::setPropertyValue() takes uno::Any as the new value, so it is possible to provide a wrong argument. After the property is replaced by the attribute, the setRemoveFile() method is used, and here the type-check happens on compilation time. > 4. I see lots of the methods use mutex. However they don't use the same > one. While most of them use maMutex, the getTypes() method which > inherits from XTypeProvider, as you taught me in a previous mail, uses > m_pData->m_rSharedMutexRef->GetMutex(). To make it more confusing, the > GetProps() method in the old implementation uses > ::osl::Mutex::getGlobalMutex(). Could you give me some hints here? > Of course the getTypes() method should use ::osl::Mutex::getGlobalMutex() as well. Sorry for the typo, it is a copy-paste problem. The method getTypes() initializes a static variable, so the object-related maMutex is not enough, the method should be guarded using the global one. Best Regards, Mikhail. > Thanks and Best Regards, > Felix > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]