Hi Jakob,
On 09/13/06 18:41, Jakob Lechner wrote:
Am Dienstag, den 12.09.2006, 17:53 +0200 schrieb Jakob Lechner:
Am Dienstag, den 12.09.2006, 13:56 +0200 schrieb Frank Meies:
[...]
Yes, you are right. We should pass the TextRange and the Controller to
the invokeAction methor. A better way to obtain the Controller would be
to use the GetController() method of the SwView object (which in turn
inherits it from the SfxViewShell object). This way we make sure that we
get the correct controller and do not run into any focus related issues.
Ok, I've done that and passed the controller to the uno component. I've
managed to access the whole text of the document and to modify it from within
the uno component. Now I'm trying to change the title of the document
(just as proof of concept to show what is possible in a smarttag action).
As far as I've seen this is possible with a XDocumentInfoSupplier instance.
But how is it possible to get the XDocumentInfoSupplier instance with the
controller?
I have solved the problem by myself. The controller I was passing just
provides access to the TextDocumentView service. But I actually want
to be able to access the TextDocument and not only its view.
Therefore I'm now passing a XTextDocument reference to the
invokeAction method. As far as I see all important data of a text
document can be read and/or changed using this reference.
If we only pass the XTextDocument, we cannot add support for SmartTags
in the other applications later on. The XController interface has a
function getModel() which returns a XModel interface. A "query
interface" for the XModel gives you the XTextDocument. I think we should
pass the controller to invokeAction, since it offeres more functionality
compared to the XTextDocument or the XModel.
Regards,
Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]