Re: [api-dev] XField vs XField2: a question ?
Hi Rony, Rony G. Flatscher wrote: Hi there, while working a little bit with the reflection interface I have been stumbling over the following: com.sun.star.reflection.XField is deprecated in favor of com.sun.star.reflection.XField2. All signatures are the same except for set(), where the first argument changed from [in] to [inout]. You can see XField2 as version 2 of this interface. We haven't a mechanism of versioning for interface which is of course bad but it depends on technical reasons (we can't support two versions of an Java interface in the same VM for example) Now, if I am only interested in the method getType(), returning an XIdlClass, am I really supposed to query explicitly for the XField2 interface? Or with other words: would it be o.k. to use the returned XField as long as one is not using the set()-method? It will probably work all the time but the correct way would be to use XField2. Juergen TIA, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XField vs XField2: a question ?
while working a little bit with the reflection interface I have been stumbling over the following: com.sun.star.reflection.XField is deprecated in favor of com.sun.star.reflection.XField2. All signatures are the same except for set(), where the first argument changed from [in] to [inout]. XField::set() has been specified wrong: set() changes the object parameter, e.g. a STRUCT field, thus it has to be [inout]. For a long time, this bug hasn't been discovered, because when calling from pure C++, modifying the Any's internal STRUCT works, although it violates Any's const-ness (passed as Any const). But this hurts concerning bridging to different languages: [in] parameters aren't written back, so the modification gets lost. Thus use reflection.XField2 to be on the safe side, though XField still works (except for its set()). hope this clarifies, -Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Deprecated getInterfaces() in XIdlClass ?
Hi Rony, Rony G. Flatscher wrote: Hi there, it seems that the official way of getting all the interfaces there are is only available via an object which possesses the XTypeProvider interface. Does this mean that one could not infer from an UNO class object which interfaces it supplies, but would really need an instance of such a class? that is right, most of the objects you get over the API are implemented in C++ and you got an proxy object in Java only. So you don't know the class object before you have a real instance of the object. The objects are created dynamically. Looking at XIdlClass there is a method getInterfaces(), which would be *exactly* what I would be looking for. Except, it is deprecated and one is urged not to call it. (How dangerous would it be, if one still would employ this method?) Is there any other way to get at all interfaces of a XIdlClass via reflection, without the need to create an instance of it? no Juergen TIA, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Interface classes: assumptions correct?
Hi Rony, Rony G. Flatscher wrote: Hi there, are the following few assumptions correct? * Interface class names in UNO always start with a capital X only. yes * Interface classes must not have fields (they consist of methods only). no, the was the recommendation in the past but with the new UNO ease of use features we will make heavily use of attributes in interfaces and this attrbitues are comparable with properties of old style services. And of course multiple inheritance interfaces can be compared with old style services too. New style services have only a 1:1 relation to one interface (noramlly a multiple inheritance interface). This new style services have a generated constructor and can be create in a special context. That means in the gloabl context (global service manager) or in the context of an application (e.g. writer factory). You will see more new style services in the future. Juergen TIA, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Insert embedded graphic by breaking the image link
Hi all, I would like to insert embedded graphics into Writer. By using the API, I could successfully insert graphics which are linked to image files. I realize that there is a Link menu under the Edit menu which displays a dialog box and allow the removal of links. I suppose this option fits my need perfectly and I started finding ways to achieve what the Links dialog box does. I tried record my actions as macro, the following code display the Edit Links dialog box. But I do not want to have user intervention during the link removal process, so I tried finding other ways... dispatcher.executeDispatch(document, .uno:LinkDialog, , 0, Array()) Then, I found the interface XLinkageSupport, which I thought it might be helpful as it offers the breakLink() method. However, I could not figure out what objects should be used for querying the XLinkageSupport interface. I have tried querying both the text document (XTextDocument) and the graphic (XTextContent) but both return null. Is there any possibility to do what I am attempting to do? If XLinkageSupport does work for my need, could anyone please explain briefly how to use the XLinkageSupport interface? Thanks for any help in advance! Best Regards, MuiFull PS. I browsed through the forum and knew that embedded graphics could be created through the use of dispatch interface, but this is not the best solution for my case. This is because I need to have an accurate positioning for graphics, and by using dispatch, I need to obtain references of the created graphics in further, and to do the positioning through normal API. Performance issue is then a big concern... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Difficulties to understand Javamaker error
Hi Cedric, [EMAIL PROTECTED] wrote: Hi all, I had an javamaker error that I didn't understood: Cannot create temporary file for a file that should be generated I got this by running the SDK 1.9.113 javamaker on a Linux Debian system (I checked the permissions and quotas: it is OK) and my JDK is the 1.5.0_4 from Sun Could anyone give me a way to solve my problem ? please send me your rdb file and the exact command line call that i can take a closer look on it. Juergen Thank you for your help, Cedric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Deprecated getInterfaces() in XIdlClass ?
Hi Rony, what I did to solve a similar problem: I am using the service /singletons/com.sun.star.reflection.theTypeDescriptionManager instantiated by using interface: com.sun.star.uno.XComponentContext, method: getValueByName From that I can query the interface: XTypeDescriptionEnumerationAccess with method createTypeDescriptionEnumeration I can get a list of type descriptions (using the parameter types of that method I can limit that to interfaces) and can get all interfaces of a module using method nextTypeDescription I get an interface XTypeDescription with methods getName and getTypeClass Having the name of the interface I can use interface: com.sun.star.reflection.XInterfaceTypeDescription with method getMembers I get a sequences of XInterfaceMemberTypeDescriptions with method getMemberName i can get the name of the property/attribute or method Having the interface name and the method name I use interface: com.sun.star.reflection.XIdlReflection method: forName to get an interface XIdlClass and using getMethod I get a XIdlMethod interface for the rest (getParameters, getReturnType. etc.) Hope that helps, Arnulf Am Mittwoch, 3. August 2005 15:11 schrieb Rony G. Flatscher: Hi Jürgen, it seems that the official way of getting all the interfaces there are is only available via an object which possesses the XTypeProvider interface. Does this mean that one could not infer from an UNO class object which interfaces it supplies, but would really need an instance of such a class? that is right, most of the objects you get over the API are implemented in C++ and you got an proxy object in Java only. So you don't know the class object before you have a real instance of the object. The objects are created dynamically. But if I have an instance of XIdlClass, wouldn't reflection be able to arrive at the corresponding class and inspect (reflect | introspect) it such, that the UNOIDL defined interfaces and services could be determined by it (thought, that the deprecated method getInterfaces() of XIdlClass did do that) ? E.g. if using XIdlClass xidl=XIdlReflection.forName(com.sun.star.frame.Desktop); then the class to inspect is (should be) known? The same would be true with using an object to get at its type (class) as well: XIdlClass xidl=XIdlReflection.getType(someObject); XIdlClass.getName() would in both cases return the fully qualified class name as a string, hence XIdlClass *should* know at least the name of the reflected class and hence be able to inspect it and come up with these important infos. How dangerous would it be to still use the deprecated method getInterfaces(), really? Maybe I should ask: what would be the real difference between this deprecated XIdlClass method and using the XTypeProvider interface for an object, if looking at the resulting sequence of Interface types? --- The motivation: I would like to analyze a UNO class via Java without the mandatory need to instantiate such a class upfront. At the moment I can only come by using a lazy inspection scheme, but that has the consequence that it is not possible to present all of the methods and fields of a given class in all cases, because the methods and fields of interfaces/services cannot be figured out at runtime as long as such a class did not get instantiated. (This seems to restrict the reflectability quite considerably.) --- I would like to thank you, Daniel and -mjayant for your kind help! Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Insert embedded graphic by breaking the image link
HI Stephan, I tried with your solution and it worked perfectly. :) Thanks for taking time! I will try also the solution from Christian and compare which one performs better. Thanks again for your help! Best Regards, MuiFull Stephan Wunderlich wrote: Hi MuiFull, I couldn't find any UNO-Interfaces that help to insert unlinked graphics, but the dispatch-API seems to do the job, so something like after looking some more I found some UNO-API calls that will at least work in OOo2.0 Sub Main oDoc = thiscomponent xShape = oDoc.createInstance(com.sun.star.drawing.GraphicObjectShape) xTextContent = oDoc.createInstance(com.sun.star.text.GraphicObject) oDoc.getDrawPage.add(xShape) GraphicProvider = createUnoService(com.sun.star.graphic.GraphicProvider) dim mediaprops(0) as new com.sun.star.beans.PropertyValue mediaprops(0).Name=URL mediaprops(0).Value=file:///YOURPATH/YOURFILE xGraphic = GraphicProvider.queryGraphic(mediaprops()) xShape.Graphic = xGraphic xTextContent.graphicurl = xShape.graphicurl xText= thiscomponent.getText() xTextCursor = xText.createTextCursor() xText.insertTextContent(xTextCursor, xTextContent, false) oDoc.getDrawPage.remove(xShape) End Sub - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Deprecated getInterfaces() in XIdlClass ?
Hi Arnulf, thank you very much for your valuable hint! Will try to apply it... Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Browsing the source code
Hi All, Below is a note from the Developers guide(http://api.openoffice.org/docs/DevelopersGuide/DevelopersGuide.pdf) Pg 327 Chapter 5 Design patterns and coding recommendations for OpenOffice.org. Possible candidates are: Singleton: global service Singleton: global service manager, Desktop, UCB Factory: decouple specification and implementation, cross-environment instantiation, contextspecific instances Listener: eliminate polling Element access: it is arguable if that is a design pattern or just an API Properties: solves remote batch access, but incurs the problem of compile-time type indifference UCB commands: universal dispatching of content specific operations Dispatch commands: universal dispatching of object specific operations, chain of responsibility I assume they are not being used now currently and so labelled as recommendations. Can anybody please guide me. I would appreciate any help. Sincerely Senthil From: Senthilkumar Mehalingam [EMAIL PROTECTED] Reply-To: dev@api.openoffice.org To: dev@api.openoffice.org CC: [EMAIL PROTECTED] Subject: Re: [api-dev] Browsing the source code Date: Tue, 02 Aug 2005 20:33:58 -0400 Hi All, Thanks Andrew for your reply. I found the file fecopy.cxx in the directory you suggested. That has the copy function implemented. But as the documentation is in a language other than English so I could not understand it. Is it possible to convert the source file to an English file. I looked up the web but could not find any appropriate help. Also I found while searching through the source a file called AccessibleEditableTextPara.cxx in svx/ source/accessibility/ which had the copy,paste,cut functions implemented. What you have told is correct that each references(each component of OO.org like Draw,Impress and so on) have their own implementation. I would appreciate any help. Sincerely Senthil From: Andrew Douglas Pitonyak [EMAIL PROTECTED] Reply-To: dev@api.openoffice.org To: dev@api.openoffice.org Subject: Re: [api-dev] Browsing the source code Date: Tue, 02 Aug 2005 00:38:18 -0400 The real problem is finding the specific code that you want. For example, I decided to look at the Writer specific code so I looked here: sw/source/core/frmedt and I searched for the word Clipboard. Probably NOT what you want. I also some stuff off of the core directories. In fact, I saw many many references. I expect that each portion will have its own handling code. Senthilkumar Mehalingam wrote: Hi All, Thanks Andrew for your reply. I did as you told but I cannot find the functions(cut,paste,undo,redo) inspite of a thorugh search as searching for cut finds .cpp files which have cut as a middle word in them and searching for cut finds no .cpp files. I got the source from http://openoffice.mirror.wrpn.net/stable/1.1.4/OOo_1.1.4_source.tar.gz and am not sure if I did get the right version or I needed to get the most recent one from the CVS Server. The unzipped version had 116 cpp source files. Are the functions implemented in some other files having a different extension or am I making a mistake. I would appreciate any help. Sincerely Senthil From: Andrew Douglas Pitonyak [EMAIL PROTECTED] Reply-To: dev@api.openoffice.org To: dev@api.openoffice.org Subject: Re: [api-dev] Browsing the source code Date: Wed, 27 Jul 2005 22:02:58 -0400 I typically download the source code and then I use a text search on the whole thing. Of course, the whole thing is more than 1GB I think, so on my computer, this can take a long time. Especially since sometimes I search for the wrong thing :-( Senthilkumar Mehalingam wrote: Hi All, I want to see how the cut,paste,undo,redo functionalities are implemented in OO.org. If anybody could point me to the specific files and modules in which they are implemented I would highly appreciate that. I want to know if Design Patterns are used in implementing them or not. If not I would like to try to implement it. I would appreciate any help and advice. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info:
Re: [api-dev] Ad XInterfaceMemberTypeDescription (Re: [api-dev] Deprecated getInterfaces() in XIdlClass ?
Hi Arnulf, if you use the stuff I described in my last email, having the XInterfaceTypeDescription you can directly query for the XInterfaceMemberTypeDescription. Calling method getMembers you get a sequence of objects. With these objects you can queryInterface for XInterfaceAttributeTypeDescription or XInterfaceMethodTypeDescription. If I remember correctly, you get an empty response if the object is not of the appropriate type (attribute or method), Thank you very much! This is really what I would be after, because then one can infer from the type information what fields are really there and has not to infer from set/get methods (which could mean that one guesses wrong, sometimes). Can't give you a direct example, because the work I am doing is in C++/tcluno. Just curious: are you workint on a TcL-UNO-interface, which could be exploited outside of Windows (the present support is via ActiveX, Windows-only, I understand)? To check if it is a method or an attribute you can use com.sun.star.beans.XIntrospection method inspect on the object you get back from the getMembers call and afterwards use com.sun.star.beans.XIntrospectionAccess method hasMethod on the object returned from the inspect call to check if that is a method or an attribute. Be carefull, do not use hasProperty (for check if it is an attribute) at first try, because I have found out that methods are sometimes also identified as attributes but not the other way around. Well, for my purpose XIntrospection would suffice, but somehow (have not been able to really trace this down and hence have not been able to come up with a stable nutshell-example so others can get that effect as well) in my configuration the Java based Introspection under OOo 1.1.4 and 1.9.x will become unoperational (cannot instantiate the Introspection class anymore) eventually. The only remedy so far has been to de-install OOo, run a few different registry cleaners and reboot. Something, which doesn't bode very well (but again: I have not been able to come up with a nutshell example for this behaviour). So what I am doing now is creating a Java class on my own which should contain all the definitions of a UNO class, which are needed at runtime to figure out which field, method of an interface/service contained in a class could be meant by a macro coder; very much like Star Basic or the native Python implementation do. For that class I try to circumvent the Java XIntrospection, because I *think* (I do *not* *know*) , better: I speculate, that that may be be causing troubles. If not, I will get hit anyway and then I hope to be able to come up with a Java-only testcase in a nutshell to demo the behaviour. Again, thank you and Jürgen very much for your helpful suggestions! Regards, ---rony P.S.: Once I come up with a running version of that particular class, I will post it here, so others could take a look at it and maybe evene advantage of it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Ad XInterfaceMemberTypeDescription (Re: [api-dev] Deprecated getInterfaces() in XIdlClass ?
Hi Arnulf, Arnulf Wiedemann wrote: Yes, I have written a tcluno library which can drive ooo from TCL using as the underlaying base the ooo C++ UNO interface. That is at the moment only running on Linux, but I hope with the help of Christian Junker, we have that running soon on Windows and Mac too. Second I am working on a urp like bridge, which has no need of any ooo library on the client side (it is using a plain ascii text interface). On the server side there are some additional files and some modified files in the bridges/remote/urp directory of ooo. That part is not yet stable at all at the moment. If you are interested, please let me know. Yes, definitely, I have a friend who might be interested in this (Gustaf Neumann, XOTcl). This may be also interesting from the perspective of matching the OOo OO model ;) with an OO version of Tcl. Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] /singletons/com.sun.star.reflection.theTypeDescriptionManager available in which context ?
Hello Rony G., theTypeDescriptionManager=(XMultiComponentFactory) UnoRuntime.queryInterface( XMultiComponentFactory.class, xcc.getValueByName(/singletons/com.sun.star.reflection.theTypeDescriptionManager)); I assume a copy-paste bug in your code: the type description manager object does not implement XMultiComponentFactory, it implements e.g. com.sun.star.container.XHierarchicalNameAccess. -Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Re: [dev] Style change listener for calc.
Hi Eike, I am using calc component in one of my projects. And I specifically need this. XEventBroadcaster is broadcasting something is modified but I am not able to get the change information. Thanks, Dinesh Eike Rathke wrote: Hi Dinesh, On Thu, Aug 04, 2005 at 23:05:07 +0530, Dinesh Varadharajan wrote: Hi, I want to get the notification whenever the user changes the style information in calc.(like making the text bold or italic). The modifylistener fires whenever the user changes the content of the cell but not when the user changes the style information of the cell.. Is there anyother listener which helps me achieve this.. Thanks, Dinesh We don't have that. What would you use it for? Eike
Re: [api-dev] Almost there? (Re: [api-dev] /singletons/com.sun.star.reflection.theTypeDescriptionManager available in which context ?
Hi Jürgen, * a) use theTypeDescriptionManager.getByHierarchicalName( strClassName ); e.g. receiving an exception com.sun.star.container.NoSuchElementException: com.sun.star.comp.helper.Bootstrap, if using com.sun.star.comp.helper.Bootstrap as the class name. com.sun.star.comp.helper.Bootstrap is an Java UNO helper class and is not available over the type description manager (tdmgr). The tdmgr supports only IDL types. And you should take into account that the normal type library of an office installation doesn't contain type info for old style service types. Oh, wasn't aware of that, just tested with other classes, and it works, thank you very much! * b) using XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() yields always an empty XTypeDescriptionEnumeration. mmh, that is maybe a bug but i am not sure and have to take a closer look into the code. Hoping it is not a bug, but something I am doing wrong. (But if a bug, maybe there is a workaround?) Did try it to no avail with: strClass=com.sun.star.comp.helper.Bootstrap; strClass=com.sun.star.reflection.XTypeDescription; strClass=com.sun.star.uno.XInterface; strClass=com.sun.star.frame.Desktop; strClass=com.sun.star.text.XTextViewCursorSupplier; They all return an enumeration which returns false on hasMoreElements();. After all, it seems that I really need to use the XTypeDescription* infrastructure to get at all the information at runtime that I need to make the scripting language support even more flexible (although the present support looks nice and simple enough and runs stable on 1.1.4, 1.9, with the latter even pluggable into the scripting framework). Still looking forward to any hints, insights ... Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] TCLUNO ... (Re: [api-dev] Almost there? (Re: [api-dev] /singletons/com.sun.star.reflection.theTypeDescriptionManager available in which context ?
Hi Arnulf, I don't know, what you are looking exactly for, but try that link and see if it is something in the direction you want: http://www.tugm.de/Projekte/TCLUNO/index.html English: http://www.tugm.de/Projekte/TCLUNO/index.html.en It is an Introspection Tool using tcluno, written in Tcl together with the libtcluno.so. It has not yet been tested very well, but you can give it a try, if you want. That looks really very nice! A true OOo (UNO) class browser and search tool, very cool! Will inform the XOTcl people around here. tugm is the Tcl User Group Munich I see. Thank you very much for this interesting link! ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] TCLUNO ... (Re: [api-dev] Almost there? (Re: [api-dev] /singletons/com.sun.star.reflection.theTypeDescriptionManager available in which context ?
Hi Rony, Am Freitag, 5. August 2005 20:36 schrieb Rony G. Flatscher: Hi Arnulf, I don't know, what you are looking exactly for, but try that link and see if it is something in the direction you want: http://www.tugm.de/Projekte/TCLUNO/index.html English: http://www.tugm.de/Projekte/TCLUNO/index.html.en It is an Introspection Tool using tcluno, written in Tcl together with the libtcluno.so. It has not yet been tested very well, but you can give it a try, if you want. That looks really very nice! A true OOo (UNO) class browser and search tool, very cool! Not only a class browser, you can drive ooo with it directly and try all the interfaces online. Will inform the XOTcl people around here. tugm is the Tcl User Group Munich I see. Thank you very much for this interesting link! ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Arnulf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Browsing the source code
Hi All, Below is a note from the Developers guide(http://api.openoffice.org/docs/DevelopersGuide/DevelopersGuide.pdf) Pg 327 Chapter 5 Design patterns and coding recommendations for OpenOffice.org. Possible candidates are: Singleton: global service Singleton: global service manager, Desktop, UCB Factory: decouple specification and implementation, cross-environment instantiation, contextspecific instances Listener: eliminate polling Element access: it is arguable if that is a design pattern or just an API Properties: solves remote batch access, but incurs the problem of compile-time type indifference UCB commands: universal dispatching of content specific operations Dispatch commands: universal dispatching of object specific operations, chain of responsibility I assume they are not implemented in the current version of OO.org(1.1.4) and so labelled as recommendations. I was wondering if they are not currently implemented is it possible to implement them? If it is possible can anybody point me in the right direction. I have learnt Singelton,Factory,Listener patterns but dont know how to proceed for Element access,Properties,UCB commands, Dispatch commands. I would appreciate any help. Sincerely Senthil P.S. My apologies for positng this again but as I did not get any reply since I last posted it (8-4-05) I am reposting it. From: Senthilkumar Mehalingam [EMAIL PROTECTED] Reply-To: dev@api.openoffice.org To: dev@api.openoffice.org CC: [EMAIL PROTECTED] Subject: Re: [api-dev] Browsing the source code Date: Tue, 02 Aug 2005 20:33:58 -0400 Hi All, Thanks Andrew for your reply. I found the file fecopy.cxx in the directory you suggested. That has the copy function implemented. But as the documentation is in a language other than English so I could not understand it. Is it possible to convert the source file to an English file. I looked up the web but could not find any appropriate help. Also I found while searching through the source a file called AccessibleEditableTextPara.cxx in svx/ source/accessibility/ which had the copy,paste,cut functions implemented. What you have told is correct that each references(each component of OO.org like Draw,Impress and so on) have their own implementation. I would appreciate any help. Sincerely Senthil From: Andrew Douglas Pitonyak [EMAIL PROTECTED] Reply-To: dev@api.openoffice.org To: dev@api.openoffice.org Subject: Re: [api-dev] Browsing the source code Date: Tue, 02 Aug 2005 00:38:18 -0400 The real problem is finding the specific code that you want. For example, I decided to look at the Writer specific code so I looked here: sw/source/core/frmedt and I searched for the word Clipboard. Probably NOT what you want. I also some stuff off of the core directories. In fact, I saw many many references. I expect that each portion will have its own handling code. Senthilkumar Mehalingam wrote: Hi All, Thanks Andrew for your reply. I did as you told but I cannot find the functions(cut,paste,undo,redo) inspite of a thorugh search as searching for cut finds .cpp files which have cut as a middle word in them and searching for cut finds no .cpp files. I got the source from http://openoffice.mirror.wrpn.net/stable/1.1.4/OOo_1.1.4_source.tar.gz and am not sure if I did get the right version or I needed to get the most recent one from the CVS Server. The unzipped version had 116 cpp source files. Are the functions implemented in some other files having a different extension or am I making a mistake. I would appreciate any help. Sincerely Senthil From: Andrew Douglas Pitonyak [EMAIL PROTECTED] Reply-To: dev@api.openoffice.org To: dev@api.openoffice.org Subject: Re: [api-dev] Browsing the source code Date: Wed, 27 Jul 2005 22:02:58 -0400 I typically download the source code and then I use a text search on the whole thing. Of course, the whole thing is more than 1GB I think, so on my computer, this can take a long time. Especially since sometimes I search for the wrong thing :-( Senthilkumar Mehalingam wrote: Hi All, I want to see how the cut,paste,undo,redo functionalities are implemented in OO.org. If anybody could point me to the specific files and modules in which they are implemented I would highly appreciate that. I want to know if Design Patterns are used in implementing them or not. If not I would like to try to implement it. I would appreciate any help and advice. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php
[api-dev] existing UNO bridges
I was trying to get the names of the existing UNO bridges implemented into the office. When testing it from Starbasic, like so code Sub Main bridgefac = createUNOService(com.sun.star.bridge.BridgeFactory) msgbox UBound(bridgefac.getExistingBridges()) End Sub /code the msgbox gives me a value of -1 back, indicating that there are no existing bridges. When trying this method from C++, like so code Reference XBridgeFactory xBridgeFactory( xMultiComponentFactoryServer-createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM(com.sun.star.bridge.BridgeFactory ) ), xComponentContext ), UNO_QUERY ); /* looks for existing bridges and prints out the name of the first bridge contained in the sequence returned by getExistingBridges() */ OUString brname; Sequence Reference XBridge aBridgeSeq; if( xBridgeFactory.is() ) { aBridgeSeq = xBridgeFactory-getExistingBridges(); if (aBridgeSeq.hasElements()) brname = aBridgeSeq.getArray()[0]-getName(); printf(UNO bridge 1 is named\t%s\n, (char*) brname.getStr()); } /code the sequence returns one single bridge (I checked with getLength() on the seq) with the name u. So my question is: What does this method really return? The documentation talks about a full list of all unnamed and named bridges, but yet it does only return me 1 entry in C++ and nothing at all in SB. Trying to extract some logic out of the results, it rather seems to me as if the function only checks for the bridges that are currently in active use, ie the cpp bridge would be used when calling from C++, but then why is it named u? -- Best Regards Christian Junker - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Active cell from selection
Hi, I create a Range from Selection. how do I find the active cell ?? uno::Reference frame::XModel xModel( m_xDesktop-getCurrentComponent(), uno::UNO_QUERY ); uno::Reference table::XCellRange xRange( xModel-getCurrentSelection(), ::uno::UNO_QUERY); Active cell is the last cell that is shown with white border . Regards, Jayant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Fwd: Retrieving list of _existing_ printers
Turbo Fredriksson wrote: when I asked about this a long time ago, I was told that ther is no such thing in openoffice and I should use the api of the language to do this. for example if you are using java, use the java-api for finding the printers the code below might help you if you are using java public String[] getDefinedPrintersOnServer(){ PrintService[] printers = printServiceLookup.lookupPrintServices(null,null); String[] data = new String[printers.length]; for(int i=0; iprinters.length; i++){ data[i] = printers[i].getName(); } return data; } to be able to use these printers in openoffice (in va 1.1.x atleast, hav enot checked with the 1.9 series) you might have to add and around the name... so if you get Hp color jet from the system call, to be able to use it in openoffice you might have to supply the name Hp color jet Is there any way to do this in OOo BASIC? I don't know of any way, but I'm no expert, I stopped investigate this, when I started to use the java way of doing things (most of my code was developed in java anyway) but with OOo 2 betas (1.9.x) you might be able to use the above code with little rewriting as a bsh script (bsh is scripting with java) which I think you can include inside your document.. /Christian Andersson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Almost there? (Re: [api-dev] /singletons/com.sun.star.reflection.theTypeDescriptionManager available in which context ?
Hi Jürgen * b) using XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() yields always an empty XTypeDescriptionEnumeration. mmh, that is maybe a bug but i am not sure and have to take a closer look into the code. Hoping it is not a bug, but something I am doing wrong. (But if a bug, maybe there is a workaround?) Did try it to no avail with: strClass=com.sun.star.comp.helper.Bootstrap; strClass=com.sun.star.reflection.XTypeDescription; strClass=com.sun.star.uno.XInterface; strClass=com.sun.star.frame.Desktop; strClass=com.sun.star.text.XTextViewCursorSupplier; They all return an enumeration which returns false on hasMoreElements();. After all, it seems that I really need to use the XTypeDescription* infrastructure to get at all the information at runtime that I need to make the scripting language support even more flexible (although the present support looks nice and simple enough and runs stable on 1.1.4, 1.9, with the latter even pluggable into the scripting framework). Still looking forward to any hints, insights ... Any news on this so far? Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Almost there? (Re: [api-dev] /singletons/com.sun.star.reflection.theTypeDescriptionManager available in which context ?
Hi Rony, Rony G. Flatscher wrote: Hi Jürgen * b) using XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() yields always an empty XTypeDescriptionEnumeration. mmh, that is maybe a bug but i am not sure and have to take a closer look into the code. Hoping it is not a bug, but something I am doing wrong. (But if a bug, maybe there is a workaround?) Did try it to no avail with: strClass=com.sun.star.comp.helper.Bootstrap; UNO Java runtime helper - no type description strClass=com.sun.star.reflection.XTypeDescription; strClass=com.sun.star.uno.XInterface; both are interfaces and return an empty enumeration becasue the enumeration works not on methods or attributes - see the documentation of XTypeDescriptionEnumerationAccess strClass=com.sun.star.frame.Desktop; is an service - not in the office type library strClass=com.sun.star.text.XTextViewCursorSupplier; see above - interface type They all return an enumeration which returns false on hasMoreElements();. i would have that expected ;-) Juergen After all, it seems that I really need to use the XTypeDescription* infrastructure to get at all the information at runtime that I need to make the scripting language support even more flexible (although the present support looks nice and simple enough and runs stable on 1.1.4, 1.9, with the latter even pluggable into the scripting framework). Still looking forward to any hints, insights ... Any news on this so far? Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Hi Jürgen, thank you for your feedback. It has clarified some things for me, but also one point is still up: XTypeDescriptionEnumerationAccess .createTypeDescriptionEnumeration() seems not to work as announced in the docs: the enumeration can be restricted if one supplies a sequence of TypeClass values. Whenever I try to do that, an empty enumeration is created (I would be intrested in interfaces and services only). Created another Java program version to demonstrate the effect: --- cut here -- import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.bridge.XUnoUrlResolver; import com.sun.star.comp.helper.Bootstrap; import com.sun.star.container.XHierarchicalNameAccess; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.reflection.TypeDescriptionSearchDepth; import com.sun.star.reflection.XTypeDescription; import com.sun.star.reflection.XTypeDescriptionEnumeration; import com.sun.star.reflection.XTypeDescriptionEnumerationAccess; import com.sun.star.uno.Type; import com.sun.star.uno.TypeClass; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.uno.XCurrentContext; import com.sun.star.uno.XInterface; import com.sun.star.uno.XNamingService; public class TestTDEnum { static String unoURL=null; static XComponentContext context=null; static XUnoUrlResolverxuur=null; static XNamingService xns=null; static XMultiComponentFactory xmcf=null; static XComponentContext xcc=null; public static XHierarchicalNameAccesstheTypeDescriptionManager=null; static void testTypeDescriptionEnumeration() { say(\n -- --- ---\n); XTypeDescriptionEnumerationAccess enumerationAccess = (XTypeDescriptionEnumerationAccess) UnoRuntime.queryInterface(XTypeDescriptionEnumerationAccess.class, theTypeDescriptionManager); say(testTypeDescriptionEnumeration(): enumerationAccess:\n\t+pp(enumerationAccess)); try { TypeClass tc[] = {TypeClass.INTERFACE, TypeClass.SERVICE}; XTypeDescriptionEnumeration tdEnum1=null, tdEnum2=null, tdEnum3=null, tdEnum4=null; String module=com.sun.star; // module to analyze say(Does not work, should enumerate all TypeClass.INTERFACE, TypeClass.SERVICE types:); tdEnum1=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze tc, // INTERFACE, SERVICE TypeDescriptionSearchDepth.INFINITE // enumerate all submodules as well ); say(tdEnum1.hasMoreElements()=+pp(+tdEnum1.hasMoreElements())+\n); say(Does work: no restriction on types to enumerate:); tdEnum2=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[0], // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.INFINITE // enumerate all submodules as well ); say(tdEnum2.hasMoreElements()=+pp(+tdEnum2.hasMoreElements())+\n); say(Does work: no restriction on types to enumerate:); tdEnum3=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[0], // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.ONE // enumerate given module only ); say(tdEnum3.hasMoreElements()=+pp(+tdEnum3.hasMoreElements())+\n); say(Does NOT work: trying to enumerate interface types only:); tdEnum4=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[] {TypeClass.INTERFACE} , // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.ONE // enumerate given module only ); say(tdEnum4.hasMoreElements()=+pp(+tdEnum4.hasMoreElements())+\n); } catch (Exception e) { say(\n-- exception occurred: +pp(e)); } } static void connect(String strPort) { try { unoURL=uno:socket,host=localhost,port=+strPort+;urp;StarOffice.NamingService; say(unoURL:\t+pp(unoURL)); context=Bootstrap.createInitialComponentContext(null); say(context:\t+pp(context)); xuur=(XUnoUrlResolver) UnoRuntime.queryInterface( XUnoUrlResolver.class, context.getServiceManager().createInstanceWithContext( com.sun.star.bridge.UnoUrlResolver, context) );
Re: [api-dev] [CPHennessy] [users] Print order '4; 1; 2; 3'?
Am 10.08.2005 09:47 schrieb Turbo Fredriksson: I don't know, why you would specifify the pageorder. If you print pages 1-8 with the 'brochure' option, you will get a 'book' with 8 pages in the right order. Also pages 9-16, 17-32 aso. Oki, so which variable do i set for this? I can set the 'PaperOrientation' (using 'com.sun.star.view.PaperOrientation.LANDSCAPE'), the 'PaperFormat' (using 'com.sun.star.view.PaperFormat.A4'), 'PageRows' and 'PageColumns'. But I can't figure out a way to specify to print in brochure format... I think you need http://api.openoffice.org/docs/common/ref/com/sun/star/text/PrintSettings.html#PrintProspect greetings Mathias -- ·-· cut here ·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-8·-· - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Hi Jürgen, public class TestTDEnum { static String unoURL=null; static XComponentContext context=null; static XUnoUrlResolverxuur=null; static XNamingService xns=null; static XMultiComponentFactory xmcf=null; static XComponentContext xcc=null; public static XHierarchicalNameAccess theTypeDescriptionManager=null; static void testTypeDescriptionEnumeration() { say(\n -- --- ---\n); XTypeDescriptionEnumerationAccess enumerationAccess = (XTypeDescriptionEnumerationAccess) UnoRuntime.queryInterface(XTypeDescriptionEnumerationAccess.class, theTypeDescriptionManager); say(testTypeDescriptionEnumeration(): enumerationAccess:\n\t+pp(enumerationAccess)); try { TypeClass tc[] = {TypeClass.INTERFACE, TypeClass.SERVICE}; XTypeDescriptionEnumeration tdEnum1=null, tdEnum2=null, tdEnum3=null, tdEnum4=null; String module=com.sun.star; // module to analyze say(Does not work, should enumerate all TypeClass.INTERFACE, TypeClass.SERVICE types:); tdEnum1=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze tc, // INTERFACE, SERVICE TypeDescriptionSearchDepth.INFINITE // enumerate all submodules as well ); say(tdEnum1.hasMoreElements()=+pp(+tdEnum1.hasMoreElements())+\n); say(Does work: no restriction on types to enumerate:); tdEnum2=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[0], // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.INFINITE // enumerate all submodules as well ); say(tdEnum2.hasMoreElements()=+pp(+tdEnum2.hasMoreElements())+\n); say(Does work: no restriction on types to enumerate:); tdEnum3=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[0], // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.ONE // enumerate given module only ); say(tdEnum3.hasMoreElements()=+pp(+tdEnum3.hasMoreElements())+\n); say(Does NOT work: trying to enumerate interface types only:); tdEnum4=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[] {TypeClass.INTERFACE} , // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.ONE // enumerate given module only ); The problem here is thast you search with TypeDescriptionSearchDepth.ONE in module com.sun.star for interfaces. TypeDescriptionSearchDepth.ONE means only in this module and not recursive. But in this module you will not find any interfaces. At this point you have to search with TypeDescriptionSearchDepth.INFINITE or you have to specify for exampe com.sun.star.lang There are four examples of getting an enumeration above: the very first two *use* INFINITE. Yet the very first version where I explictly list TypeClass.INTERFACE and TypeClass.SERVICE returns an empty enumeration, the second one (givign no restrictions) brings them up. Of course, your observation is right, that the base module com.sun.star has no interfaces (just modules), so I changed the program to work on com.sun.star.text, which posesses interfaces, yet, tdEnum4 (using ONE) above does still *not* yield an enumeration containing elements, although interfaces at that level *are* defined. This is the relevant output (which now also shows the module's name), other than that it is the same as above, where tdEnum1 through tdEnum4 use variations of the arguments for createTypeDescriptionEnumeration(): --- cut here -- testTypeDescriptionEnumeration(): enumerationAccess: [Proxy:17977639,35a1e8;msci[0];6d2898e19a211dab6d7e51a2d5d17e2,Type[com.sun.star.reflection .XTypeDescriptionEnumerationAccess]] Enumerating the module: com.sun.star.text: Does not work, should enumerate all TypeClass.INTERFACE, TypeClass.SERVICE types: tdEnum1.hasMoreElements()=false Does work: no restriction on types to enumerate: tdEnum2.hasMoreElements()=true Does work: no restriction on types to enumerate: tdEnum3.hasMoreElements()=true Does NOT work: trying to enumerate interface types only: tdEnum4.hasMoreElements()=false --- cut here -- So, what do you think? Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Hi Rony, i haven't tested your Java program but i have tested it in Basic and it works as expected sub Main servicemgr = getProcessServiceManager() tdmgr = servicemgr.DefaultContext.getValueByName(/singletons/com.sun.star.reflection.theTypeDescriptionManager) Dim types(1) types(0)= com.sun.star.uno.TypeClass.INTERFACE types(1)= com.sun.star.uno.TypeClass.SERVICE tds = tdmgr.createTypeDescriptionEnumeration(com.sun.star.text, types(), com.sun.star.reflection.TypeDescriptionSearchDepth.ONE) while tds.hasMoreElements() td = tds.nextTypeDescription() print td.name wend end sub When i have time i will test your Java program as well. Juergen Rony G. Flatscher wrote: Hi Jürgen, public class TestTDEnum { static String unoURL=null; static XComponentContext context=null; static XUnoUrlResolverxuur=null; static XNamingService xns=null; static XMultiComponentFactory xmcf=null; static XComponentContext xcc=null; public static XHierarchicalNameAccess theTypeDescriptionManager=null; static void testTypeDescriptionEnumeration() { say(\n -- --- ---\n); XTypeDescriptionEnumerationAccess enumerationAccess = (XTypeDescriptionEnumerationAccess) UnoRuntime.queryInterface(XTypeDescriptionEnumerationAccess.class, theTypeDescriptionManager); say(testTypeDescriptionEnumeration(): enumerationAccess:\n\t+pp(enumerationAccess)); try { TypeClass tc[] = {TypeClass.INTERFACE, TypeClass.SERVICE}; XTypeDescriptionEnumeration tdEnum1=null, tdEnum2=null, tdEnum3=null, tdEnum4=null; String module=com.sun.star; // module to analyze say(Does not work, should enumerate all TypeClass.INTERFACE, TypeClass.SERVICE types:); tdEnum1=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze tc, // INTERFACE, SERVICE TypeDescriptionSearchDepth.INFINITE // enumerate all submodules as well ); say(tdEnum1.hasMoreElements()=+pp(+tdEnum1.hasMoreElements())+\n); say(Does work: no restriction on types to enumerate:); tdEnum2=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[0], // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.INFINITE // enumerate all submodules as well ); say(tdEnum2.hasMoreElements()=+pp(+tdEnum2.hasMoreElements())+\n); say(Does work: no restriction on types to enumerate:); tdEnum3=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[0], // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.ONE // enumerate given module only ); say(tdEnum3.hasMoreElements()=+pp(+tdEnum3.hasMoreElements())+\n); say(Does NOT work: trying to enumerate interface types only:); tdEnum4=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[] {TypeClass.INTERFACE} , // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.ONE // enumerate given module only ); The problem here is thast you search with TypeDescriptionSearchDepth.ONE in module com.sun.star for interfaces. TypeDescriptionSearchDepth.ONE means only in this module and not recursive. But in this module you will not find any interfaces. At this point you have to search with TypeDescriptionSearchDepth.INFINITE or you have to specify for exampe com.sun.star.lang There are four examples of getting an enumeration above: the very first two *use* INFINITE. Yet the very first version where I explictly list TypeClass.INTERFACE and TypeClass.SERVICE returns an empty enumeration, the second one (givign no restrictions) brings them up. Of course, your observation is right, that the base module com.sun.star has no interfaces (just modules), so I changed the program to work on com.sun.star.text, which posesses interfaces, yet, tdEnum4 (using ONE) above does still *not* yield an enumeration containing elements, although interfaces at that level *are* defined. This is the relevant output (which now also shows the module's name), other than that it is the same as above, where tdEnum1 through tdEnum4 use variations of the arguments for createTypeDescriptionEnumeration(): --- cut here -- testTypeDescriptionEnumeration(): enumerationAccess: [Proxy:17977639,35a1e8;msci[0];6d2898e19a211dab6d7e51a2d5d17e2,Type[com.sun.star.reflection
[api-dev] [EMAIL PROTECTED] REQUEST: unanswered questions
Dear OpenOffice.org community, We really would like to see all questions answered, but we need your help to keep track of your questions and their answer status. Thus, if you still have a question unanswered for more than two days, feel free to place a reminder on the list. But maybe you should think about simplifying your question, strip down your code example etc. I'd like to remind that this mailinglist is not a support forum. We core developers like to see all questions answered, but we cannot do your work. Thus, even though some background information can be helpful, phrase your question as easy as possible to us and focus on the OOo API rather then your application. Juergen+Andreas -- http://api.openoffice.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Reminder: [api-dev] Style change listener for calc.
Hi Dinesh, On Thu, Aug 11, 2005 at 12:32:34 +0530, Dinesh Varadharajan wrote: Is this a current limitation. Yes, it is. I am expecting XModifyBroadCaster to broadcast even the style change information.. As I already wrote, we currently don't support that. What do you expect to achieve by sending this reminder? Eike -- OOo/SO Calc core developer. Number formatter bedevilled I18N transpositionizer. GnuPG key 0x293C05FD: 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Problem to identify the name of a chart
Hello, I'm working on an OpenOffice-based Report-Framework and have a problem with the identification of a chart by its name. The methods XTableCharts.getElementNames() and XTableCharts.getByName(String) refer to the internal name of the chart, i.e. Object 1. What I need is the name, which the user can set via the function Set name ... of the context menu of a chart. In the XML-Source it is the value of the attribute draw:name of the draw:frame-Element, what I need. How can I access this name by the API? Can anyone help me? - XML-Source of the chart -- draw:frame draw:name=myChart draw:object draw:notify-on-update-of-ranges=SampleData.A2:SampleData.D21 xlink:href=./Object 1 xlink:type=simple xlink:show=embed xlink:actuate=onLoad / draw:image xlink:href=./ObjectReplacements/Object 1 xlink:type=simple xlink:show=embed xlink:actuate=onLoad / /draw:frame // This source doesn't work, because it checks the internal name of the chart XTableCharts xTableCharts = xTableChartsSupplier.getCharts(); String[] chartNames = xTableCharts.getElementNames(); for (int chartNamesIdx = 0; chartNamesIdx chartNames.length; chartNamesIdx++) { if (chartNames[chartNamesIdx].equals(myChart)) { XTableChart xTableChart = (XTableChart) UnoRuntime.queryInterface( XTableChart.class, xTableCharts.getByName(chartNames[chartNamesIdx]) ); xTableChart.setRanges(chartRefreshParameter.cellRangeAddresses); } } Mit freundlichen Grüßen, Sacha Warning -- LambdaLogic Informationssysteme GmbH Gubener Straße 47 10243 Berlin Telefon : (030) 29 36 38-513 Telefax : (030) 29 36 38-59 eMail : [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Problem to identify the name of a chart
Hi Sacha I'm working on an OpenOffice-based Report-Framework and have a problem with the identification of a chart by its name. The methods XTableCharts.getElementNames() and XTableCharts.getByName(String) refer to the internal name of the chart, i.e. Object 1. What I need is the name, which the user can set via the function Set name ... of the context menu of a chart. In the XML-Source it is the value of the attribute draw:name of the draw:frame-Element, what I need. How can I access this name by the API? Can anyone help me? what you get as name there is the persistant name, which doesn't change by changing the UI name. What you could do is getting the shape-collection from the document. The shapes implement a XNamed interface and this returns the displayed name. Beside this the shape also has the property PersistName which contains the appropriate Name to get the right TableChart. Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] [CPHennessy] [users] Print order '4; 1; 2; 3'?
Mathias Röllig wrote: Am 10.08.2005 09:47 schrieb Turbo Fredriksson: I don't know, why you would specifify the pageorder. If you print pages 1-8 with the 'brochure' option, you will get a 'book' with 8 pages in the right order. Also pages 9-16, 17-32 aso. Oki, so which variable do i set for this? I can set the 'PaperOrientation' (using 'com.sun.star.view.PaperOrientation.LANDSCAPE'), the 'PaperFormat' (using 'com.sun.star.view.PaperFormat.A4'), 'PageRows' and 'PageColumns'. But I can't figure out a way to specify to print in brochure format... I think you need http://api.openoffice.org/docs/common/ref/com/sun/star/text/PrintSettings.html#PrintProspect greetings Mathias What is Prospect Printing? Until now I have never heard anyone indicate that they know what it means. You recommend prospect printing, so I assume that you do know. Previously, I spent a lot of time trying to figure out what it is... -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Active cell from selection
Jayant Balraj Madavi wrote: Hi, I create a Range from Selection. how do I find the active cell ?? uno::Reference frame::XModel xModel( m_xDesktop-getCurrentComponent(), uno::UNO_QUERY ); uno::Reference table::XCellRange xRange( xModel-getCurrentSelection(), ::uno::UNO_QUERY); Active cell is the last cell that is shown with white border . Regards, Jayant If you have a copy of my free macro document, read the section titled: Get the active cell and ignore the rest #6.5.1.Get%20the%20active%20cell%20and%20ignore%20the%20rest%7Coutline -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] [CPHennessy] [users] Print order '4; 1; 2; 3'?
Am Samstag, den 13.08.2005, 17:21 -0400 schrieb Andrew Douglas Pitonyak: Mathias Röllig wrote: [...] I think you need http://api.openoffice.org/docs/common/ref/com/sun/star/text/PrintSettings.html#PrintProspect greetings Mathias What is Prospect Printing? Until now I have never heard anyone indicate that they know what it means. You recommend prospect printing, so I assume that you do know. Previously, I spent a lot of time trying to figure out what it is... Since I'm german and OOo / SO itself is based on work of primarily german developers I suppose there may be a translation error that has nerver been corrected, JDictionary tells me the german word Prospekt stands for: leaflet folder prospectus (?) catalogue Do these tranlations make any sense? Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] [CPHennessy] [users] Print order '4; 1; 2; 3'?
I'm from Serbia, sometimes we also say prospekt which means brochure. I guess we're taken this word from German. cheers, Aleksandar Dezelin On 8/14/05, Mathias Röllig [EMAIL PROTECTED] wrote: Hi Andrew! Am 13.08.2005 23:21 schrieb Andrew Douglas Pitonyak: But I can't figure out a way to specify to print in brochure format... I think you need http://api.openoffice.org/docs/common/ref/com/sun/star/text/PrintSettings.html#PrintProspect What is Prospect Printing? Until now I have never heard anyone indicate that they know what it means. You recommend prospect printing, so I assume that you do know. Previously, I spent a lot of time trying to figure out what it is... Hmm. *grin* It can be, that there is a translation mistake, that i can understand. ;-) The OP ask for the brochure option. This option is in german Prospekt. So i assume, that PrintProspect in the API is assigned to Prospekt=brochure. http://dict.leo.org/?lp=endelang=desearchLoc=0cmpType=relaxedrelink=onsectHdr=offspellToler=stdsearch=prospekt I don't have tested it. But i think, it is so. Otherwise i dont't know, what it can be. Hope, you can understand me. :-) greetings from Dresden again Mathias -- ·-· cut here ·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-8·-· - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- [hello MI5] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] [CPHennessy] [users] Print order '4; 1; 2; 3'?
Marc Santhoff wrote: Am Samstag, den 13.08.2005, 17:21 -0400 schrieb Andrew Douglas Pitonyak: Mathias Röllig wrote: [...] I think you need http://api.openoffice.org/docs/common/ref/com/sun/star/text/PrintSettings.html#PrintProspect greetings Mathias What is Prospect Printing? Until now I have never heard anyone indicate that they know what it means. You recommend prospect printing, so I assume that you do know. Previously, I spent a lot of time trying to figure out what it is... Since I'm german and OOo / SO itself is based on work of primarily german developers I suppose there may be a translation error that has nerver been corrected, JDictionary tells me the german word Prospekt stands for: leaflet folder prospectus (?) catalogue Do these tranlations make any sense? Marc Wow, Thanks. Yes, this makes a lot of sense. While I was writing my macro book, I wanted to document these options, but I did not know what prospect printing was. I posted some questions on the mailing lists, but I received no answers to this particular question. It is nice to finally find out what it means! Thanks again! -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] cannot compile 1.1.5 (SRX645_m57)
Hi all, I'm trying to build the 1.1.5-rc2 version (tag SRX645_m57) under Windows XP Pro. The compilation stops with the following log: guw.pl /cygdrive/c/PROGRA~1/MICROS~2/VC98/bin/cl.exe @/tmp/mkN15nWd Command: /cygdrive/c/PROGRA~1/MICROS~2/VC98/bin/cl.exe MutableAttrList.cxx l:\ooo-1.1.5-rc2\odfilter\source\MutableAttrList.cxx(102) : error C2974: 'Reference' : invalid template argument for 'interface_type', type expected l:\oo_115-rc2-solver\645\wntmsci9.pro\inc\com/sun/star/uno/Refer ence.h(441) : see declaration of 'Reference' l:\ooo-1.1.5-rc2\odfilter\source\MutableAttrList.cxx(102) : error C2511: 'XMLMutableAttributeList::XMLMutableAttributeList' : overloaded member function 'void (const class com::sun::star::uno::Referenceint ,unsigned char)' not found in 'XMLMutableAttributeList' l:\ooo-1.1.5-rc2\odfilter\source\MutableAttrList.hxx(79) : see declaration of 'XMLMutableAttributeList' l:\ooo-1.1.5-rc2\odfilter\source\MutableAttrList.cxx(255) : fatal error C1004: unexpected end of file found dmake: Error code 2, while making '../wntmsci9.pro/slo/MutableAttrList.obj' echo: No match. ERROR: Error 65280 occurred while making /cygdrive/l/ooo-1.1.5-rc2/odfilter/source dmake: Error code 1, while making 'build_all' echo: No match. The configuration command was: ./configure --with-lang=ENUS,ITIT,ITAL \ --with-ant-home=/cygdrive/l/apache-ant-1.6.1 \ --with-asm-home=/cygdrive/c/MASM611/BIN \ --with-jdk-home=/cygdrive/l/j2sdk1.4.1_07 \ --with-use-shell=tcsh \ --with-local-solver=/cygdrive/l/oo_115-rc2-solver \ --with-mspdb-path='/cygdrive/c/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin' The only issue related to odfilter I found was 51389, I checked and I have it. Can someone point me in the right direction ? Thanx. Regards, Giuseppe. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] META-INF and mimetype files in zip archive
Hi Michele, That happens because the initial purpose of the Package service is to access OOo packages formats, and META-INF/manifest.xml is part of this format. If a pure zip-file access is requested then either the special UCP should be used or the Package service must be initialized in a special way. Since your code already uses the Package service the second way seems to be the best one: - please just add to the sequence of Any that is provided on Package service initialization an additional entry representing object of type ::com::sun::star::beans::NamedValue; the Name member must be initialized with the string PackageFormat and the Value must contain Any representing boolean value false. Hope that helps. Regards, Mikhail. Michele Zarri wrote: Hello there, I already posted this message in the users mailing list, but I was advised that this list was more appropriate for this kind of questions, so here we go. I have written a macro that at a certain point in time zips some files using the service com.sun.star.packages.Package. The problem I am having is that when the zip archive is created (independently from the type of the file I am trying to zip) it contains on top of the file zipped a directory called META-INF as well as a file called mimetype. Is there any way to ask the UNO service not to generate these files (it kind of annoys my colleagues how also generate zip archives in the same folder? If it is not possible I am afraid I will have to do without the handy UNO service and go for some command line messages. Best Regards, Michele - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Interface classes: assumptions correct?
Jürgen Schmidt wrote: Hi Rony, Rony G. Flatscher wrote: Hi there, are the following few assumptions correct? * Interface class names in UNO always start with a capital X only. yes But note that this is only a convention. For the OOo (and URE) UNO APIs, this convention will probably always be followed---but in general, UNO and UNOIDL do not enforce it. -Stephan [...] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Interface classes: assumptions correct?
Hi Stephan, are the following few assumptions correct? * Interface class names in UNO always start with a capital X only. yes But note that this is only a convention. For the OOo (and URE) UNO APIs, this convention will probably always be followed---but in general, UNO and UNOIDL do not enforce it. Thank you for your clarification. Exploring via reflection the beta 2 version of OOo it has become possible to query for the mandatory and optional interfaces and services as well. So this helps already determining unambiguously whether one has an interface in hand or not. (Any chances BTW to get the 1.1.x reflection versions to reflect services as well, at the moment they return just null?) ---rony P.S.: The above statements are referring to using theTypeDescriptionManager via Java. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Interface classes: assumptions correct?
Rony G. Flatscher wrote: Hi Stephan, are the following few assumptions correct? * Interface class names in UNO always start with a capital X only. yes But note that this is only a convention. For the OOo (and URE) UNO APIs, this convention will probably always be followed---but in general, UNO and UNOIDL do not enforce it. Thank you for your clarification. Exploring via reflection the beta 2 version of OOo it has become possible to query for the mandatory and optional interfaces and services as well. So this helps already determining unambiguously whether one has an interface in hand or not. (Any chances BTW to get the 1.1.x reflection versions to reflect services as well, at the moment they return just null?) currently the only way to get service info is to use the types_doc.rdb from the OO build env. But as i mentioned before this will change in the future. Juergen ---rony P.S.: The above statements are referring to using theTypeDescriptionManager via Java. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] macro to add a new curve in a Calc diagram
A Calc sheet contains myDiagram which refers to A1:B31 cells. myDiagram.ChartRangeAddress sends the following string :'mySheet'.$A$1:.$B$31 I want my macro to add a new curve in it, with datas located in A32:C33. I used myDiagram.ChartRangeAddress= "'mySheet'.$A$1:.$C$33" and multiple variations on this string. myDiagram.ChartRangeAddress is correctly changed but the diagram itself refers to the lone A1 cell or various ref errors. If ChartRangeAddress is the right property to use, how should its argument be set ?
Re: [api-dev] macro to add a new curve in a Calc diagram
Hi ch'prof, A Calc sheet contains myDiagram which refers to A1:B31 cells. myDiagram.ChartRangeAddress sends the following string : 'mySheet'.$A$1:.$B$31 I want my macro to add a new curve in it, with datas located in A32:C33. I used myDiagram.ChartRangeAddress= 'mySheet'.$A$1:.$C$33 and multiple variations on this string. myDiagram.ChartRangeAddress is correctly changed but the diagram itself refers to the lone A1 cell or various ref errors. If ChartRangeAddress is the right property to use, how should its argument be set ? The following macro adds two rows to the existing Range of the first chart in a CalcDocument theRanges = ThisComponent.Sheets(0).Charts(0).getRanges() theRanges(0).EndRow = theRanges(0).EndRow+2 ThisComponent.Sheets(0).Charts(0).setRanges(theRanges) Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Connect to a remote office on another machine from SB
Hi all, often it has been talked about that OOo is perfectly capable of acting as a server on one machine and listening for UNO connections from other machines. Up till now I haven't seen a lot of examples showing this, so I just wanted to test if this was practically possible (inspired by a question on oooforum.org) and started a soffice process in listening mode in my wlan on Mac OS X Tiger. I chose to use Starbasic as it shows that you can purely do a socket connection with the OOo API. I used the UnoUrlResolver service as it is used in other languages as well to connect to a running Office, but you can probably also use the XConnector which gives you more low-level power. Also there is a Socket service in the io module. Of course it is probably not that efficient to use Starbasic, since you need to run OOo two times (on server and client machine) but well, it works ;-). I executed the SB code from a Win32 machine, having tested just this case up till now (Win32-Mac OS X), of course you shouldn't have firewalls running and make sure there are no heavy security settings turned on, in case you want to test the code. code Sub connectToRemoteOffice() '192.168.2.103 is the TCP/IP address of the server running OOo with '-accept=socket,host=0,port=8100;urp;StarOffice.ServiceManager' res = createUNOService(com.sun.star.bridge.UnoUrlResolver) remotemgr = res.resolve(uno:socket,host=192.168.2.103,port=8100;urp;StarOffice.ServiceManager) desk = remotemgr.createInstance(com.sun.star.frame.Desktop) desk.loadComponentFromURL(private:factory/swriter, _blank, 0, Array()) 'look on the server monitor now :-) End Sub /code As you can see it's just a few lines, so it's very simple and clean code. Hope this helps someone out there somehow. -- Best Regards Christian Junker - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Having a FilePicker: how to bring it to front ?
Hi there, did try to find a solution firstly by searching the api-search interface to no avail. (E.g. http://api.openoffice.org/servlets/Search?scope=projectAndSubsresultsPerPage=40query=bring+to+frontButton=Go, short of a document object at that point in time I cannot try to use that for getting access at the CurrentController). The problem: for a conversion from a writer-document to pdf the user is presented with a FilePicker dialog only, where he should pick the file to be converted, and which gets loaded therafter into OOo. Unfortunately the dialog is not displayed as the top/front window, so the user needs to get it to front manually. What would be a starting point to research to get the FilePicker to the front programmatically (without having a document object yet)? Regards, ---rony P.S.: In case it is helpful (or if some are a little bit curious) I copied that particular ooRexx script, so you can see the flow of logic. ooRexx is case-insensitive and the tilde (~) is the message operator (hence it is clear that the literal right to it is always the message name to be sent to the object left to it). Routines like ConvertToURL() or ConvertFromURL() are named/modelled after {Star|OOo]Basic. (The next steps are to forego the explicit need for requesting interface objects like Basic allows for; although in the meantime I am not so sure whether that will be really so helpful to macro/script programmers, because requesting explicitly interfaces makes it perfect clear over time what functionality is sought and is available; yet some people may still want that feature; that's the reason why I was so eager to learn about reflecting UNO and being able to do it via Java, which serves as a bridging technology.) --- cut here /* ooRexx Example 10 (cf. http://www.ooRexx.org) Open an existing textfile and convert it to *.pdf Possible files are *.sxw, *.doc, *.txt, */ /* initialize connection to server, get its Desktop-service and XComponentLoader interface */ xMsf = OOo.connect() -- connect to server and get remote multi service factory -- Retrieve the Desktop object, we need its XComponentLoader interface to load a new document oDesktop = xMsf~createInstance(com.sun.star.frame.Desktop) xComponentLoader = oDesktop~xDesktop~XComponentLoader -- get componentLoader interface url=getFileName(xMsf) -- get file name from user if url=.nil then exit -- user did not pick a file say File: pp(ConvertFromURL(url)) ... props = bsf.createArray(.ooo~propertyValue, 1) props[1] = .OOo~PropertyValue~new props[1]~Name = Hidden props[1]~Value = box(boolean, .true) xWriterComponent = xComponentLoader~loadComponentFromURL(url, _blank, 0, props) xStorable = xWriterComponent~XStorable -- get xStorable interface /* convert it to *.pdf */ props = bsf.createArray(.OOo~PropertyValue, 2) props[1] = .OOo~PropertyValue~new props[1]~Name = FilterName props[1]~Value = writer_pdf_Export props[2] = .OOo~PropertyValue~new props[2]~Name = CompressMode props[2]~Value = 2 storeURL=substr(url, 1, lastpos(., url)) || pdf -- create output file name xStorable~storeToUrl(storeURL, props) -- store the file with props to URL say File: pp(ConvertFromURL(storeURL)) successfully created! ::requires OOo.cls-- get OOo support ::routine getFileName -- FilePicker dialog to ask the user to pick a file to convert use arg xMsf, oDesktop -- retrieve multi service factory fd=xMsf~createInstance(com.sun.star.ui.dialogs.FilePicker) xfp=fd~XFilePicker -- get the interface for driving the FilePicker functionality urlPath=convertToUrl(directory()) -- convert current directory to URL xfp~setDisplayDirectory(urlPath)-- determine directory to start out with ret=xfp~setTitle(date(S) time(): Please choose a writer file to convert to PDF!) xfm=xfp~XFilterManager -- get the filter manager interface fileTypes=*.sxw;*.doc;*.txt;*.text xfm~appendFilter(Text files pp(fileTypes), fileTypes) -- first filter is current one xfm~appendFilter(All files, *) ret=xfp~execute-- execute the dialog if ret=1 then -- 1...o.k., 0...cancel file=xfp~files[1] fd~XComponent~dispose -- close dialog if ret=1 then return file return .nil-- canceled by user --- cut here - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [api-dev] cannot compile 1.1.5 (SRX645_m57)
it seems the problem was with the old VC6 compiler version I was using. After changing to .NET 2002 the problem solved by itself. Giuseppe. -Original Message- From: Giuseppe Castagno [SMTP:[EMAIL PROTECTED] Sent: Monday, August 15, 2005 11:35 To: dev@api.openoffice.org Subject:[api-dev] cannot compile 1.1.5 (SRX645_m57) Hi all, I'm trying to build the 1.1.5-rc2 version (tag SRX645_m57) under Windows XP Pro. snip Can someone point me in the right direction ? Thanx. Regards, Giuseppe. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Text Table Column properties
Hi Is there an easy way to change properties of text table column, i.e the back color of the column. When i read this mailing list posts i found a post that suggests to use text table rows, but for large tables this is not efficient. Any suggestions? Regards Przemek Kroliszewski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Text Table Column properties
Hi Przemek Is there an easy way to change properties of text table column, i.e the back color of the column. When i read this mailing list posts i found a post that suggests to use text table rows, but for large tables this is not efficient. The macro sub Main atable = ThisComponent.TextTables(0) acolumn = getColumn(1,atable) acolumn.BackColor=rgb(0,255,0) end sub function getColumn(col as Integer, table as Object) as Object tablerows = table.rows.count-1 getColumn = table.getCellRangeByPosition(col,0,col,tablerows) end function will change the backgroundcolor of the second column in your first table. Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Text Table Column properties
Stephan Wunderlich napisał(a): Hi Przemek Is there an easy way to change properties of text table column, i.e the back color of the column. When i read this mailing list posts i found a post that suggests to use text table rows, but for large tables this is not efficient. The macro sub Main atable = ThisComponent.TextTables(0) acolumn = getColumn(1,atable) acolumn.BackColor=rgb(0,255,0) end sub function getColumn(col as Integer, table as Object) as Object tablerows = table.rows.count-1 getColumn = table.getCellRangeByPosition(col,0,col,tablerows) end function will change the backgroundcolor of the second column in your first table. Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thanks for rapid reply! I found the solution by my self in mean time. Here's the code in Java public void setColumnProperty(Object xTable, int column, String propertyName, Object propertyValue) throws Exception { try { //Check an instance of passed object if(!(xTable instanceof XTextTable)) throw new InvalidObjectException(Passed xTable is not a XTextTable object); //Get cell range for whole text table XCellRange xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, (XTextTable)xTable ); //Get rows from the table, this is used to get the rows count. XIndexAccess xRows = ((XTextTable)xTable).getRows(); //Get cell range for specified column XCellRange xColumn = xCellRange.getCellRangeByPosition(column, 0, column, xRows.getCount()-1); //Get properties for the column XPropertySet xColProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xColumn); //And set the property ... ufff xColProps.setPropertyValue(propertyName, propertyValue); } catch(com.sun.star.uno.Exception e) { throw (RuntimeException) new RuntimeException(Can't set column properties).initCause(e); } } BTW, why there are no simple interface to use text table columns, similar as text table rows? Best regards Przemek Kroliszewski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Having a FilePicker: how to bring it to front ?
Hi Rony, What would be a starting point to research to get the FilePicker to the front programmatically (without having a document object yet)? Now I'm curious ... the filepicker is a modal dialog that is always on top and can't be moved to the back ... just to be sure I opened it via Basic, Java and UI and in all three cases the dialog persists in the front of the application. Which platform are you working on ? Do you get the OOo-FilePicker or the System-FilePicker ? In the second case, have you tried to switch to the OOo-Filepicker by setting Tools-Options-General-Use OOo Dialogs ? Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Having a FilePicker: how to bring it to front ?
Hi Stephan, What would be a starting point to research to get the FilePicker to the front programmatically (without having a document object yet)? Now I'm curious ... Great! ;) the filepicker is a modal dialog that is always on top and can't be moved to the back ... just to be sure I opened it via Basic, Java and UI and in all three cases the dialog persists in the front of the application. Yes, relative to OOo. The problem is to bring it into the front of all other windows that may exist on the system (make it to be the first in z-order). Which platform are you working on ? At the moment on Windows (but I usually switch to Linux from time to time to check, whether the ooRexx scripts and OOo are really multi-platform). Do you get the OOo-FilePicker or the System-FilePicker ? The OOo-FilePicker, I assume, the routine getFile() shows which one. (Definitely not directly the Windows widget/control, but the one OOo uses.) In the second case, have you tried to switch to the OOo-Filepicker by setting Tools-Options-General-Use OOo Dialogs ? *WOW*, *that* made it work, thank you *very* much!! (Did try it on OOo 1.1.4 and 1.9.122.) (Also, it is interesting that now only one instance of OOo is shown in the taskbar, whereas beforehand two were created, and closed after the end of the program.) Now a lest (little?) request: how can one set the properties for OOo altogether (would just need a hint where - which class - or code-samples to start researching this corner of OOo, including the ability to learn about the version one is using). This way one can read, set and re-set the setting in the case one wishes to use the FilePicker. Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] [EMAIL PROTECTED] REQUEST: unanswered questions
Dear OpenOffice.org community, We really would like to see all questions answered, but we need your help to keep track of your questions and their answer status. Thus, if you still have a question unanswered for more than two days, feel free to place a reminder on the list. But maybe you should think about simplifying your question, strip down your code example etc. I'd like to remind that this mailinglist is not a support forum. We core developers like to see all questions answered, but we cannot do your work. Thus, even though some background information can be helpful, phrase your question as easy as possible to us and focus on the OOo API rather then your application. Juergen+Andreas -- http://api.openoffice.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] [EMAIL PROTECTED] TOPIC: Contributing
Hi, On Tue, 2005-08-09 at 06:27 +0200, Michael Hoennig wrote: Dear OpenOffice.org community, This is the 2-weekly announcement of current issues regarding the OOo API project which I want to hightlight to the community. *** = *** Translating Examples to C++ (NEW!) *** - How to become contributor to this project ? Basically I am interested to participate in this translation. + Which examples to translate. + Is there a tracker_bug created to monitor this. + whom to contact to get more information(I could not navigate myself to appropriate project in api.openoffice.org). A nice contribution would be to translate the Java examples from the Developers Guide to C++. The effort will be about 1 hour and more, depending on the size of the example. *** = If you have ideas what the next issue of [EMAIL PROTECTED] TOPIC should be about, please contact [EMAIL PROTECTED] Juergen+Andreas Regards mJayant (aZEN_JM) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Having a FilePicker: how to bring it to front ?
Hi Rony, *WOW*, *that* made it work, thank you *very* much!! (Did try it on OOo 1.1.4 and 1.9.122.) great :-) Now a lest (little?) request: how can one set the properties for OOo altogether (would just need a hint where - which class - or code-samples to start researching this corner of OOo, including the ability to learn about the version one is using). This way one can read, set and re-set the setting in the case one wishes to use the FilePicker. I suppose you mean the things you can adjust via Tools-Options ... these are stored in the Configuration and how to access this can be found in the appropriate Developers Guide Chapter ... http://api.openoffice.org/docs/DevelopersGuide/Config/Config.htm Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Having a FilePicker: how to bring it to front ?
Hi Stephan, I suppose you mean the things you can adjust via Tools-Options ... these are stored in the Configuration and how to access this can be found in the appropriate Developers Guide Chapter ... http://api.openoffice.org/docs/DevelopersGuide/Config/Config.htm Thank you very much for this link as well as for all your help! Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Hi Jürgen, i haven't tested your Java program but i have tested it in Basic and it works as expected have you had a chance to test it in the meantime (as mentioned, it doesn't work with INFINITE either)? If so, would you qualify this a bug that should get checked into the bug database? Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Hi Rony, Rony G. Flatscher wrote: Hi Jürgen, i haven't tested your Java program but i have tested it in Basic and it works as expected have you had a chance to test it in the meantime (as mentioned, it doesn't work with INFINITE either)? If so, would you qualify this a bug that should get checked into the bug database? i have slighty modified your example to make use of the simple bootstrap feature. Everything works as expected. It is no bug. There must something else wrong in your environment. Example: *** import com.sun.star.beans.PropertyValue; import com.sun.star.container.XHierarchicalNameAccess; import com.sun.star.frame.XComponentLoader; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.reflection.TypeDescriptionSearchDepth; import com.sun.star.reflection.XTypeDescriptionEnumeration; import com.sun.star.reflection.XTypeDescriptionEnumerationAccess; import com.sun.star.uno.TypeClass; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; public class TestTypeDescription { public static void main(String[] args) { try { XComponentContext xCtx = com.sun.star.comp.helper.Bootstrap.bootstrap(); XMultiComponentFactory xMCF = xCtx.getServiceManager(); XHierarchicalNameAccess tdmgr = (XHierarchicalNameAccess) UnoRuntime.queryInterface( XHierarchicalNameAccess.class, xCtx.getValueByName(/singletons/com.sun.star.reflection.theTypeDescriptionManager)); say(\n -- --- ---\n); XTypeDescriptionEnumerationAccess enumerationAccess = (XTypeDescriptionEnumerationAccess) UnoRuntime.queryInterface(XTypeDescriptionEnumerationAccess.class, tdmgr); say(testTypeDescriptionEnumeration(): enumerationAccess:\n\t+pp(enumerationAccess)); TypeClass tc[] = {TypeClass.INTERFACE, TypeClass.SERVICE}; XTypeDescriptionEnumeration tdEnum1=null, tdEnum2=null, tdEnum3=null, tdEnum4=null; String module=com.sun.star; // module to analyze say(Does not work, should enumerate all TypeClass.INTERFACE, TypeClass.SERVICE types:); tdEnum1=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze tc, // INTERFACE, SERVICE TypeDescriptionSearchDepth.INFINITE // enumerate all submodules as well ); say(tdEnum1.hasMoreElements()=+pp(+tdEnum1.hasMoreElements())+\n); say(Does work: no restriction on types to enumerate:); tdEnum2=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[0], // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.INFINITE // enumerate all submodules as well ); say(tdEnum2.hasMoreElements()=+pp(+tdEnum2.hasMoreElements())+\n); say(Does work: no restriction on types to enumerate:); tdEnum3=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[0], // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.ONE // enumerate given module only ); say(tdEnum3.hasMoreElements()=+pp(+tdEnum3.hasMoreElements())+\n); say(Does NOT work: trying to enumerate interface types only:); tdEnum4=enumerationAccess.createTypeDescriptionEnumeration( module, // module to analyze new TypeClass[] {TypeClass.INTERFACE} , // all UNOIDL types, could also use null instead TypeDescriptionSearchDepth.ONE // enumerate given module only ); say(tdEnum4.hasMoreElements()=+pp(+tdEnum4.hasMoreElements())+\n); } catch(Exception e) { System.out.println(Error: ); e.printStackTrace(); } } public static void say (String s) { System.err.println(s); } public static String pp (Object o) { if (o==null) return null -- -- --; return +o+; } }*** Output: *** -- --- --- testTypeDescriptionEnumeration(): enumerationAccess: [Proxy:10519800,2092b20;msci[0];575e2d1113e111da9eee842fdb471df,Type[com.sun.star.reflection.XTypeDescriptionEnumerationAccess]] Does not work, should enumerate all TypeClass.INTERFACE, TypeClass.SERVICE types: tdEnum1.hasMoreElements()=true Does work: no restriction on types to enumerate: tdEnum2.hasMoreElements()=true Does work: no restriction on types to enumerate: tdEnum3.hasMoreElements()=true Does NOT work: trying to enumerate interface types only:
Re: [api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Hi Jürgen, have you had a chance to test it in the meantime (as mentioned, it doesn't work with INFINITE either)? If so, would you qualify this a bug that should get checked into the bug database? i have slighty modified your example to make use of the simple bootstrap feature. Everything works as expected. It is no bug. There must something else wrong in your environment. Hmm, just went after it again. It seems that with OOo 1.1.4 it does not work, whereas with OOo 1.9.m122 it does work, *except* that after running the Java program, the process does not end but waits? Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Hi Rony, Rony G. Flatscher wrote: Hi Jürgen, have you had a chance to test it in the meantime (as mentioned, it doesn't work with INFINITE either)? If so, would you qualify this a bug that should get checked into the bug database? i have slighty modified your example to make use of the simple bootstrap feature. Everything works as expected. It is no bug. There must something else wrong in your environment. Hmm, just went after it again. It seems that with OOo 1.1.4 it does not work, whereas with OOo 1.9.m122 it does work, *except* that after running the Java program, the process does not end but waits? strange that it doesn't work with 1.1.4, i will check it. The program doesn't exit because of garbage collected objects hold the bridge. If you get the bridge and dispose the bridge the program would terminate. But that is not so easy when using the simple bootstrap mechanism. In this case simply use System.exit if your application allows it, otheriwse you have to connect manually and dispose the bridge. I have forgot it in the exmaple. Juergen Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Rony G. Flatscher wrote: Hi Jürgen, strange that it doesn't work with 1.1.4, i will check it. you are right it won't work in 1.1.4 but i haven't investigated deeper in the problem ;-) - fixed with OO2.0 Juergen Thank you! The program doesn't exit because of garbage collected objects hold the bridge. If you get the bridge and dispose the bridge the program would terminate. But that is not so easy when using the simple bootstrap mechanism. In this case simply use System.exit if your application allows it, otheriwse you have to connect manually and dispose the bridge. I have forgot it in the exmaple. No problem, thank you for your efforts! Regards, ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XTypeDescriptionEnumerationAccess.createTypeDescriptionEnumeration() ( (Re: [api-dev] Almost there? (Re:
Hi Jürgen, you are right it won't work in 1.1.4 but i haven't investigated deeper in the problem ;-) - fixed with OO2.0 O.K., again thank you *very* much for your kind efforts and infos, it really helps a lot! [Will use theTypeDescriptionManager.getByHierarchicalName( typeName ) wherever possible (works on 1.1.4 as well) and if needint full enumerations, caching the results.] Hmm thinking about caching, maybe a very last question: would theTypeDescriptionManager() cache all enumerated types anyway? (This might mean that the impact of a full enumeration wouldn't be that bad at all.) Regards, ---rony P.S.: Have already created full dumps over all IDLs via Java, has been fun and full of a lot of interesting stuff! You guys surely have created a wealth of great functionality in a very clever way. The interfaces and organization of functionality beats the sh... out of Microsoft Office (MSO). Compared to MSO it makes it much easier to orientate and take advantage of the functionality the way you have OpenOffice UNO components organized, really *great* ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] XCellDataRange :: Where am I going wrong
I have a simple function. This function is failing, so it prints ERROR. Any suggestion where I am going wrong ? uno::Any MyClass::getValue () { uno::Any aAny; uno::Sequence uno::Sequence uno::Any aSeq; uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); //mxRange ==table::XCellRange if (xData.is()) { aSeq = xData-getDataArray(); aAny = aSeq; if (aAny = aSeq) // testing b'se this is failing in void setValue(const uno::Any aValue) fprintf(stderr, ERROR \n) ; } return aAny; } In my real code (lengthy one, so not pasting here ), I am having 2 function getValue and setValue. I am using getValue as pasted above and in setValue I am testing if (aAny = aSeq) = which is failing !! Any suggestion ? Regards, Jayant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XCellDataRange :: Where am I going wrong
Hi stephan, Let me put clear code/query, The actual code is with reference to the VBA interop work that we are doing for OOo so if a user writer a VBA script like this on OOo Activesheet.Range(A1:A3).value = Activesheet.Range(A4:A5).Value The above macro breaks down to == MyClass obj1,obj2; obj.setValue (obj2.getValue()); //the function getValue and setValue are described below. I always get the printf ERROR in the setValue :( The same function works properly if I directly work with [uno::Sequence uno::Sequence uno::Any ] instead of return type [uno::Any] but I have to use any b'se there are cases when I require return value as [OUString or long etc ..] //Simple functions uno::Any MyClass::getValue() throw (::com::sun::star::uno::RuntimeException) { uno::Any aAny; uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); if (xData.is()) { uno::Sequence uno::Sequence uno::Any aSeq = xData-getDataArray(); aAny = aSeq; } return aAny; } void MyClass::setValue( const uno::Any aValue ) throw (uno::RuntimeException) { uno::Sequence uno::Sequence uno::Any aSeq; if ((aValue = aSeq)) //FAILING FOR ME { fprintf(stderr, Setting the correct Data \n); uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); xData-setDataArray(aSeq); } else fprintf(stderr, ERROR \n); Sorry for top posting :( My evolution client is not working . Regards, Jayant [EMAIL PROTECTED] 08/24/05 8:38 PM Hi Jayant, Any suggestion ? according to cppu/inc/com/sun/star/uno/Any.hxx the statement (aAny = aSeq) will be true when aAny could be assigned to aSeq and since you just assigned aSec to aAny I'd suppose that the statement will always be true in your code. What do you hope to achieve with the statement in your setValue method ? Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XCellDataRange :: Where am I going wrong
Hello Jayant Balraj Madavi, just tried the following which works like specified: uno::Any a( static_castsal_Int32(42) ); uno::Sequenceuno::Any seq( a, 1 ); typedef uno::Sequence uno::Sequenceuno::Any seqseqT; seqseqT seqseq( seq, 1 ); uno::Any a2; a2 = seqseq; seqseqT dest; bool succ = (a2 = dest); sal_Int32 n = dest[0][0].getsal_Int32(); This leads me to the assumption that the Any is not filled with data at all in getValue(). regards, -Daniel Hi stephan, Let me put clear code/query, The actual code is with reference to the VBA interop work that we are doing for OOo so if a user writer a VBA script like this on OOo Activesheet.Range(A1:A3).value = Activesheet.Range(A4:A5).Value The above macro breaks down to == MyClass obj1,obj2; obj.setValue (obj2.getValue()); //the function getValue and setValue are described below. I always get the printf ERROR in the setValue :( The same function works properly if I directly work with [uno::Sequence uno::Sequence uno::Any ] instead of return type [uno::Any] but I have to use any b'se there are cases when I require return value as [OUString or long etc ..] //Simple functions uno::Any MyClass::getValue() throw (::com::sun::star::uno::RuntimeException) { uno::Any aAny; uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); if (xData.is()) { uno::Sequence uno::Sequence uno::Any aSeq = xData-getDataArray(); aAny = aSeq; } return aAny; } void MyClass::setValue( const uno::Any aValue ) throw (uno::RuntimeException) { uno::Sequence uno::Sequence uno::Any aSeq; if ((aValue = aSeq)) //FAILING FOR ME { fprintf(stderr, Setting the correct Data \n); uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); xData-setDataArray(aSeq); } else fprintf(stderr, ERROR \n); Sorry for top posting :( My evolution client is not working . Regards, Jayant [EMAIL PROTECTED] 08/24/05 8:38 PM Hi Jayant, Any suggestion ? according to cppu/inc/com/sun/star/uno/Any.hxx the statement (aAny = aSeq) will be true when aAny could be assigned to aSeq and since you just assigned aSec to aAny I'd suppose that the statement will always be true in your code. What do you hope to achieve with the statement in your setValue method ? Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Re: XCellDataRange :: Where am I going wrong
Hi Daniel ( its been a while ;-) ) Daniel Boelzle wrote: Hello Jayant Balraj Madavi, just tried the following which works like specified: uno::Any a( static_castsal_Int32(42) ); uno::Sequenceuno::Any seq( a, 1 ); typedef uno::Sequence uno::Sequenceuno::Any seqseqT; seqseqT seqseq( seq, 1 ); uno::Any a2; a2 = seqseq; seqseqT dest; bool succ = (a2 = dest); sal_Int32 n = dest[0][0].getsal_Int32(); This leads me to the assumption that the Any is not filled with data at all in getValue(). regards, -Daniel looking at this, seems this is really a basic problem ( bug? ). the basic code is something like; Dim obj1 as myModule.XSomething Dim obj2 as myModule.XSomething obj1.Value = obj2.Value where obj1 obj2 are uno objects with Value as an attribute e.g. module myModule { interface XSomething { [attribute] any Value; } } the code ( in a previous posting ) getValue() returns an uno::Any containing uno::Sequence uno::Sequence uno::Any and of course setValue() takes a ref to an uno::Any containing uno::Sequence uno::Sequence uno::Any this fails because when Basic unwraps the any it converts it into a sequence of sequence of ( the type the Any contains ) so for example in the code that Jayant posted the sequence in question is uno::Sequence uno::Sequence uno::Any where the Any contains a rtl::OUString . then setValue() fails because it is sent a uno::Sequence uno::Sequence rtl::OUString by Basic instead of the expected type and of course the test mentioned fails because it should. Noel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XCellDataRange :: Where am I going wrong
Hi Daniel / Noel, Five interesting facts: * The getValue and setValue is working perfectly fine wrt single Value OUString or long. Its the third type uno::Sequence uno::Sequenceuno::Any that is not working :( * The = and = is working perfectly fine for uno::Sequence uno::Sequenceuno::Any in the code sc//unoobj/cellsuno.cxx --function-- getDataArray() (also check ScRangeToSequence::FillMixedArray ). * As Noel suggested, there is a possibility that something is going wrong in basic module. Any to OUString conversion etc. * One interesting fact is that, I had put printf in the code for operator overloading = and = cppu//Any.hxx. const Type rType = getCppuType( value ); //and also rAny rtl::OUString aName = rType.getTypeName(); print_oustring(aName); //my local function and the printf gave proper result :) ie [ ][ ] any for both get and set. I could not veryfy the data part of the cppu//assign.hxx b'se it is bit complex. * In the getValue() the values are filled properly ? Here is the test code snippert that I had written before posting the query. uno::Sequence uno::Sequence uno::Any aSeq = xData-getDataArray(); uno::Any test = aSeq[0][0]; print_String_from_any(test); //my local function aAny = aSeq; //Fill the data to Any //testing the setValue scenario uno::Sequence uno::Sequence uno::Any aSeqNew; if (aAny = aSeqNew) { uno::Any test = aSeqNew[0][0]; print_string_from_any(test); //my local function } else print_error(); works as expected :) Regards, Jayant (aZEN_JM) [EMAIL PROTECTED] 08/25/05 6:20 PM Hello Jayant Balraj Madavi, just tried the following which works like specified: uno::Any a( static_castsal_Int32(42) ); uno::Sequenceuno::Any seq( a, 1 ); typedef uno::Sequence uno::Sequenceuno::Any seqseqT; seqseqT seqseq( seq, 1 ); uno::Any a2; a2 = seqseq; seqseqT dest; bool succ = (a2 = dest); sal_Int32 n = dest[0][0].getsal_Int32(); This leads me to the assumption that the Any is not filled with data at all in getValue(). regards, -Daniel Hi stephan, Let me put clear code/query, The actual code is with reference to the VBA interop work that we are doing for OOo so if a user writer a VBA script like this on OOo Activesheet.Range(A1:A3).value = Activesheet.Range(A4:A5).Value The above macro breaks down to == MyClass obj1,obj2; obj.setValue (obj2.getValue()); //the function getValue and setValue are described below. I always get the printf ERROR in the setValue :( The same function works properly if I directly work with [uno::Sequence uno::Sequence uno::Any ] instead of return type [uno::Any] but I have to use any b'se there are cases when I require return value as [OUString or long etc ..] //Simple functions uno::Any MyClass::getValue() throw (::com::sun::star::uno::RuntimeException) { uno::Any aAny; uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); if (xData.is()) { uno::Sequence uno::Sequence uno::Any aSeq = xData-getDataArray(); aAny = aSeq; } return aAny; } void MyClass::setValue( const uno::Any aValue ) throw (uno::RuntimeException) { uno::Sequence uno::Sequence uno::Any aSeq; if ((aValue = aSeq)) //FAILING FOR ME { fprintf(stderr, Setting the correct Data \n); uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); xData-setDataArray(aSeq); } else fprintf(stderr, ERROR \n); Sorry for top posting :( My evolution client is not working . Regards, Jayant [EMAIL PROTECTED] 08/24/05 8:38 PM Hi Jayant, Any suggestion ? according to cppu/inc/com/sun/star/uno/Any.hxx the statement (aAny = aSeq) will be true when aAny could be assigned to aSeq and since you just assigned aSec to aAny I'd suppose that the statement will always be true in your code. What do you hope to achieve with the statement in your setValue method ? Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XCellDataRange :: Where am I going wrong
Hello Jayant Balraj Madavi, Noel, Well, the initial problem was about pure C++-UNO. It is not clear to me why OOo Basic is involved. So please rephrase the exact problem again. BTW: dumping an uno::Any, you can use comphelper/anytostring.hxx (resp. comphelper::anyToString()). regards, -Daniel * The getValue and setValue is working perfectly fine wrt single Value OUString or long. Its the third type uno::Sequence uno::Sequenceuno::Any that is not working :( * The = and = is working perfectly fine for uno::Sequence uno::Sequenceuno::Any in the code sc//unoobj/cellsuno.cxx --function-- getDataArray() (also check ScRangeToSequence::FillMixedArray ). * As Noel suggested, there is a possibility that something is going wrong in basic module. Any to OUString conversion etc. * One interesting fact is that, I had put printf in the code for operator overloading = and = cppu//Any.hxx. const Type rType = getCppuType( value ); //and also rAny rtl::OUString aName = rType.getTypeName(); print_oustring(aName); //my local function and the printf gave proper result :) ie [ ][ ] any for both get and set. I could not veryfy the data part of the cppu//assign.hxx b'se it is bit complex. * In the getValue() the values are filled properly ? Here is the test code snippert that I had written before posting the query. uno::Sequence uno::Sequence uno::Any aSeq = xData-getDataArray(); uno::Any test = aSeq[0][0]; print_String_from_any(test); //my local function aAny = aSeq; //Fill the data to Any //testing the setValue scenario uno::Sequence uno::Sequence uno::Any aSeqNew; if (aAny = aSeqNew) { uno::Any test = aSeqNew[0][0]; print_string_from_any(test); //my local function } else print_error(); works as expected :) Regards, Jayant (aZEN_JM) [EMAIL PROTECTED] 08/25/05 6:20 PM Hello Jayant Balraj Madavi, just tried the following which works like specified: uno::Any a( static_castsal_Int32(42) ); uno::Sequenceuno::Any seq( a, 1 ); typedef uno::Sequence uno::Sequenceuno::Any seqseqT; seqseqT seqseq( seq, 1 ); uno::Any a2; a2 = seqseq; seqseqT dest; bool succ = (a2 = dest); sal_Int32 n = dest[0][0].getsal_Int32(); This leads me to the assumption that the Any is not filled with data at all in getValue(). regards, -Daniel Hi stephan, Let me put clear code/query, The actual code is with reference to the VBA interop work that we are doing for OOo so if a user writer a VBA script like this on OOo Activesheet.Range(A1:A3).value = Activesheet.Range(A4:A5).Value The above macro breaks down to == MyClass obj1,obj2; obj.setValue (obj2.getValue()); //the function getValue and setValue are described below. I always get the printf ERROR in the setValue :( The same function works properly if I directly work with [uno::Sequence uno::Sequence uno::Any ] instead of return type [uno::Any] but I have to use any b'se there are cases when I require return value as [OUString or long etc ..] //Simple functions uno::Any MyClass::getValue() throw (::com::sun::star::uno::RuntimeException) { uno::Any aAny; uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); if (xData.is()) { uno::Sequence uno::Sequence uno::Any aSeq = xData-getDataArray(); aAny = aSeq; } return aAny; } void MyClass::setValue( const uno::Any aValue ) throw (uno::RuntimeException) { uno::Sequence uno::Sequence uno::Any aSeq; if ((aValue = aSeq)) //FAILING FOR ME { fprintf(stderr, Setting the correct Data \n); uno::Reference sheet::XCellRangeData xData(mxRange,uno::UNO_QUERY); xData-setDataArray(aSeq); } else fprintf(stderr, ERROR \n); Sorry for top posting :( My evolution client is not working . Regards, Jayant [EMAIL PROTECTED] 08/24/05 8:38 PM Hi Jayant, Any suggestion ? according to cppu/inc/com/sun/star/uno/Any.hxx the statement (aAny = aSeq) will be true when aAny could be assigned to aSeq and since you just assigned aSec to aAny I'd suppose that the statement will always be true in your code. What do you hope to achieve with the statement in your setValue method ? Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To
[api-dev] Re: XCellDataRange :: Where am I going wrong
Daniel Boelzle wrote: Hello Jayant Balraj Madavi, Noel, Well, the initial problem was about pure C++-UNO. It is not clear to me why OOo Basic is involved. So please rephrase the exact problem again. BTW: dumping an uno::Any, you can use comphelper/anytostring.hxx (resp. comphelper::anyToString()). regards, -Daniel Hi Daniel, 1st, correct imo there is no was never a c++/uno problem, 2nd worth having another read of my previous posting, but perhaps I wasn't clear enough ;-) so to summarize, my best guess is that when basic encounters a return value which is an Any containing a [ Sequence Sequence Any ], it internally represents this as an [ array of array of the (type that the Any contains) ] and NOT an [ array of array of Any's]. When Basic subsequently uses this value e.g. to pass to a method (expecting an Any ) of another uno object, it (Basic) passes is an Any containing [ Sequence Sequence something else e.g. sal_Int32, String etc. ] but not what the code expects e.g. a [ Sequence Sequence Any ] ;-) so I feel this is a bug, Andreas would know best about that, I'll raise a bug for that. But, you could help here with your expert knowledge, if know of an easy programmatic way to determine the exact type of whats in the Any especially with respect to Sequences Sequences that would be great ;-) Noel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Any way to combine multiple actions into one undo-able action ?
Mathias Bauer wrote: CPH wrote: Hi, I have a button on my UI which performs several actions thru API calls. Is ther anyway which I can get all of these actions to be considered one atomic action by the Undo/Redo mechanism ? Not ATM. But we are currently discussing new APIs for Q. I'm somewhat involved into that and I will take your question as a feature enhancement request. :-) My understanding is that you want to do something like: set mark on undo stack execute API calls set another mark on undo stack and then you would expect that calling Undo would undo *all* the changes you made, and of course a following Redo would do the opposite. The same way we want to make macros undoable in one step. That was in October 2003. Is it possible now to do such things? Regards, Patrik Fimml - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Re: XCellDataRange :: Where am I going wrong
Hi Noel, [...] But, you could help here with your expert knowledge, if know of an easy programmatic way to determine the exact type of whats in the Any especially with respect to Sequences Sequences that would be great ;-) The exact value type of the mentioned uno::Any is [][]any (calling Any::getValueType()), but as I mentioned in my previous mail, it makes more sense to inspect the whole uno::Any (incl. all members of the sequence) using comphelper::anyToString(). -Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Re: XCellDataRange :: Where am I going wrong
Daniel Boelzle wrote: Hi Noel, [...] But, you could help here with your expert knowledge, if know of an easy programmatic way to determine the exact type of whats in the Any especially with respect to Sequences Sequences that would be great ;-) The exact value type of the mentioned uno::Any is [][]any (calling Any::getValueType()), but as I mentioned in my previous mail, it makes more sense to inspect the whole uno::Any (incl. all members of the sequence) using comphelper::anyToString(). -Daniel Thanks Daniel!! Noel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] OO Draw 1.9.122 Basic Runtime Macro Error while drawing polypolygonshape shapes
While using a beta version of OpenOffice, on two different systems(Millennium 2000), a macro which draws a parabola generates the following error consistently after the macro has been run once: Basic Runtime error. An exception occurred Type com.sun.star.lang.IllegalArgumentException Message: sequence element is not assignable by given value If the macro is physically changed by adding a Rem statement, and then rerun, it will work one time, and then repeat this error each time it is run. Is there a method to clear the array which is used to create the shape? Thanks Much, Mike Carmichael ps. This latest version of OO is awesome! the above-referenced - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] OO Draw 1.9.122 Basic Runtime Macro Error while drawing polypolygonshape shapes
Hi, My problem was in the dimensioning! The old code line which did not work, was: Global Shape1(2999) As New com.sun.star.awt.Point In order to use Shape1() in two different subroutines. A sketch of the new code line and arguments added to subroutines is: sub dshape() . . Dim Shape1(2999) As New com.sun.star.awt.Point . . readdata(Shape1) . . PolyPolygonShape.PolyPolygon = Array(Shape1()) . . . sub readdata(Shape1 as variant) . . . shape1(ii-1).x = val(mid(CLine, 5, 15)) . . shape1(ii-1).y = val(mid(CLine, 5, 15)) . . . Thanks again! Paolo Mantovani wrote: Hi Mike, Alle 17:05, venerd 26 agosto 2005, Mike Carmichael ha scritto: While using a beta version of OpenOffice, on two different systems(Millennium 2000), a macro which draws a parabola generates the following error consistently after the macro has been run once: Basic Runtime error. An exception occurred Type com.sun.star.lang.IllegalArgumentException Message: sequence element is not assignable by given value It would be nice to see the code that raises the error... If the macro is physically changed by adding a Rem statement, and then rerun, it will work one time, and then repeat this error each time it is run. It obviusly depends from _where_ you put the Rem... :-) Is there a method to clear the array which is used to create the shape? In general you can do as follow: Redim MyVector() [As type] (the part between square parenthesis is optional, type must be one of the data types supported by StarBasic, like String / Long etc.) or even: MyVector() = Array() I can't say nothing more specific because of the missing source code. regards Paolo M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] [EMAIL PROTECTED] TOPIC: Contributing
Dear OpenOffice.org community, This is the 2-weekly announcement of current issues regarding the OOo API project which I want to hightlight to the community. *** = *** Todays Issue: Contributing to the OOo API Project *** - The OOo community needs YOUR contribution too. And we are sure that you can contribute real value to OOo. Don't know how? YOU too can contribute to the OOo API project by: - Reviewing the documentation and reporting issues if you find any - Useing the OOo API and reporting issues if you find any - Answering the Questions of other Users of the OOo API - Summarizing answers which were given to questions (CodeSnippets) - Contributing your larger API examples to our example collection - Pointing out important articles for the [EMAIL PROTECTED] NEWSLETTER - Tracking unanswered questions on this mailing list - Preparing the next issue of [EMAIL PROTECTED] TOPIC - Writing Test Cases - Translating Examples to C++ (NEW!) - Becoming an Official OOo Contributor Each idea contains a short description of how you could help in its respect, one ore more URLs for more information and an estimation about the efford on the task. *** = *** Reviewing the documentation and report issues if you find any *** - Besides others, the OOo SDK contains a Developers Guide and a Reference Guide. It's not only important for developers who want to develop applications with OOo to know these well. There is also always room for improvement in such documents. Thus, read the documentation: - http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html - http://api.openoffice.org/docs/common/ref/com/sun/star/module-ix.html And when you find anything to improve which you think should actually be improved, report an issue to IssueZilla. After once being registered with IssueZilla, reporting an issue is just a matter of minutes. *** = *** Using the OOo API and reporting issues if you find any *** - Next you might want to use the OOo API for your own projects. Nothing is perfect, thus don't hesitate to report problems you consider worth getting fixed to IssueZilla. Here you find a description of OOos IssueZilla: - http://www.openoffice.org/project_issues.html After once being registered with IssueZilla, reporting an issue is just a matter of minutes. Of course code examples, well stripped down to the point, would help us even more. Thus count about up to 30 minutes for a complex issue. *** = *** Answering the Questions of other Users of the OOo API *** - dev@api.openoffice.org is not an official support medium. But that does not mean, we do not want questions answers. The OOo developers will do their very best to answer questions, but WE NEED YOUR HELP! The OOo core development team is very small compared to competing projects. Thus we cannot answer all questions. If you know an answer of somebody elses question, please post it to the list. If you are not sure, answer anyway, but mention your incertitude. This way you give the core developers more space to answer the tough questions, maybe your next tough question. If you know the answer off hand, it only needs a few minutes to contribute by answering questions. But we appreciate it even more if you have a vague idea and do some research. *** = *** Summarizing answers which were given to questions (CodeSnippets) *** - If you asked a question and got a satisfactory answer with a code example, be so nice and save it for somebody else who might have the same question in future. The mail archive can be searched, but the search features are not good enough, mostly because mails are not structured enough. But there is a better way: Summarize your question and the given answer(s) in an XML format for CodeSnippets. You can find more information here: - http://api.openoffice.org/SDK/snippets/ To delopy a CodeSnippet, you need about 15 minutes each. Don't you think that the answer given to you was worth it? Please submit the created codesnippet to the mailinglist dev@api.openoffice.org and it will be integrated into the snippet-collection on http://codesnippets.services.openoffice.org/ by one of the comminity members with CVS commit rights. As an addon to easily create codesnippets Paolo Mantovani has
[api-dev] Maacro to draw multiple polypolygonshape shapes
Thanks to recent help from the API DEV group volunteers, the below routine works well when creating one shape sub set_draw(byval oPage as variant, byval Gradient as variant,_ byval Shape1 as variant, byval PShape as variant,_ byval PolyPolygon as variant, byval Shapes as object, byval Group as object) PShape.PolyPolygon = Array(Shape1()) PShape.Name = Test asc(jj) oPage.add(PShape) 'combine drawing elements Shapes.add(PShape) Group = oPage.group(Shapes) jj=jj+1 end sub However, when called several times with design data points for several shapes, during the same program session, the routine will create several groups, but only one shape -- this shape ending up being a representation of the last design entity and residing in the last group ... Is there an equivalent to using PShape as an array? I tried this and it did not seem to work. Thanks Much, Mike Carmichael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Any way to combine multiple actions into one undo-able action ?
Patrik Fimml wrote: Mathias Bauer wrote: CPH wrote: Hi, I have a button on my UI which performs several actions thru API calls. Is ther anyway which I can get all of these actions to be considered one atomic action by the Undo/Redo mechanism ? Not ATM. But we are currently discussing new APIs for Q. I'm somewhat involved into that and I will take your question as a feature enhancement request. :-) My understanding is that you want to do something like: set mark on undo stack execute API calls set another mark on undo stack and then you would expect that calling Undo would undo *all* the changes you made, and of course a following Redo would do the opposite. The same way we want to make macros undoable in one step. That was in October 2003. Is it possible now to do such things? We had to do a lot of things for OOo2.0 (as you might have seen from how long it took to approach the final version) and an API for Undo wasn't on the priority list, so it was dropped. It's still on the list for the next version and this time API funtionality in general has a higher priority. But that's not a promise. :-) Ciao, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] 2.0 and changing JAVA-Settings
Hi, asking on dev-dba, Frank redirected me to this list. I want to automate the Java-Settings during and after the installation. So, if a JDBC-Driver is required, the users have to add a classpath via GUI and restart the application. Is there a way to automate this via scripting? There's no jvmsetup in 2.0 anymore, I think. Alternatively a API-solution (Basic) would be appreciated (if no restarting is required). May be, the installation- or the dev-list are the better addresses for this kind of question, but I want to avoid X-postings, so lets start here. Kindly Regards Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] 2.0 and changing JAVA-Settings
Hi, There is a C API (jvmfwk/framework.h) which you can use to set the class path for the current user. It is not possible to set it for all users or particular JREs. I am not sure if you can use a C API from Basic or the other scripting languages. If it is not possible, but it is really important to you, then you could still code a UNO service (C++) that uses this API. The service can then be called from Basic. Regards, Joachim Peter Eberlein wrote: Hi, asking on dev-dba, Frank redirected me to this list. I want to automate the Java-Settings during and after the installation. So, if a JDBC-Driver is required, the users have to add a classpath via GUI and restart the application. Is there a way to automate this via scripting? There's no jvmsetup in 2.0 anymore, I think. Alternatively a API-solution (Basic) would be appreciated (if no restarting is required). May be, the installation- or the dev-list are the better addresses for this kind of question, but I want to avoid X-postings, so lets start here. Kindly Regards Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Any way to combine multiple actions into one undo-able action ?
Hi Patrik, as of right now there is still just the uno dispatch .uno:Undo which for many cases can be sufficient. 2005/8/26, Patrik Fimml [EMAIL PROTECTED]: Mathias Bauer wrote: CPH wrote: Hi, I have a button on my UI which performs several actions thru API calls. Is ther anyway which I can get all of these actions to be considered one atomic action by the Undo/Redo mechanism ? Not ATM. But we are currently discussing new APIs for Q. I'm somewhat involved into that and I will take your question as a feature enhancement request. :-) My understanding is that you want to do something like: set mark on undo stack execute API calls set another mark on undo stack and then you would expect that calling Undo would undo *all* the changes you made, and of course a following Redo would do the opposite. The same way we want to make macros undoable in one step. That was in October 2003. Is it possible now to do such things? Regards, Patrik Fimml - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Best Regards Christian Junker - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Hiding a textField throught the API
Hi Fabricio, How can I hide a document text field using the API (without macros)? Here´s the code that I use for accessing the textfield: XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier) UnoRuntime.queryInterface( XTextFieldsSupplier.class, component); XNameAccess xNamedFieldMasters = xTextFieldsSupplier.getTextFieldMasters(); XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields(); String completeName = com.sun.star.text.FieldMaster.User. + textFieldName; Object fieldMaster = xNamedFieldMasters.getByName(completeName); the TextFields has a property called IsVisible ... setting this to false will hide your User-TextFields. Somethings like XPropertySet FieldProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xEnumeratedFields.nextElement()) FieldProperties.setPropertyValue(IsVisible,Boolean.FALSE) should hide the first textfield in your enumeration ... that is if it is a User-Field ;-) Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] 2.0 and changing JAVA-Settings
Hi Peter, asking on dev-dba, Frank redirected me to this list. I want to automate the Java-Settings during and after the installation. So, if a JDBC-Driver is required, the users have to add a classpath via GUI and restart the application. Is there a way to automate this via scripting? There's no jvmsetup in 2.0 anymore, I think. Alternatively a API-solution (Basic) would be appreciated (if no restarting is required). May be, the installation- or the dev-list are the better addresses for this kind of question, but I want to avoid X-postings, so lets start here. in case of jdbc-drivers you could try to pack your jdbc-driver in a zip file and then add it calling unopkg add yourzipfile ... unopkg might complain that the zip doesn't contain a uno-package, but as far as I know will copy the jar-file and adjust the classpath, so that the driver should work. Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] 2.0 and changing JAVA-Settings
Stephan Wunderlich - Sun Germany - ham02 - Hamburg wrote: Hi Peter, asking on dev-dba, Frank redirected me to this list. I want to automate the Java-Settings during and after the installation. So, if a JDBC-Driver is required, the users have to add a classpath via GUI and restart the application. Is there a way to automate this via scripting? There's no jvmsetup in 2.0 anymore, I think. Alternatively a API-solution (Basic) would be appreciated (if no restarting is required). May be, the installation- or the dev-list are the better addresses for this kind of question, but I want to avoid X-postings, so lets start here. in case of jdbc-drivers you could try to pack your jdbc-driver in a zip file and then add it calling unopkg add yourzipfile ... unopkg might complain that the zip doesn't contain a uno-package, but as far as I know will copy the jar-file and adjust the classpath, so that the driver should work. On CWS sb36, targeting OOo Later, I changed the loading of Java UNO components to no longer use the global Java classpath, so that the above hack will no longer work there. (IIRC, the way new database drivers are integrated into OOo will change then, too; Ocke or Frank on dev@dba.openoffice.org should know more.) -Stephan Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] 2.0 and changing JAVA-Settings
Hi Stephan, in case of jdbc-drivers you could try to pack your jdbc-driver in a zip file and then add it calling unopkg add yourzipfile ... unopkg might complain that the zip doesn't contain a uno-package, but as far as I know will copy the jar-file and adjust the classpath, so that the driver should work. On CWS sb36, targeting OOo Later, I changed the loading of Java UNO components to no longer use the global Java classpath, so that the above hack will no longer work there. (IIRC, the way new database drivers are integrated into OOo will change then, too; Ocke or Frank on dev@dba.openoffice.org should know more.) Hmm. What we will do in DBA is that instead of using the office-wide classpath (Tools|Options|Java|Classpath), we will allow to have a per-database classpath. However, users will still expect that the Tools|Options classpath does work, too. (As they will expect that the system's class path does work, which unfortunately isn't the case even today.) I don't know which changes exactly you plan, but will a UNO component (e.g. database driver) loading a (arbitrary, non-UNO) Java class still use the Tools|Options (or perhaps even the system's) classpath? This is desirable since there might be multiple JDBC-based databases using the same Java class, and of course user's don't want to enter the same classpath again and again. Also, even if what Stephan describes is a hack, it sounds like a convenient way to deploy a Java class into a OOo installation. Shouldn't we continue to offer this convenience, the one way or the other? The more since programmatic manipulation of the office-wide classpath is not possible, since no API (not even configuration API) exists for it. This means that in order to deploy a Java class into a office installation, users would be required to manually add this class to the class path of all of it's clients (which as said could be multiple databases), instead of simply announcing the class *once* to the office installation as a whole. Ciao Frank -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Database http://dba.openoffice.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] 2.0 and changing JAVA-Settings
Frank Schönheit - Sun Microsystems Germany wrote: Hi Stephan, in case of jdbc-drivers you could try to pack your jdbc-driver in a zip file and then add it calling unopkg add yourzipfile ... unopkg might complain that the zip doesn't contain a uno-package, but as far as I know will copy the jar-file and adjust the classpath, so that the driver should work. On CWS sb36, targeting OOo Later, I changed the loading of Java UNO components to no longer use the global Java classpath, so that the above hack will no longer work there. (IIRC, the way new database drivers are integrated into OOo will change then, too; Ocke or Frank on dev@dba.openoffice.org should know more.) Hmm. What we will do in DBA is that instead of using the office-wide classpath (Tools|Options|Java|Classpath), we will allow to have a per-database classpath. Yes, part of which will be the JavaDriverClassPath property alreday added to connectivity on CWS sb36 (I just could not remember the details, and had to look this up again). However, users will still expect that the Tools|Options classpath does work, too. (As they will expect that the system's class path does work, which unfortunately isn't the case even today.) Anything added to the Tools|Options classpath will continue to be available to all Java code in OOo (as the Tools|Options classpath is added to the JVM's classpath when the JVM is started from within OOo). I don't know which changes exactly you plan, but will a UNO component (e.g. database driver) loading a (arbitrary, non-UNO) Java class still use the Tools|Options (or perhaps even the system's) classpath? This is desirable since there might be multiple JDBC-based databases using the same Java class, and of course user's don't want to enter the same classpath again and again. Again, if you put some Java classes into the Tools|Options classpath, a Java UNO component will find them. However, a Java UNO component itself will no longer end up on the JVM's classpath, so classes from one Java UNO component will no longer be visible to other Java UNO components. Also, even if what Stephan describes is a hack, it sounds like a convenient way to deploy a Java class into a OOo installation. Shouldn't we continue to offer this convenience, the one way or the other? Especially in the context of UNO components, yes, we will have to think about how to handle the dependencies of a UNO component---dependencies on other UNO components as well as dependencies on other kinds of entities like dynamic libraries or JAR files. Expect something for post OOo 2.0 in this area... -Stephan The more since programmatic manipulation of the office-wide classpath is not possible, since no API (not even configuration API) exists for it. This means that in order to deploy a Java class into a office installation, users would be required to manually add this class to the class path of all of it's clients (which as said could be multiple databases), instead of simply announcing the class *once* to the office installation as a whole. Ciao Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] 2.0 and changing JAVA-Settings
Hi Stephan, Also, even if what Stephan describes is a hack, it sounds like a convenient way to deploy a Java class into a OOo installation. Shouldn't we continue to offer this convenience, the one way or the other? Especially in the context of UNO components, yes, we will have to think about how to handle the dependencies of a UNO component---dependencies on other UNO components as well as dependencies on other kinds of entities like dynamic libraries or JAR files. Expect something for post OOo 2.0 in this area... /me sighs with relief. Thanks Ciao Frank -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Database http://dba.openoffice.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] 2.0 and changing JAVA-Settings
Am Montag, den 29.08.2005, 10:17 +0200 schrieb Peter Eberlein: Hi, asking on dev-dba, Frank redirected me to this list. I want to automate the Java-Settings during and after the installation. So, if a JDBC-Driver is required, the users have to add a classpath via GUI and restart the application. Is there a way to automate this via scripting? There's no jvmsetup in 2.0 anymore, I think. Alternatively a API-solution (Basic) would be appreciated (if no restarting is required). I don't know for sure, but maybe your goal can be reached by: - using a response file for installation - adding the path to the jvm to the shared part after -net installation before any user installation At least for OOo1.1.x you could write to base/share/config/javarc ... but I'm not using 2.x. HTH, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Maacro to draw multiple polypolygonshape shapes
Hi Stephan, After taking Andy's hint regarding passing parameters, I've almost got this to work ... the shapes are being created when I pass PShape as the only argument to set_draw, but now no groups are created. Got to be something simple! Thanks for all the help, when I get it right, then I'll send the code in a followup email. Mike Stephan Wunderlich - Sun Germany - ham02 - Hamburg wrote: Hi Mike, Thanks to recent help from the API DEV group volunteers, the below routine works well when creating one shape sub set_draw(byval oPage as variant, byval Gradient as variant,_ byval Shape1 as variant, byval PShape as variant,_ byval PolyPolygon as variant, byval Shapes as object, byval Group as object) PShape.PolyPolygon = Array(Shape1()) PShape.Name = Test asc(jj) oPage.add(PShape) 'combine drawing elements Shapes.add(PShape) Group = oPage.group(Shapes) jj=jj+1 end sub However, when called several times with design data points for several shapes, during the same program session, the routine will create several groups, but only one shape -- this shape ending up being a representation of the last design entity and residing in the last group ... Is there an equivalent to using PShape as an array? I tried this and it did not seem to work. Hard to see what doesn't work from this snippet :-) Well I tried the following and it nicely inserts me several PolypolygonShapes. --- sub main Shapes = ThisComponent.DrawPages(0) createShape(-3500) createShape(0) createShape(3500) Shapes.group(Shapes) end sub sub createShape(addme as Integer) aShape = ThisComponent.createInstance(com.sun.star.drawing.PolyPolygonShape) Shapes = ThisComponent.DrawPages(0) Shapes.add(aShape) Dim oSize As new com.sun.star.awt.Size Dim oPosition As new com.sun.star.awt.Point oSize.Width = 0 oSize.Height = 0 oPosition.X = 500+addme oPosition.Y = 500+addme aShape.Size = oSize aShape.Position = oPosition Dim ps1(3) As new com.sun.star.awt.Point ps1(0).X = 5000+addme : ps1(0).Y = 5000+addme ps1(1).X = 1+addme : ps1(1).Y = 5000+addme ps1(2).X = 1+addme : ps1(2).Y = 1+addme ps1(3).X = 5000+addme : ps1(3).Y = 1+addme Dim ps2(3) As new com.sun.star.awt.Point ps2(0).X = 6500+addme : ps2(0).Y = 6500+addme ps2(1).X = 8500+addme : ps2(1).Y = 6500+addme ps2(2).X = 8500+addme : ps2(2).Y = 8500+addme ps2(3).X = 6500+addme : ps2(3).Y = 8500+addme Dim psA(1) As Variant psA(0) = ps1() psA(1) = ps2() aShape.setPropertyValue(PolyPolygon, psA()) End sub --- Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Hiding a textField throught the API
Worked just fine. Thank you, Stephan. But, in my application, I need to hide a textfield that has a given name. How would be the code for that? On 8/29/05, Stephan Wunderlich - Sun Germany - ham02 - Hamburg [EMAIL PROTECTED] wrote: Hi Fabricio, How can I hide a document text field using the API (without macros)? Here´s the code that I use for accessing the textfield: XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier) UnoRuntime.queryInterface( XTextFieldsSupplier.class, component); XNameAccess xNamedFieldMasters = xTextFieldsSupplier.getTextFieldMasters(); XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields(); String completeName = com.sun.star.text.FieldMaster.User. + textFieldName; Object fieldMaster = xNamedFieldMasters.getByName(completeName); the TextFields has a property called IsVisible ... setting this to false will hide your User-TextFields. Somethings like XPropertySet FieldProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xEnumeratedFields.nextElement()) FieldProperties.setPropertyValue(IsVisible,Boolean.FALSE) should hide the first textfield in your enumeration ... that is if it is a User-Field ;-) Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Hiding a textField throught the API
Hi Fabricio, Worked just fine. Thank you, Stephan. But, in my application, I need to hide a textfield that has a given name. How would be the code for that? When you have a Enumeration of your TextFields you can query each of them for an XDependentTextField. UserFields are those and then you can call the method getTextFieldMaster() at this and get the property name from the returned PropertySet. If the TextFieldMaster has the name you search you can set the property IsVisible at the corresponding TexField. Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Hiding a textField throught the API
Thank you again Stephan. Now it´s doing what I want. Just for curiosity and future needs: is there any reference where IsVisible property is specified for textfields? Did not find anything in the Developer's Guide (v1.1 from December 2003) and in the api specification (sdk v1.1). In the Developer's Guide I found IsVisible propertie only for other components, like Spreadsheets and Layers. On 8/30/05, Stephan Wunderlich - Sun Germany - ham02 - Hamburg [EMAIL PROTECTED] wrote: Hi Fabricio, Worked just fine. Thank you, Stephan. But, in my application, I need to hide a textfield that has a given name. How would be the code for that? When you have a Enumeration of your TextFields you can query each of them for an XDependentTextField. UserFields are those and then you can call the method getTextFieldMaster() at this and get the property name from the returned PropertySet. If the TextFieldMaster has the name you search you can set the property IsVisible at the corresponding TexField. Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] [ooeclipseintegration] new release for the Eclipse plugin
Hi everybody, I have just commited a new release for the Eclipse plugin enabling OOo / SO development. The new features are: + New service wizard + Incorporation of the new service wizard inthe new project wizard + Separation of the OOo and SDK configuration + Correction of some bugs reported + Adding cheat sheets to guide the user through the project creation task + Full compatibility with Eclipse internationalization system You can test it now, and tell me what could be better, what doesn't work for you and what could be added. You can find the build zip on the api CVS: ooeclipseintegration/build/ooeclipseintegration.zip http://api.openoffice.org/source/browse/api/ooeclipseintegration/build/ooeclipseintegration.zip Cedric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Insert Image in a TextTable
Hi Giorgio, The problem is the following: i have inserted a graphic object in a Bookmark into a TextTable, but now i have a reference to a Cell but don't have a bookmark... I have utilised this code: // oWriter is my document objCell=oWriter.getTextTables().getByName(MyTableName).getCellByName(MyCellName) //reference to my TextCell Now i have a problem to insert the graphic object with the method insertTextContent because i do not know like putting in relation the object objCell with the method and with the his parameters. you can query your objCell to an XText, lets call it cellText and then call something like cellText.insertTextContent(cellText.createTextCursor,objGraph,Boolean.TRUE) Hope that helps Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Get document from table
Hello! I have a XTextTable. How can I get the interface of the document in which the table is embedded? I need this in 2 situations: I want to change a cell-format, but XNumberFormatsSupplier can not be obtained from a XTextTable. I want to get a view-cursor, which cannot be obtained from a XTextTable as well. Is this only possible when having the document-interface, too? Regards Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] 2.0 and changing JAVA-Settings
Hi Peter, Its not working for me. That file also contains jre settings. Eventhough the jre is same and installed in same path in all the machines VENDORDATA element in the javasettings_windows_x86.xml is different for every user. I dont know how they are calculating that long string. As that information is wrong while loading openoffice it says jre is corrupted. Any clues.. Anyone have any idea abt what VENDORDATA means.. Thanks, Dinesh Peter Eberlein wrote: Hi Joerg Joerg Barfurth schrieb: Joachim Lingner wrote: Hi, There is a C API (jvmfwk/framework.h) which you can use to set the class path for the current user. It is not possible to set it for all users or particular JREs. Is there no API to change classpath for all users or is it really not possible - i.e. is there really no place where a shared or default classpath is stored? If there really is no possibility, then that is a huge problem for large deployments. Otherwise, if there is a file to edit, then that of course could be scripted. Ciao, Joerg copying the javasettings_windows_x86.xml into UserProfile/config did the job. Couldn't believe, that it is so easy. Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] [ooeclipseintegration] OpenOffice.org integration in Eclipse
Le Lundi 1 Août 2005 10:07, [EMAIL PROTECTED] a écrit : Hi Pierre André, Hi Cedric, First of all, I would like to apologize for the delay in my answer. Holydays with no internet connection are very good for resting but not so good for developping ;-) Quoting Pierre-André [EMAIL PROTECTED]: First of all, I would like to thank-you for taking the time to do this integration with Eclipse ! It will help developpers to gain precious time ! I thank you for your effort to get time to improve my work :-) Eclipse people have tested a bit the plugin to help me correcting some bugs. For now, I was not able to find the time to test your plug-in, but will try to manage it as soon as possible ( I hope before the end of the week) ! Philippe Ombredanne wrote a small article on my work and OpenOffice.org development. You can find it here : http://eclipse.techforge.com/index.php/article/171. He asked me to write something more precise when I would get more time, if you already have ideas we could write a common article to promote OpenOffice.org development :-) I would be glad to do so ! You can contact me directly if you want some help. To give some feedbacks (even if I have still not tested your plug... I hope not to tell to many non-sense) here are some ideas. A feature which could be nice would be to select different types of projects. When working with OpenOffice.org, I noticed, that different types of projects can be coded : - a component (with IDLC...). - a new menu (linkied with code). - linking it with external libraries or external code (QT...). This could allow an application to communicate with OOo easily. - Import / Export filters (C++, Java or XSL) - ... Giving the choice to select which type of project each one wants to develop could help and create more specific code. To continue your effort, it would be nice to have the same for C++ or Python with KDevelop ! Some volunteers ? Hope this helps. Cheers, Pierre-Andre -- StarXpert - www.starxpert.fr e-mail : [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] [ooeclipseintegration] OpenOffice.org integration in Eclipse
Hi Pierre-Andre, Selon Pierre-André [EMAIL PROTECTED]: First of all, I would like to apologize for the delay in my answer. Holydays with no internet connection are very good for resting but not so good for developping ;-) Hollidays aren't normally given to developp ;-) However I did it... Quoting Pierre-André [EMAIL PROTECTED]: First of all, I would like to thank-you for taking the time to do this integration with Eclipse ! It will help developpers to gain precious time ! I thank you for your effort to get time to improve my work :-) Eclipse people have tested a bit the plugin to help me correcting some bugs. For now, I was not able to find the time to test your plug-in, but will try to manage it as soon as possible ( I hope before the end of the week) ! Philippe Ombredanne wrote a small article on my work and OpenOffice.org development. You can find it here : http://eclipse.techforge.com/index.php/article/171. He asked me to write something more precise when I would get more time, if you already have ideas we could write a common article to promote OpenOffice.org development :-) I would be glad to do so ! You can contact me directly if you want some help. To give some feedbacks (even if I have still not tested your plug... I hope not to tell to many non-sense) here are some ideas. A feature which could be nice would be to select different types of projects. When working with OpenOffice.org, I noticed, that different types of projects can be coded : - a component (with IDLC...). - a new menu (linkied with code). - linking it with external libraries or external code (QT...). This could allow an application to communicate with OOo easily. - Import / Export filters (C++, Java or XSL) - ... Giving the choice to select which type of project each one wants to develop could help and create more specific code. For the moment I have developped a new wizard to create generic OOo projects. There is an editor for idl files and all the compiler chain for Java. The next release adds a new service wizard: this helps a idl writer to create a new service (as specified in the OOo2.0 grammar). This will lead to more specified wizards for Calc and Chart add-ins, Add-ons and remote OOo clients. However your propositions are interesting: this could be very useful to manage XSL filters, or generate the package for an add-on. This simply takes a lot of time that I do not have for the moment. School will begin after the OOoCon2005 and I'll have much less time (even tought I want to spare some times with girlfriend (I don't know how to say fiancée in english :-()) To continue your effort, it would be nice to have the same for C++ or Python with KDevelop ! Some volunteers ? This can even be done with Eclipse: I just do not have much time to understand the C++ and Python plugins. The last one is not as good as the Java or C++ one, however, it could helps. If somebody wants to help me, it would be welcome too ;-) Thanks for your help, Cedric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] How to connect to an OpenOffice on a computer you don't know?
Hello! I want to write a small application which uses OpenOffice and which I want to share with others as freeware. The problems are: - I don't know which port the OpenOffice is listing to (or if it listens at all). What is the recommended way? I don't want the user to change the Setup.xcu manually. - I don't know which path OpenOffice is installed. The problem is that I need to know where the DLLs (for example cppu3.dll) are located to set the path of my application. The application should be written in C++, but I assume the problem occurs in other languages as well. Thanks in advance. Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] How to connect to an OpenOffice on a computer you don't know?
Hi Martin, Martin Thoma wrote: Hello! I want to write a small application which uses OpenOffice and which I want to share with others as freeware. The problems are: - I don't know which port the OpenOffice is listing to (or if it listens at all). What is the recommended way? I don't want the user to change the Setup.xcu manually. first of all i like the question on your subject, it was really fun in the morning ;-) You shouldn't use a socket connection. Take a look into the new SDK for OO2.0 and into the examples using the new simple bootstrap mechanism. With this new bootstrap mechanism it is not necessary to know where the office is installed. You siumply run your application and it starts the default office (if one is availble) of the user automatically. - I don't know which path OpenOffice is installed. The problem is that I need to know where the DLLs (for example cppu3.dll) are located to set the path of my application. The new process does it for you. In C++ you rename your application for example MyApp to _MyApp and copy the unoapploader binary (SDK\platfrom\bin directory) in the same directory as your application and rename it to your orginal application name. MyApp - _MyApp unoapploader - MyApp That's it, the unoapploader prepare an appropriate environment and you don't need the office program director directly in your path. yur original application is started in this new environment. The application should be written in C++, but I assume the problem occurs in other languages as well. we support this mechaism for Java as well ;-) - Juergen Thanks in advance. Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [api-dev] How to connect to an OpenOffice on a computer you don't know?
Hi Jürgen, first of all i like the question on your subject, it was really fun in the morning ;-) I do my very best ;-) You shouldn't use a socket connection. Take a look into the new SDK for OO2.0 and into the examples using the new simple bootstrap mechanism. With this new bootstrap mechanism it is not necessary to know where the office is installed. You siumply run your application and it starts the default office (if one is availble) of the user automatically. Works great, thanks! Thats really easy, and you don't have to play around what happens if OO hasn't been started yet. - I don't know which path OpenOffice is installed. The problem is that I need to know where the DLLs (for example cppu3.dll) are located to set the path of my application. The new process does it for you. In C++ you rename your application for example MyApp to _MyApp and copy the unoapploader binary (SDK\platfrom\bin directory) in the same directory as your application and rename it to your orginal application name. MyApp - _MyApp unoapploader - MyApp That's it, the unoapploader prepare an appropriate environment and you don't need the office program director directly in your path. yur original application is started in this new environment. Thanks for that, too. I assume the source is available for that, because I already got an apploader for my app and in integration would be nice (but not necessary ;-)) Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] Force reformat in Writer?
Hello! I want to find a word in a Writers document and add text-sentences there until a new page is created. I use XPageCursor to determinate how many pages there are in the document. My problem is: After insertion of a text-sentence, it seems that the layout is not updated immediately (especially if there is a lot of other text after the inserted text). So my function to get the page-count doesn't work correctly at this time. It however works correctly when adding a Sleep-command after the insertion. I tried XTextDocument::reformat to enforce the reformatting, but without success. Any ideas about it? Thanks in advance Martin Code (to test it I'm just inserting paragraphs), using OO 1.9.125: void OOExpandToPageEnd(ReferenceXInterface rDoc, CString sTag) { // Find sTag Reference XSearchable rSearchable ( rDoc, UNO_QUERY ); Reference XSearchDescriptor rSearch = rSearchable-createSearchDescriptor(); Reference XPropertyReplace rPropSearch (rSearch, UNO_QUERY); rPropSearch-setPropertyValue(ToStr(SearchCaseSensitive), makeAny((sal_Bool)false)); rPropSearch-setPropertyValue(ToStr(SearchWords), makeAny((sal_Bool)false)); rSearch-setSearchString(ToStr(sTag)); Reference XTextRange rFound (rSearchable-findFirst(rSearch), UNO_QUERY); if (!rFound.is()) { return ; } // Get originally page-count int nCount = OOGetPageCount(rDoc); Reference XSimpleText rText (rFound-getText(), UNO_QUERY); Reference XTextDocument rTxtDoc ( rDoc, UNO_QUERY ); int nCountCurrent = OOGetPageCount(rDoc); while (nCountCurrent == nCount) { rText-insertControlCharacter(rFound-getStart(), ControlCharacter::PARAGRAPH_BREAK, false); rTxtDoc-reformat(); // - Doesn't make OOGetPageCount to work // Sleep(500); // - Makes OOGetPageCount to work nCountCurrent = OOGetPageCount(rDoc); } } int OOGetPageCount(ReferenceXInterface rInterface) { ReferenceXModel rModel (rInterface, UNO_QUERY); ReferenceXTextViewCursorSupplier rCurSup (rModel-getCurrentController(), UNO_QUERY); ReferenceXPageCursor rCursor (rCurSup-getViewCursor(), UNO_QUERY); rCursor-jumpToLastPage(); return rCursor-getPage(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]