Hi Mathias,

it would be nice if we could print the replacement image, unfortunately it does not work with chart objects, the replacement images of the chart object are not scalable. So this solution has to be implemented at least for chart. And since it should work for other objects, why not to use the existing solution for them as well.

I would say that this is a bug, if an embedded object sends parts of the document to the printer that are different from the parts used to generate the replacement image. If we have such a behavior we will have to fix it.

You are right, the OLE objects could print own replacement image, we can implement this as the next step.

Best regards,
Mikhail.

On 12/09/08 08:19, Mathias Bauer wrote:
Hi Mikhail an Felix,

while reading this I got another idea: in case we have a replacement
image, why not printing this one instead of the document? If the whole
container document is printed it will also print the replacement images
of its OLE objects.

This can be implemented for COM objects also, BTW. But it doesn't work
for linked objects, of course. But in case of these objects we perhaps
shouldn't offer printing them directly. Or should we?

For our own objects printing the replacement imaghe can help to solve
another problem: the embedded document might contain more than just what
is visible in the visible area. By printing the replacement image we can
make sure that we print only what the user sees as embedded.

Regards,
Mathias

Mikhail Voitenko wrote:

Hi Felix,

The proposed change looks good from the first view. One small change is still necessary, the verb id -6 is already reserved. Please see my comments inline.

On 12/05/08 09:11, Zhang Xiaofei wrote:
Hi Mikhail,

Here I created a patch which adds a new verb to /officecfg/registry/data/org/openoffice/Office/Embedding.xcu. I looked up through the website and found the struct com.sun.star.embed.VerbDescriptor. So I set the value of VerbAttributes to 2 which means MS_VERBATTR_ONCONTAINERMENU according to the IDL referrence. Could you tell me if I did it right or should MS_VERBATTR_NEVERDIRTIES be set in this case, too? (because the object should not be changed when being printed as I understand)
It is ok to use MS_VERBATTR_ONCONTAINERMENU only. I also would not add MS_VERBATTR_NEVERDIRTIES here, since it is better to let the application decide whether it is changed. Although in general the document should not be changed, there is already an issue to store the metadata along with embedded objects, and metadata contains last printed date.

And I left the comment field empty because I can't be sure if the translation of the VerbUIName here will be "copied from sfx2 project" as well as the PROPERTIES and SAVECOPYAS verbs. It will be filled when I have your suggestions.
In this case it is a new verb, so there is no existing translation in sfx2 for this. You can just leave a comment for translation that this verb will let the object be printed.

As the next step please add the verb to the embedded objects based on own applications, you can recognize them by ObjectDocumentServiceName value ( com.sun.star.sheet.SpreadsheetDocument, com.sun.star.chart2.ChartDocument, com.sun.star.drawing.DrawingDocument, com.sun.star.presentation.PresentationDocument, com.sun.star.formula.FormulaProperties, com.sun.star.text.TextDocument ). After that change the string should appear in the menu of the embedded objects, now the object printing should be implemented.

The verb id should be registered in offapi/com/sun/star/embed/EmbedVerbs.idl, -6 had been already reserved there, -7 still looks to be free, please do not forget to changed the id in the xcu file.

The implementation for the action should be done in embeddedobj/source/commonembedding/embedobj.cxx in function OCommonEmbeddedObject::doVerb(). This verb will have no related state, although it needs the object to be at least in running state. Thus the implementation should be done in the block that checks whether the nNewState is equal -1. In this case the implementation should switch the object to the running state if it is the print verb, get XPrintable from the model and call XPrintable::print() method.

Best regards,
Mikhail.

Best Regards,
Felix.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to