Hi Mikhail,Thanks for your reply. I can yet understand everything about the first question, in comphelper.nofactory.patch I did use a constructor without arguments, as the 3rd argument of createSingleFactory(). But the error still occurs.
As for the createSingleFactory() function, I searched through the source of comphelper project and found all 5 matches are within facreg.cxx, function component_getFactory(), so I guess adjusting all of them does not take too much labor, may I have your opinion on this? And which function should we use if we were to replace it?
Thanks and Best Regards, Felix. Mikhail Voitenko 写道:
Hi Felix, The integration looks good.If you want to get rid of m_xFactory in the class, the createSingleFactory() still has to get the arguments that are expected, but it is not necessary to use all of these arguments. So in this case the call could get factory, but use a constructor without arguments.As for the deprecated method of integration, I would not integrate two different methods in the same library. If we want to use the new method, the whole library should be adjusted from my point of view.Best Regards, Mikhail. Zhang Xiaofei wrote:Hi Mikhail, I have integrated the registration, please check the new comphelper.patch, thanks! :-) I got troubles removing m_xFactory from SequenceOutputStreamService this time, an error occurs compiling facreg.cxx, it appears that the function, to which the 3rd parameter of createSingleFactory() points to, has to have a const uno::Reference< lang::XMultiServiceFactory > & xFactory parameter, or the compilation fails. Could you check comphelper.noFactory.patch and error.log and give me some suggestions? By the way I noticed in the C++ UNO Reference createSingleFactory() is described as a deprecated method, maybe it is better we integrate in a another way? Best Regards, Felix. Mikhail Voitenko 写道:Hi Felix, The patch looks very good, now the service should be correctly registered. Please integrate the registration of the service into comphelper/source/misc/facreg.cxx. You can search for the "SequenceInputStreamService" to see an example of the registration.As for the m_xFactory member, you are right, it is not used so it can beremoved. If it will be necessary in future, it can be easily inserted. Best Regards, Mikhail. Zhang Xiaofei wrote:Hi Mikhail,Thanks very much for your suggestions, I've modified the implementationand made 2 new patches, could you help to review them please? And I might need your help on the following question: - About The private member SequenceInputStreamService::m_xFactory, I could not find it being used in any existing member functions, I tried to remove it from the implementation and find nothing affected. Couldyou please tell me for what the purpose does was it there, reserved for future use, I suppose? Should we keep it in SequenceOutputStreamService'implementation, too? Thanks and Best Regards :-) , Felix. Mikhail Voitenko 写道:Hi Felix, The implementation looks good, except one problem you have already mentioned. You are completely right, it is not allowed to have out-parameter in the constructor. Sorry, my failure. The attachedimplementation fills the sequence correctly, but unfortunately not theoriginal sequence provided from outside. So we should design it in different way. I would suggest the following changes: - introduce a new interface XSequenceOutputStream derived fromXOutputStream, that implements an additional method, kind of "sequence< byte > getWrittenBytes() throws ( NotConnectedException, IOException )"- let the service be derived from the interface- let the service get no arguments in constructor, the sequence will bejust an internal member in the implementationThus, the user will create the service, that will fill internal sequence while being written, and then return the sequence. Before returning ofthe stream, the sequence must get the correct length, since for optimization reasons OSequenceOutputStream can let the sequence be longer during the writing. Currently it is done in OSequenceOutputStream::closeOutput(), but we do not need to close theinternal stream in case of getWrittenBytes() call. So I would suggest to fix OSequenceOutputStream::flush() so that it sets the correct size tothe sequence, and use this method in getWrittenBytes() call. As for the 'O' prefix, it is has no special meaning. There is no nameconvention regarding class names of service implementations, so it is amatter of taste. :) Best Regards, Mikhail. Zhang Xiaofei wrote:Hi Mikhail, The attachment is the patches to udkapi and comphelper projects, thecompilation to udkapi, offapi, offuh, comphelper projects all passed,and the application seems running fine after I delivered comphelp4MSC.dll explicitly to the install directory. Could you help to review them please? This time I have some questions as well:The first is about the ctor of SequenceOutputStream, I'm not sure if Igot your statement in our last IRC meeting, that the serviceconstructor should take sequence of bytes as output parameter, in theright way. At first I declared the ctor as: /_createStreamFromSequence( [out] sequence<byte> aData ); _/But then I was informed by the compiler that a parameter of a ctor may *not* be /out /or /inout, /I modified it to: /_createStreamFromSequence( [in] sequence<byte> aData ); _/then the compilation passed. However I don't know if this issemantically correct. Could you please give me some instructions here?/__/The second is about naming conventions on classes, I find sometimes aclass has an 'O' before its name, just like OSequenceOutputStream in /compehelper/inc/seqstream.hxx, and OTempFileService in our first task, too; but sometimes there isn't, like SequenceInputStream inseqstream.hxx, what does the 'O' stand for and when is it appropriateto have it?Does it has something to do with the class deriving from a typedef-ed base class, like OSequenceOutputStream_Base and OTempFileBase, I suppose?Best Regards, Felix.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]