Hi, I forgot to mention: it only returns a non-NULL value, if a printer has been created before or if "GetPrinter" is called with the parameter bCreate=TRUE (default is FALSE).
Ciao, Mathias Mathias Bauer wrote: > Hi, > > IIRC this is a virtual method and all derived classes should return a > printer. > > Regards, > Mathias > > Zhang Xiaofei wrote: > >> Hi Mikhail, >> >> Here is the new patch for i6010, sorry I did not send it earlier, but >> again a new problem happens: the msole object doesn't print. >> After a quick debug I found it's because the current implementation of >> SfxViewShell::GetPrinter() always return a null pointer. I suppose some >> work is just undone here?( I'm still confused that the method has >> already widely used though ) >> Do you think we should implement this method or is there a workaround >> for our case? I'm looking forward to your suggestions. >> >> Thanks and Best Regards, >> Felix. >> >> >> Mikhail Voitenko >>> Hi Felix, >>> >>> I am awfully sorry for the delay with answer. I had to do some >>> investigations to find out how a replacement image could be printed. >>> >>> The implementation should be done on the container side in this case. >>> The container side has the replacement image and access to the vcl >>> implementation. So I would suggest to throw UnreachableStateException >>> from the MSOLE object in case "Print" verb is provided to doVerb() >>> call. The implementation in the sfx2/source/view/ipclient.cxx in >>> method DoVerb() should check in case of this exception whether the >>> PRINT verb is used ( it is already don for the default verb in similar >>> way ). In this case the container should try to print the replacement >>> image. >>> >>> The printing can be implemented in following way: >>> - get the container SfxViewShell using GetViewShell() call from DoVerb >>> - if the shell is not NULL use pViewShell->GetPrinter() call to get >>> the printer >>> - if the printer is not null please get the graphics from the >>> replacement image, that would need the following steps: >>> - Please get the container object shell using >>> pViewShell->GetObjectShell() >>> - if it is not NULL please call >>> pObjectShell->GetEmbeddedObjectContainer().GetGraphicStream( >>> m_pImp->m_xObject ) >>> - now the stream has to be converted to Graphic object, please see >>> the implementation in svtools/source/misc/embedhlp.cxx in method >>> EmbeddedObjectRef::GetReplacement() as example >>> - after you have Graphic object you can execute pGraphic->Draw( >>> pPrinter, Point( 0, 0 ) ) >>> >>> We can discuss further details/questions tomorrow on IRC meeting. >>> >>> As for the testing, it would be nice to test the functionality on >>> Linux, but in this case it is not really necessary I think. The >>> implementation looks generally to be platform independent, so it is >>> not necessary to spend time an prepare the linux build only for this. >>> >>> Best regards, >>> Mikhail. >>> >>> On 02/24/09 05:02, Zhang Xiaofei wrote: >>>> Hi Mikhail, >>>> >>>> Thank you for your hint, here I created a small fragmentary patch for >>>> the first step, please point out if there's obvious problems within. >>>> And I would like to hear the details regarding the image printing so >>>> that I can understand more about the related code before our next >>>> meeting, but only if your time permits , of course. :-) >>>> By the way do you think I should prepare a new linux build, please? I >>>> don't know if it is necessary for testing our new implementation and >>>> feel like need advice. >>>> >>>> Thank you and Best Regards, >>>> Felix. >>>> >>>> >>>> Mikhail Voitenko >>>>> Hi Felix, >>>>> >>>>> On 02/20/09 09:50, Zhang Xiaofei wrote: >>>>>> Hi Mikhail, >>>>>> >>>>>> Sorry but I searched the usage of GetVerbByShortcut() and couldn't >>>>>> find an example, I may need your hint on this little question >>>>>> regarding the first step: what exactly is the ShortCut of a Verb >>>>>> please? Is it in our case, "PRINT"? >>>>> >>>>> Yes exactly, it is "PRINT" in this case. This is the shortcut that >>>>> is used as the node name in the configuration. The method gets the >>>>> information from the configuration and fills the verb description. >>>>> You can find the implementation and the usage of the method in the >>>>> comphelper/source/misc/mimeconfighelper.cxx >>>>> >>>>> Best regards, >>>>> Mikhail. >>>>> >>>>>> >>>>>> Best Regards, >>>>>> Felix. >>>>>> >>>>>> >>>>>> Mikhail Voitenko >>>>>>> Hi Felix, >>>>>>> >>>>>>> Thanks a lot for the patch, it looks good. >>>>>>> >>>>>>> Now the MSOLE implementation should be adjusted as we have discussed. >>>>>>> The first step would be to let the getSupportedVerbs() >>>>>>> implementation return the print verb. MSOLE objects are a special >>>>>>> case, the verbs are either requested from the external server ( in >>>>>>> case it is Windows system with installed server related to the >>>>>>> object ), or just empty in case of Unix systems. The new >>>>>>> implementation should add the print verb for both cases. To get >>>>>>> the PRINT verb value from configuration please use >>>>>>> "::comphelper::MimeConfigurationHelper::GetVerbByShortcut()" method. >>>>>>> >>>>>>> The next step will be to implement the verb itself. In case >>>>>>> getPreferredVisualRepresentation() can retrieve the replacement >>>>>>> image the image could be printed by the object itself. Sometimes >>>>>>> it might work even on Unix systems in case the image is stored in >>>>>>> the object stream. Otherwise it should be printed in the >>>>>>> container. I will send the details regarding the image printing >>>>>>> tomorrow. >>>>>>> >>>>>>> Best Regards, >>>>>>> Mikhail. >>>>>>> >>>>>>> On 02/19/09 10:14, Zhang Xiaofei wrote: >>>>>>>> Hi Mikhail, >>>>>>>> >>>>>>>> I'm sorry our network broke down after our meeting yesterday. >>>>>>>> With this patch the temporary frame is hidden when document is >>>>>>>> printed now. Would you please review it for me? >>>>>>>> Thank you for your help. :-) >>>>>>>> >>>>>>>> Best Regards, >>>>>>>> Felix. >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>> >>> >>> >> >> >> ------------------------------------------------------------------------ >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org >> For additional commands, e-mail: dev-h...@framework.openoffice.org > > -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "nospamfor...@gmx.de". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org For additional commands, e-mail: dev-h...@framework.openoffice.org